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

convert_bids_to_nnUNetV2.py - add support of data types other than anat #44

Merged
merged 7 commits into from
Feb 19, 2024

Conversation

rohanbanerjee
Copy link
Contributor

Fixes #43

This PR solves two things,

  1. data_type can be given as a flag
  2. It removes the hard-coded anat data-type in the files and should possibly work with all types of BIDS data-types.

The PR can be tested for a fMRI data with the following steps:

  1. Clone this utilities repository
  2. cd utilities/data_conversion
  3. Run the following command:
python convert_bids_to_nnUNetV2.py --path-data /home/GRAMES.POLYMTL.CA/robana/duke/temp/rohan/fmri_sc_seg/datasets/data_all --path-out /home/GRAMES.POLYMTL.CA/robana/duke/temp/rohan/fmri_sc_seg/nnUNet_raw --split 0.8 0.2 --seed 42 --contrast bold --label-suffix seg-manual --data-type func --dataset-name spinefmri --dataset-number 516 --copy True

@valosekj
Copy link
Member

Thank you for opening the PR! 👍🏻 let me know once it is ready for review.

@rohanbanerjee
Copy link
Contributor Author

Thanks @valosekj for looking into this, ready for review now!

@valosekj valosekj changed the title For usage of convert_bids_to_nnUNetV2.py for more data types other than anat convert_bids_to_nnUNetV2.py - add support of data types other than anat Feb 18, 2024
Copy link
Member

@valosekj valosekj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! 👍🏻

Tested with datatype anat and working fine:

convert_bids_to_nnUNetV2.py 
--path-data sci-paris 
--path-out sci-paris_nnunet_test
--contrast T2w
--label-suffix seg-manual
--data-type anat

According to the command in your original comment, I guess you tested the script with datatype func; if so, you can merge.

BTW. I added a few basic unit tests and CI workflow in 8937bb5 to make the testing of the script easier in the future.

@rohanbanerjee rohanbanerjee merged commit 0bbeaa2 into main Feb 19, 2024
1 check passed
@rohanbanerjee rohanbanerjee deleted the rb/data_type_generalize branch February 19, 2024 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The convert_bids_to_nnUNetV2.py script is not compatible with datatypes other than anat
2 participants