UCL-ARC / Enigma-PD-WML

Segment White Mater Lesions (WML) in T1-weighted and FLAIR MRI images using FSL and U-Net
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

Add support for input data in BIDS format #13

Open p-j-smith opened 2 months ago

p-j-smith commented 2 months ago

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

Alternatives

No response

Additional context

No response

K-Meech commented 1 month ago

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:

K-Meech commented 1 month ago

Some useful links:

K-Meech commented 1 month ago

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?)