bids-standard / bids-starter-kit

The Starter-kit has moved to the new BIDS website.
https://bids-website.readthedocs.io/en/latest/getting_started/
Creative Commons Attribution 4.0 International
261 stars 110 forks source link

Accounting for inconsistent task splitting between sessions #193

Closed Aaronearlerichardson closed 3 years ago

Aaronearlerichardson commented 3 years ago

I am trying to come up with a BIDS solution to the following problem.

We are running participants through an ieeg study. Each task is split up into multiple blocks (delimited as runs for BIDS). Participants occasionally get tired and have to stop between blocks, meaning they have to pick up where they left off in the following session. Here is a sample BIDS data set where the participant got tired after block 01 of the "Sent" task.

└───sub-d053
    │   sub-d053_coordsystem.json
    │   sub-d053_electrodes.tsv
    │   sub-d053_events.json
    │   sub-d053_task-Phon_channels.tsv
    │   sub-d053_task-Timt_channels.tsv
    │
    ├───ses-01
    │   ├───anat
    │   │       sub-d053_ct.json
    │   │       sub-d053_ct.nii.gz
    │   │       sub-d053_T1w.json
    │   │       sub-d053_T1w.nii.gz
    │   │
    │   └───ieeg
    │           sub-d053_acq-render_photo.jpg
    │           sub-d053_task-Phon_events.tsv
    │           sub-d053_task-Phon_run-01_ieeg.edf
    │           sub-d053_task-Phon_run-01_ieeg.json
    │           sub-d053_task-Phon_run-02_ieeg.edf
    │           sub-d053_task-Phon_run-02_ieeg.json
    │           sub-d053_task-Phon_run-03_ieeg.edf
    │           sub-d053_task-Phon_run-03_ieeg.json
    │           sub-d053_task-Phon_run-04_ieeg.edf
    │           sub-d053_task-Phon_run-04_ieeg.json
    │           sub-d053_task-Sent_events.tsv
    │           sub-d053_task-Sent_run-01_ieeg.edf
    │           sub-d053_task-Sent_run-01_ieeg.json
    │
    └───ses-02
        └───ieeg
                sub-d053_acq-render_photo.jpg
                sub-d053_task-Sent_events.tsv
                sub-d053_task-Sent_run-02_ieeg.edf
                sub-d053_task-Sent_run-02_ieeg.json
                sub-d053_task-Sent_run-03_ieeg.edf
                sub-d053_task-Sent_run-03_ieeg.json
                sub-d053_task-Timt_events.tsv
                sub-d053_task-Timt_run-01_ieeg.edf
                sub-d053_task-Timt_run-01_ieeg.json

If I wanted to keep all the blocks of a single task in the same place, could I add a session entity to the remaining "Sent" task blocks and then add them to the ses-01 folder? It would look like this:

    ├───ses-01
    │   ├───anat
    │   │       sub-d053_ct.json
    │   │       sub-d053_ct.nii.gz
    │   │       sub-d053_T1w.json
    │   │       sub-d053_T1w.nii.gz
    │   │
    │   └───ieeg
    │           sub-d053_acq-render_photo.jpg
    │           sub-d053_task-Phon_events.tsv
    │           sub-d053_task-Phon_run-01_ieeg.edf
    │           sub-d053_task-Phon_run-01_ieeg.json
    │           sub-d053_task-Phon_run-02_ieeg.edf
    │           sub-d053_task-Phon_run-02_ieeg.json
    │           sub-d053_task-Phon_run-03_ieeg.edf
    │           sub-d053_task-Phon_run-03_ieeg.json
    │           sub-d053_task-Phon_run-04_ieeg.edf
    │           sub-d053_task-Phon_run-04_ieeg.json
    │           sub-d053_task-Sent_events.tsv
    │           sub-d053_task-Sent_run-01_ieeg.edf
    │           sub-d053_task-Sent_run-01_ieeg.json
    │           sub-d053_ses-02_task-Sent_run-02_ieeg.edf
    │           sub-d053_ses-02_task-Sent_run-02_ieeg.json
    │           sub-d053_ses-02_task-Sent_run-03_ieeg.edf
    │           sub-d053_ses-02_task-Sent_run-03_ieeg.json

Does this solution work?

Remi-Gau commented 3 years ago

Hey again . :smile:

2 things:

First if you have ses folder you are going to need to include this into the file name.

See below.

└───sub-d053
    │  ...
    │
    ├───ses-01
    │   ├───anat
    │   │       sub-d053_ses-01_ct.json
    │   │       ...
    │   │
    │   └───ieeg
    │           sub-d053_ses-01_acq-render_photo.jpg
    │           sub-d053_ses-01_task-Phon_events.tsv
    │           sub-d053_ses-01_task-Phon_run-01_ieeg.edf
    │           sub-d053_ses-01_task-Phon_run-01_ieeg.json

Concerning your problem of interrupted task, you can use the fact that in BIDS "sessions" or "logical" units and not temporal one.

That means that you can group files because they "logically" go together .

└───sub-d053
    │   ...
    │
    ├───ses-01
    │   ├───anat
    │   │       ...
    │   │
    │   └───ieeg
    │          ...
    │           sub-d053_ses-01_task-Sent_events.tsv
    │           sub-d053_ses-01_task-Sent_run-01_ieeg.edf
    │           sub-d053_ses-01_task-Sent_run-01_ieeg.json
    │           sub-d053_ses-01_task-Sent_run-02_ieeg.edf       <------------ that's the second half of your task that was run on day 2
    │           sub-d053_ses-01_task-Sent_run-02_ieeg.json 
    │
    └───ses-02
        └───ieeg
                ...
                sub-d053_ses-02_task-Sent_events.tsv
                sub-d053_ses-02_task-Sent_run-01_ieeg.edf
                sub-d053_ses-02_task-Sent_run-01_ieeg.json

To then keep track of what was run when, you can use the `scans.tsv``files that you put in the session folder and that list what run happened on what dayt and time.

https://bids-specification.readthedocs.io/en/stable/03-modality-agnostic-files.html#scans-file

Does that make sense?

Aaronearlerichardson commented 3 years ago

I see, so "sessions" can just mean one full run through of all tasks. This as opposed to one continuous scanning session with no interruptions. Is that what you mean?

Remi-Gau commented 3 years ago

in short "yes". :-)

Here is the official definition of session in the BIDS spec:


Session - a logical grouping of neuroimaging and behavioral data consistent across subjects. Session can (but doesn't have to) be synonymous to a visit in a longitudinal study. In general, subjects will stay in the scanner during one session. However, for example, if a subject has to leave the scanner room and then be re-positioned on the scanner bed, the set of MRI acquisitions will still be considered as a session and match sessions acquired in other subjects. Similarly, in situations where different data types are obtained over several visits (for example fMRI on one day followed by DWI the day after) those can be grouped in one session. Defining multiple sessions is appropriate when several identical or similar data acquisitions are planned and performed on all -or most- subjects, often in the case of some intervention between sessions (for example, training).

https://bids-specification.readthedocs.io/en/stable/02-common-principles.html#definitions


dorahermes commented 3 years ago

@Aaronearlerichardson is this resolved?

Should this be added to a FAQ?