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

Fix/pre free surfer pipeline #314

Draft
wants to merge 19 commits into
base: NHP_merge
Choose a base branch
from

Conversation

TakJim
Copy link

@TakJim TakJim commented Oct 30, 2024

Pull Request Summary

This PR refactors the processing pipeline for enhanced modularity, flexibility, and improved parameter control in T1w and T2w image processing.

Key Changes

1.	Modular Functions: Created ACPCAlignment, BrainExtraction, T2wToT1wRegAndBiasCorrection, and AtlasRegistration functions, and a main function to control execution flow via RunMode.
2.	Expanded Parameters: Added support for additional phase encodes, patient positioning, and brain extraction settings, improving custom workflow compatibility.
3.	Custom Mask and Existing Data Handling: Improved custom mask application and logic to skip unnecessary steps for existing data.
4.	Enhanced Logging and Structure: Standardized output directory structure and logging, facilitating traceability and maintainability.

@TakJim TakJim marked this pull request as draft October 30, 2024 21:35
@TakJim TakJim marked this pull request as ready for review October 30, 2024 21:35
@TakJim TakJim marked this pull request as draft October 30, 2024 21:36
@glasserm
Copy link
Contributor

glasserm commented Nov 4, 2024

Is TakJim affiliated with Takuya Hayashi's lab at RIKEN? These changes appear to potentially be related to trying to merge the NHP HCP Pipelines back into the HCP Pipelines. We should encourage this.

Comment on lines +790 to +792
--SEPhaseNeg2=${SpinEchoPhaseEncodeNegative2} \
--SEPhasePos2=${SpinEchoPhaseEncodePositive2} \
--SEPhaseZero=${SpinEchoPhaseEncodeZero} \
Copy link
Member

@coalsont coalsont Nov 22, 2024

Choose a reason for hiding this comment

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

You need to include the edits to T2wToT1wDistortionCorrectAndReg.sh that add this functionality.

--SEPhaseNeg2=${SpinEchoPhaseEncodeNegative2} \
--SEPhasePos2=${SpinEchoPhaseEncodePositive2} \
--SEPhaseZero=${SpinEchoPhaseEncodeZero} \
--echospacing=${DwellTime} \
Copy link
Member

@coalsont coalsont Nov 22, 2024

Choose a reason for hiding this comment

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

DwellTime isn't defined, and also --echospacing isn't supported by the human version of T2wToT1wDistortionCorrectAndReg.sh. Is this intended to be different from --seechospacing?

@@ -628,6 +870,8 @@ if [ "$CustomBrain" = "NONE" ] ; then
else # -- No T2w image

log_Msg "Performing Bias Field Correction using T1w image only"
BiasFieldFastSmoothingSigma="20"
BiasFieldFastSmoothingSigma="--bfsigma=${BiasFieldFastSmoothingSigma}"
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't get used, and hardcodes a smoothing kernel size.

RefRes=$(${FSLDIR}/bin/fslval ${T1wTemplate} pixdim1 | awk '{printf "%0.2f", $1}')
log_Msg "Resolution of structure: $StrucRes"
log_Msg "Resolution of T1wTemplate: $RefRes"
if [ ! "$StrucRes" == "$RefRes" ] ; then
Copy link
Member

Choose a reason for hiding this comment

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

This would trigger on, say, a 0.71mm human scan (or even a 0.7mm if someone specified the 0.8mm template), and use a voxel grid different than the specified template file for all the MNINonLinear/ volume files. I'm not sure what we want to happen.

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.

4 participants