-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
✨Feature/update pixdim4 for the final *bold outputs #2154
base: develop
Are you sure you want to change the base?
Conversation
error_message = f"Error in validating outputs: {e}" | ||
IFLOGGER.error(error_message) | ||
return output_bold |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to raise an exception here instead of (log an error message and return the path to the bold file)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, I am not sure if we want to totally crash
(by raising exception) CPAC here or if we only say following resources were not validated but still its here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or probably add a swtich to the config to allow choosing between
- raising exception
- continue
|
||
|
||
def update_pixdim4(file_path, new_pixdim4): | ||
"""Update the pixdim4 value of a NIfTI file using 3drefit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about this one. May be @sgiavasis could advise on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason to use AFNI 3drefit
instead of nibabel
is to change the Time step
in 3dinfo
as well along with pixdim4
Fixes
Fixes/Related to #2139 by @sgiavasis
Description
Added a node at the very end just before data-sink to compare and update/match the
pixdim4
of the CPAC processed output with the native raw source bold image, as in figure below.Technical details
Tests
Run this branch and check the final CPAC outputs with following command
for file in *preproc_bold.nii.gz; do echo $file; fslinfo "$file"| grep pixdim4; done
For the outputs below, the value should be
0.8
sub-PA001_ses-V1W1_task-facesmatching_run-1_desc-preproc_bold.nii.gz
pixdim4 0.800000
sub-PA001_ses-V1W1_task-facesmatching_run-1_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz
pixdim4 0.800000
sub-PA001_ses-V1W1_task-poke_run-1_desc-preproc_bold.nii.gz
pixdim4 0.800000
sub-PA001_ses-V1W1_task-poke_run-1_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz
pixdim4 0.800000
sub-PA001_ses-V1W1_task-poke_run-2_desc-preproc_bold.nii.gz
pixdim4 0.800000
sub-PA001_ses-V1W1_task-poke_run-2_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz
pixdim4 0.800000
sub-PA001_ses-V1W1_task-REST_run-1_desc-preproc_bold.nii.gz
pixdim4 0.800000
sub-PA001_ses-V1W1_task-REST_run-1_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz
pixdim4 0.800000
Screenshots
Checklist
Update index.md
).develop
branch of the repository.Developer Certificate of Origin
Developer Certificate of Origin