Closed rohanbanerjee closed 8 months ago
Good catch! Indeed, anat
is now hardcoded.
Add a flag --data-type so that the use can mention the type of dataset. The most used ones (afaik) are anat, func and dwi
Sounds good! The default can be anat
. List of choices then [anat, func and dwi], or we can keep it "open" for any datatype specified by the user.
Sounds good! The default can be anat. List of choices then [anat, func and dwi], or we can keep it "open" for any datatype specified by the user.
I've kept it open for now. Generally the anat
and dwi
would have similar naming conventions but func
would have a task-name
in between subject-name
and contrast
. The PR #44 solves this.
Thanks for opening the issue, @rohanbanerjee ! Agree with making it more dynamic to accept other data types
Description:
I am using the
convert_bids_to_nnUNetV2.py
script for an fMRI dataset and script is running into the following error:contrast bold for subject <subject-name> does not exist this contrast is ignored
for all my subjects.Why is this happening?
The script assumes that the the datatype used from conversion from `bids` to the `nnUNet` is `anat`. The below lines of code assume that the data type is `anat`: https://github.com/ivadomed/utilities/blob/e9cbfd8413d3529f38a995f1d639512056bb2bf1/dataset_conversion/convert_bids_to_nnUNetV2.py#L85-L94 The files name of subjects in general for `anat` data type is `{subject}_{contrast}.nii.gz` which is also used/hard-coded in the above lines. When I use the `func` data type (which is the data type of my dataset), it starts throwing the error because of two reasons: 1. The code is not able to read the new data type `func` 2. The naming convention of fMRI data is generally like -- `{subject}_{task-name}_{contrast}.nii.gz` Attaching screenshot from the BIDS dataset for naming convention reference:
Solution:
--data-type
so that the use can mention the type of dataset. The most used ones (afaik) areanat
,func
anddwi
BIDS
file naming convention.