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

Rename phasediff image in dicom_to_nifti #191

Merged
merged 5 commits into from
Dec 3, 2020
Merged

Conversation

po09i
Copy link
Member

@po09i po09i commented Dec 3, 2020

Description

This PR fixes an issue in dicom_to_nifti where phasediff images were wrongly indentified in their filenames as phase images instead of phasediff images.

The function looks at the output of dcm2bids and if

  • It's in fmap directory
  • The json file is a phase image, contains both fields EchoTime1 and EchoTime2
  • It is not already named phasediff
  • It contains phase in the file name
  • SequenceName field's last digit is 2 (Refers to the number of echoes when using dcm2bids)

It will rename the json and the nifti to phasediff.

A test was changed to reflect the new names.

Linked issues

Fixes #190

@po09i po09i added the enhancement New feature or request label Dec 3, 2020
@po09i po09i requested a review from jcohenadad December 3, 2020 08:52
@po09i po09i self-assigned this Dec 3, 2020
@po09i po09i added this to In progress in Get a CLI based working example script via automation Dec 3, 2020
@po09i po09i requested a review from jcohenadad December 3, 2020 17:28
Copy link
Member

@jcohenadad jcohenadad left a comment

Choose a reason for hiding this comment

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

add test of output JSON file for the fieldmap diff case

Get a CLI based working example script automation moved this from In progress to Review in progress Dec 3, 2020
@po09i
Copy link
Member Author

po09i commented Dec 3, 2020

Add test of output JSON file for the fieldmap diff case

I may have misled you in our internal meeting. This PR only changes the name of the output phasediff from sub-XX_phase2.nii.gz and sub-XX_phase2.json to sub-XX_phasediff.nii.gz and sub-XX_phasediff.json. The relevant function which creates the json file for the fieldmap is prepare_fieldmap.

I opened an issue to add the test to the relevant function #194
@jcohenadad

@po09i po09i requested a review from jcohenadad December 3, 2020 20:26
Get a CLI based working example script automation moved this from Review in progress to Reviewer approved Dec 3, 2020
@po09i po09i merged commit 7986bdb into master Dec 3, 2020
Get a CLI based working example script automation moved this from Reviewer approved to Done Dec 3, 2020
@po09i po09i deleted the ad/dcm-to-nifti-phasediff branch December 3, 2020 20:32
kousu pushed a commit that referenced this pull request Mar 20, 2021
* Add phasediff instead of phase for phasediff images

* Add potential issue where phasediff could be in the subject id

* Add check on sequence name

* account for .nii and .nii.gz

* Remove .nii
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

dicom_to_nifti should output a filename with phasediff if the image is a phasediff
2 participants