Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for input data in BIDS format #13

Open
2 tasks
p-j-smith opened this issue Sep 5, 2024 · 4 comments
Open
2 tasks

Add support for input data in BIDS format #13

p-j-smith opened this issue Sep 5, 2024 · 4 comments
Labels
enhancement New feature or request priority: medium Medium priority

Comments

@p-j-smith
Copy link
Collaborator

Motivation

Suggested by Chris via email:

Most the of the imaging data (of ENIGMA-PD and otherwise) is nowadays organized according to BIDS format. I would advise to either modify the script so that it can directly work on data formatted according to BIDS (and save the output to the so called derivatives folder) or if that is too much work to add a script to the container (that you for example can call with apptainer exec Enigma-PD-WML.sif bids-2-input.sh) that converts/transfers the data from the bids folder to the input folder you need to run the WML pipeline.

Pitch

  • modify the analysis script to handle data formatted according to BIDS
  • save the output to the derivatives folder

Alternatives

No response

Additional context

No response

@p-j-smith p-j-smith changed the title Add flag to Add support for input data in BIDS format Sep 5, 2024
@p-j-smith p-j-smith added enhancement New feature or request priority: medium Medium priority labels Sep 5, 2024
@K-Meech
Copy link
Collaborator

K-Meech commented Sep 12, 2024

BIDS is predominantly a folder structure and naming scheme for organising nifti files from multiple subjects and sessions. While our current data structure is (for subject ids 1 and 2):

data
    ├───1
    │      └───niftis
    │               ├───T1.nii.gz
    │               └───FLAIR.nii.gz
    │
    ├───2
    │     └───niftis
    │              ├───T1.nii.gz
    │              └───FLAIR.nii.gz
    └───subjects.txt

A BIDS one might be like:

data
    ├───sub-1
    │      └───anat
    │               ├───sub-1_T1w.json
    │               ├───sub-1_T1w.nii.gz
    │               ├───sub-1_FLAIR.json
    │               └───sub-1_FLAIR.nii.gz
    │
    └───sub-2
            └───anat
                     ├───sub-1_T1w.json
                     ├───sub-1_T1w.nii.gz
                     ├───sub-1_FLAIR.json
                     └───sub-1_FLAIR.nii.gz

BIDS may also optionally contain another level of directories inside the subject folder for individual scanning sessions.

So main changes are:

  • subject folders must have the prefix sub- before the id
  • niftis must be renamed to anat
  • nifti filenames must be in the form sub-ID_T1w.nii.gz (for T1) and sub-ID_FLAIR.nii.gz (for FLAIR). There may also be a session id here, if there was more than one scanning session e.g. sub-ID_ses-1_T1w.nii.gz
  • Ideally each nifti file has a corresponding .json file containing image metadata/parameters of the scan. This isn't used by the pipeline, but is part of the BIDS format
  • Output should be written to the derivatives folder inside BIDS
  • We would need to handle providing an optional session id to tell docker which session to process (if more than one exist)
  • We could get rid of the subjects.txt file entirely and just pull subject IDs directly from the sub- folder names in the BIDS data

@K-Meech
Copy link
Collaborator

K-Meech commented Sep 12, 2024

Some useful links:

@K-Meech
Copy link
Collaborator

K-Meech commented Sep 12, 2024

Note that the MRIcroGL dicom to nifti converter will produce BIDS jsons (also called 'BIDS Sidecar') automatically. There's an option on the left side for 'Create BIDS Sidecar', which should be set to 'Yes, Anonymized' by default.
If you give the output filename as sub-%i_%p it'll get you pretty close to the filename you need (presumably without the T1w / FLAIR endings?)

@HamiedGH
Copy link
Collaborator

The section on "BIDSification" on this GitHub page may be helpful:
https://github.com/ENIGMA-PD/FS7/tree/main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority: medium Medium priority
Projects
None yet
Development

No branches or pull requests

3 participants