Giter Site home page Giter Site logo

cpp-lln-lab / cpp_bids Goto Github PK

View Code? Open in Web Editor NEW
1.0 5.0 9.0 2.88 MB

a set of matlab / octave function to create BIDS comptible folder structure and filenames

Home Page: https://cpp-bids.readthedocs.io/en/dev/index.html

License: MIT License

MATLAB 70.19% Jupyter Notebook 29.55% Makefile 0.25%
bids eeg fmri eyetracker matlab octave

cpp_bids's People

Contributors

allcontributors[bot] avatar cerenb avatar dependabot[bot] avatar marcobarilari avatar pre-commit-ci[bot] avatar remi-gau avatar tomaslenc avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cpp_bids's Issues

Update doc

  • split into several files

Binder example

  • initialization of extracolumns
  • explain how to create the different JSON files
  • save stim file
  • save for EEG
  • save for iEEG
  • save for MEG

cfg setDefault usage

I always forget, and was looking in README for usage of functions. first we set values in our experiment setParams.m and then run CPP_BIDS functions (e.g. userInput and createFilename). createFilename will set fields IF it's not set previously. Right? So my cfg.fields should be filled before I call BIDS functions.

Would you like to add one sentence somewhere that first the user should run their getParams and set all the fields. Then empty fields would be filled by the default values in CPP_BIDS functions.. I can add it as well, if you can point out where that info should be? e.g. in usage notebook?

save stim file

is it possible to create two different output file? e.g. .tsv file for stimulus and .tsv file for tapping

creating unasked folder

it might be my issue, will check but now the code is creating eyetracker folder in addition to beh folder.

createFilename input reordering

It calls createFilename(expParameters,cfg)
I'm proposing to be consistent with the rest of the scripts the following order change:
createFilename(cfg,expParameters)

Unit tests

  • check good saveEvent behavior when the first event is empty
  • check warning behavior when an saveEvent has to deal with an empty event
  • make sure trial type, onset and duration are properly init
  • check warning behavior when an array is too long
  • create tests for errors

inccorect saved ouput by readAndFilterLogfile

@Remi-Gau and @marcobarilari this is still open issue right? I see the .tsv file is only producing 1-line instead of saving the full output structure. I see it's because of how readAndFilterLogfile is creating the data structure and how tsvwrite function reads, basically the dimensions do not match. the output readandFilterLogfile is size = 1, and tsvwrite goes through that size option.
The test_readAndFilter does not fail because it does not look at how .tsv file is saved - which is only saving the 1-line of the output.

Originally posted by @CerenB in #104 (comment)

make trial_type not required

The BIDS specs only have onset and duration as required so make sure that saveEvents skips events with the wrong values.

bids addpath

Atm, when the bids added with
addpath(fullfile(pth, 'lib', 'CPP_BIDS', 'src'));
due to the subfunc folder is not inside src, would it be an issue? Will check it now. (after resolving the following error)

saveEventsFile - warning

  1. Warning
    It seems to be passing this warning when there's nan. But I think I still have nans - as early Xmas decoration in my response collection array, somehow. Thus I have 13 (number of button pressed) error messages like this:
Warning: Missing some target data for this event. 
> In saveEventsFile>checkExtracolumns (line 240)
  In saveEventsFile>checklLogFile (line 166)
  In saveEventsFile (line 84)
  In fMRIMainExperiment (line 229) 
           onset: 199.7325
      trial_type: 'response'
        duration: 0
        key_name: 'space'
         pressed: 1
          fileID: []
    extraColumns: []
          target: NaN
  1. It does not separate the time of the date in the saving name:
    sub-001_ses-001_task-RhythmCategFT_run-001_events_date-202007272044.tsv previously it was:
    sub-001_ses-001_task-RhythmCategFT_run-001_events_date-20200727_2044.tsv
    Previous version was slightly easier for a human to read.

json createDataDictionary overwrite

I'm opening two logfiles (_event and _stim) consecuitively. When I only open the logfile (_event) with extraColumn, createDataDictionary nicely creates a json file with all the extra columns.
Then when I open the following, _stim, that json file for the logfile / _event got back to its default settings without the extraColumns.

Any idea why is it happening?

    % create  logfile with extra columns to save - BIDS
    logFile.extraColumns = cfg.extraColumns;
    [logFile]  = saveEventsFile('open', cfg, logFile); %dummy initialise

    % set the real length of columns
    logFile(1).extraColumns.LHL24.length = 12;
    logFile(1).extraColumns.PE4.length = 12;

    % actual inititalization
    logFile = saveEventsFile('open', cfg, logFile);
    
    % create response file - used for counting button press
    responseFile.extraColumns = cfg.responseExtraColumns;
    responseFile  = saveEventsFile('open_stim', cfg, responseFile);

[INFRA] Error in CI on checking the markdown

Error in CI on checking the markdown

https://travis-ci.com/github/cpp-lln-lab/CPP_BIDS/jobs/430652513

$ npm install `cat npm-requirements.txt`

Unhandled rejection Error: EACCES: permission denied, mkdir '/home/travis/.npm/_cacache/content-v2/sha512/a4/f5'

Unhandled rejection Error: EACCES: permission denied, mkdir '/home/travis/.npm/_cacache/content-v2/sha512/33/9a'

Unhandled rejection Error: EACCES: permission denied, mkdir '/home/travis/.npm/_cacache/content-v2/sha512/ce/b2'

Unhandled rejection Error: EACCES: permission denied, mkdir '/home/travis/.npm/_cacache/content-v2/sha512/d2/66'

Unhandled rejection Error: EACCES: permission denied, mkdir '/home/travis/.npm/_cacache/content-v2/sha512/a2/ce'

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:

npm ERR!     <https://npm.community>

npm ERR! A complete log of this run can be found in:

npm ERR!     /home/travis/.npm/_logs/2020-11-08T10_35_52_601Z-debug.log

The command "npm install `cat npm-requirements.txt`" failed and exited with 1 during .

Originally posted by @Remi-Gau in #120 (comment)

userInput need else condition for subjectGrp variable

if askGrpSess(1)
        subjectGrp = lower(input('Enter subject group (leave empty if none): ', 's'));
    end

At the moment, outside of debug mode, there's no subjectGrp assignment if askGrpSess =0. So the script crashes there.

lower case in saveEventFile

is it compulsory for BIDS? If yes, then nothing can be done, I see. But if it's not having small letters all the way through does not help to read variables in logfile.

consider making subjectGrp optional

in createFilename.m
at the current state, in userInput function I can leave the group part empty but then in createFilename gives error that
Reference to non-existent field 'subjectGrp'

cannot save cell input

In SaveEventFile.m, I cannot save cell array. Is there a solution or suggestion for this?

Error using fprintf
Function is not defined for 'cell' inputs.

Error in saveEventsFile (line 86)
                   fprintf(logFile(1).eventLogFile, '%f\t', data);

Error in tapMainExperiment (line 102)
       saveEventsFile('save', expParam, currSeq, ...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.