-
Notifications
You must be signed in to change notification settings - Fork 273
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
Modifications to generic fMRIVolume and fMRISurface pipelines to run on longitudinal sessions. #319
base: master
Are you sure you want to change the base?
Conversation
|
It looks like this MR now includes changes from Volume + Surface and also changes from the long FS which were already merged into master? So the review tab shows a lot of code that is already tested and reviewed. Maybe it would be best to have a new branch for the new stuff? Also, the branch is not in sync with the current master, so it would be best to merge the current master into this and resolve the conflicts. Or the cleanest way, which is to create new branch of the master and apply only long volume and long surface changes to it. |
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 did a somewhat quick review and things look good. As usual I might report some bugs later on, when I actually start running tests.
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.
What is the -0
suffix in GenericfMRIVolumeProcessingPipeline-0.sh
?
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.
What is the
-0
suffix inGenericfMRIVolumeProcessingPipeline-0.sh
?
That's a backup file that somehow made it into one of commits. should be fixed now.
Rebase is a cleaner way to resolve normal conflicts (this situation isn't normal). Merge commits are weird and awkward, and hard to look at diffs of. "In sync" isn't really applicable here, the whole purpose of a PR is to propose changes, conflicts mean that someone else has also made changes to the same files (or, it can be a symptom that your branch's starting point is wrong or contains extra stuff). I can try to salvage the intended commits. |
+Work on longitudinal version of fMRIVolume instead.
…es to dependent scripts. +added options (not finished) to OneStepResampling to output in native space.
…on-University/HCPpipelines into feature/longitudinal_fs
…on-University/HCPpipelines into feature/longitudinal_fs
…on-University/HCPpipelines into feature/longitudinal_fs
+fMRIVolume, longitudinal version, finishes successfully. +Output not visually verified. +Example batch script for longitudinal fMRIVolume
+Rename 'Subject' to 'Session' in fMRISurfaceProcessingPipeline and dependencies
30fcc3c
to
c8a2c88
Compare
Longitudinal fMRISurface needs longitudinal fMRIVolume to have been run on the same timepoint. Cross-sectional fMRISurface is not required to have been run.
You can use corresponding Examples/scripts/*-long.sh batch scripts for call examples. The only difference from my calls are obfuscated paths for StudyFolder and EnvironmentScript. |
This should have been fixed now. |
fMRIVolume/scripts/DistortionCorrectionAndEPIToT1wReg_FLIRTBBRAndFreeSurferBBRbased.sh
Outdated
Show resolved
Hide resolved
fMRIVolume/scripts/DistortionCorrectionAndEPIToT1wReg_FLIRTBBRAndFreeSurferBBRbased.sh
Outdated
Show resolved
Hide resolved
fMRIVolume/scripts/DistortionCorrectionAndEPIToT1wReg_FLIRTBBRAndFreeSurferBBRbased.sh
Outdated
Show resolved
Hide resolved
fMRIVolume/scripts/DistortionCorrectionAndEPIToT1wReg_FLIRTBBRAndFreeSurferBBRbased.sh
Outdated
Show resolved
Hide resolved
|
||
#Split echos | ||
#Split echos. |
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.
Only run in cross-sectional.
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.
Sorry, could you expand on what you mean?
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.
You should not run this block in longitudinal mode, so please if/then it accordingly.
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 block between lines (new) 683 and 809 is already only run in cross-sectional mode. Did you mean the next 'split echos' block? For that, I kept statements assigning [tcs/sct]Echoes[..] but put all wb_command commands under conditional.
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.
At the moment, it will still print "splitting echoes" if multi echo is detected, even though it will then only set some shell variables. If we don't need any of the variables in longitudinal mode, I would put the longitudinal conditional around the entire block instead of buried in the loop, for readability (and avoiding wrong messages).
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.
We do need tcsEchoes* to be set for multi-echo for both longitudinal and non-longitudinal modes. The if clause inside the "for iEcho.." loop prevents re-running wb_command in longitudinal mode.
@@ -940,7 +1010,7 @@ then | |||
${FSLDIR}/bin/fslmaths ${ResultsFolder}/${NameOffMRI}_pseudo_transmit_raw.nii.gz -mas ${fMRIFolder}/${FreeSurferBrainMask}.${FinalfMRIResolution}.nii.gz ${ResultsFolder}/${NameOffMRI}_pseudo_transmit_raw.nii.gz | |||
${FSLDIR}/bin/applywarp --interp=trilinear -i ${DCFolder}/ComputeSpinEchoBiasField/${NameOffMRI}_pseudo_transmit_field.nii.gz -r ${fMRIFolder}/${NameOffMRI}_SBRef_nonlin -w ${AtlasSpaceFolder}/xfms/${AtlasTransform} -o ${ResultsFolder}/${NameOffMRI}_pseudo_transmit_field.nii.gz | |||
${FSLDIR}/bin/fslmaths ${ResultsFolder}/${NameOffMRI}_pseudo_transmit_field.nii.gz -mas ${fMRIFolder}/${FreeSurferBrainMask}.${FinalfMRIResolution}.nii.gz ${ResultsFolder}/${NameOffMRI}_pseudo_transmit_field.nii.gz | |||
else | |||
else #never triggered in Longitudinal mode |
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.
@demsarjure @sivcek This needs your attention.
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.
Like mentioned above, I think this is fine as reference is not needed any more in longitudinal processing.
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 have made various comments. Please address them and also @demsarjure @sivcek please assist with the fMRIReference stuff. Thanks!
+comment out 'output to native' code changes
|
||
if (( IsLongitudinal )); then | ||
if [ ! -d "$Path/$SessionLong" ]; then | ||
log_Err_Abort "the --longitudinal-session must be specified and folder must exist in longitudinal mode" |
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.
This suggests --longitudinal-session
must be specified and non-empty whenever --is-longitudinal=TRUE
. So, do we really even need the --is-longitudinal
option, or should it simply test if --longitudinal-session
gave an empty string?
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.
Correct. But, I am inclined to leave is-longitudinal option as standard way to point to longitudinal session across scripts, instead of forcing the user to guess it is not required here.
|
||
if (( $IsLongitudinal )); then | ||
if [ ! -f "$T1wCross2LongXfm" ]; then | ||
log_Err_Abort "--t1w-cross2long-xfm must point to a valid file when --is-longitudinal is used" |
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.
It could be argued that --is-longitudinal
is redundant here also (you wouldn't supply --t1w-cross2long-xfm
in cross-sectional mode).
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.
Same as above, trying to be consistent across longitudinal /cross-sectional parameters
fMRIVolume/scripts/DistortionCorrectionAndEPIToT1wReg_FLIRTBBRAndFreeSurferBBRbased.sh
Outdated
Show resolved
Hide resolved
fMRIVolume/scripts/DistortionCorrectionAndEPIToT1wReg_FLIRTBBRAndFreeSurferBBRbased.sh
Outdated
Show resolved
Hide resolved
fMRIVolume/scripts/DistortionCorrectionAndEPIToT1wReg_FLIRTBBRAndFreeSurferBBRbased.sh
Show resolved
Hide resolved
Since my attempt at e-mail-based comments didn't work, I deleted them and moved them to the appropriate threads. |
Fix for missing long description Co-authored-by: Tim Coalson <[email protected]>
…on-University/HCPpipelines into feature/longitudinal_fs
fMRIVolume/scripts/DistortionCorrectionAndEPIToT1wReg_FLIRTBBRAndFreeSurferBBRbased.sh
Outdated
Show resolved
Hide resolved
…AndFreeSurferBBRbased.sh Co-authored-by: Tim Coalson <[email protected]>
…AndFreeSurferBBRbased.sh Co-authored-by: Tim Coalson <[email protected]>
fMRIVolume/scripts/DistortionCorrectionAndEPIToT1wReg_FLIRTBBRAndFreeSurferBBRbased.sh
Outdated
Show resolved
Hide resolved
FreeSurferBrainMaskFile=`basename "$FreeSurferBrainMask"` | ||
BiasFieldFile=$(basename "$BiasField") | ||
T1wImageFile=$(basename $T1wImage) | ||
#T1wImageFileNative=$(basename $T1wImageNative) |
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.
This line also looks like a native volume space change, commented out.
if (( ! IsLongitudinal )); then | ||
wb_command -volume-merge "${fMRIFolder}/${tcsEchoesOrig[iEcho]}.nii.gz" -volume "${fMRIFolder}/${OrigTCSName}.nii.gz" \ | ||
-subvolume $((1 + FramesPerEcho * iEcho)) -up-to $((FramesPerEcho * (iEcho + 1))) | ||
wb_command -volume-merge "${fMRIFolder}/${sctEchoesOrig[iEcho]}.nii.gz" -volume "${fMRIFolder}/${OrigScoutName}.nii.gz" \ |
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.
This section is using tabs when the surrounding is using spaces.
This pull request comprises modifications to generic fMRIVolume and fMRISurface to run on longitudinal timepoints. Prerequisites for GenericfMRIVolumeProcessingPipeline are:
Prerequisites for fMRISurface are the same plus GenericfMRIVolumeProcessingPipeline must have been run on all longitudinal timepoints.
Note that neither multi-echo fMRI nor fMRIReference is currently supported in longitudinal mode.