From 1a6c9dccc12413004b77d732dbd4ee8ec6c3d4ca Mon Sep 17 00:00:00 2001 From: "birajstha:construction_worker::penguin" Date: Tue, 28 Jan 2025 13:24:05 -0500 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=9A=9A=20ref=5Fmask=5Fres-2=20and=20T?= =?UTF-8?q?1w=5Ftemplate=5Fres-2=20fields=20are=20moved=20out=20of=20regis?= =?UTF-8?q?tration=20and=20into=20surface.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + CPAC/pipeline/schema.py | 4 ++-- .../configs/pipeline_config_abcd-options.yml | 13 ++++++------- .../resources/configs/pipeline_config_abcd-prep.yml | 13 ++++++------- CPAC/resources/configs/pipeline_config_blank.yml | 12 ++++++------ CPAC/resources/cpac_templates.csv | 4 ++-- 6 files changed, 23 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be5ec4a432..b0d70433b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Moved `pygraphviz` from requirements to `graphviz` optional dependencies group. - Automatically tag untagged `subject_id` and `unique_id` as `!!str` when loading data config files. - Made orientation configurable (was hard-coded as "RPI"). +- Moved `ref_mask_res_2` and `T1w_template_res-2` fields from registration into surface under `abcd_prefreesurfer_prep`. ### Fixed diff --git a/CPAC/pipeline/schema.py b/CPAC/pipeline/schema.py index 997c6267b8..cdb72747d0 100644 --- a/CPAC/pipeline/schema.py +++ b/CPAC/pipeline/schema.py @@ -712,8 +712,6 @@ def sanitize(filename): "interpolation": In({"trilinear", "sinc", "spline"}), "identity_matrix": Maybe(str), "ref_mask": Maybe(str), - "ref_mask_res-2": Maybe(str), - "T1w_template_res-2": Maybe(str), }, }, "overwrite_transform": { @@ -816,6 +814,8 @@ def sanitize(filename): "surface_analysis": { "abcd_prefreesurfer_prep": { "run": bool1_1, + "ref_mask_res-2": Maybe(str), + "T1w_template_res-2": Maybe(str), }, "freesurfer": { "run_reconall": bool1_1, diff --git a/CPAC/resources/configs/pipeline_config_abcd-options.yml b/CPAC/resources/configs/pipeline_config_abcd-options.yml index 1cb360cdc9..be0025d113 100644 --- a/CPAC/resources/configs/pipeline_config_abcd-options.yml +++ b/CPAC/resources/configs/pipeline_config_abcd-options.yml @@ -31,6 +31,12 @@ surface_analysis: # Run freesurfer_abcd_preproc to obtain preprocessed T1w for reconall abcd_prefreesurfer_prep: run: On + + # Reference mask with 2mm resolution to be used during FNIRT-based brain extraction in ABCD-options pipeline. + ref_mask_res-2: /opt/dcan-tools/pipeline/global/templates/MNI152_T1_2mm_brain_mask_dil.nii.gz + + # Template with 2mm resolution to be used during FNIRT-based brain extraction in ABCD-options pipeline. + T1w_template_res-2: /opt/dcan-tools/pipeline/global/templates/MNI152_T1_2mm.nii.gz # Will run Freesurfer for surface-based analysis. Will output traditional Freesurfer derivatives. # If you wish to employ Freesurfer outputs for brain masking or tissue segmentation in the voxel-based pipeline, @@ -102,13 +108,6 @@ registration_workflows: anatomical_registration: run: On registration: - FSL-FNIRT: - - # Reference mask with 2mm resolution to be used during FNIRT-based brain extraction in ABCD-options pipeline. - ref_mask_res-2: /opt/dcan-tools/pipeline/global/templates/MNI152_T1_2mm_brain_mask_dil.nii.gz - - # Template with 2mm resolution to be used during FNIRT-based brain extraction in ABCD-options pipeline. - T1w_template_res-2: /opt/dcan-tools/pipeline/global/templates/MNI152_T1_2mm.nii.gz # option parameters ANTs: diff --git a/CPAC/resources/configs/pipeline_config_abcd-prep.yml b/CPAC/resources/configs/pipeline_config_abcd-prep.yml index d6542ea358..b1f696cbdd 100644 --- a/CPAC/resources/configs/pipeline_config_abcd-prep.yml +++ b/CPAC/resources/configs/pipeline_config_abcd-prep.yml @@ -31,6 +31,12 @@ surface_analysis: # Run freesurfer_abcd_preproc to obtain preprocessed T1w for reconall abcd_prefreesurfer_prep: run: On + + # Reference mask with 2mm resolution to be used during FNIRT-based brain extraction in ABCD-options pipeline. + ref_mask_res-2: /opt/dcan-tools/pipeline/global/templates/MNI152_T1_2mm_brain_mask_dil.nii.gz + + # Template with 2mm resolution to be used during FNIRT-based brain extraction in ABCD-options pipeline. + T1w_template_res-2: /opt/dcan-tools/pipeline/global/templates/MNI152_T1_2mm.nii.gz anatomical_preproc: run: On @@ -72,13 +78,6 @@ anatomical_preproc: registration_workflows: anatomical_registration: registration: - FSL-FNIRT: - - # Reference mask with 2mm resolution to be used during FNIRT-based brain extraction in ABCD-options pipeline. - ref_mask_res-2: /opt/dcan-tools/pipeline/global/templates/MNI152_T1_2mm_brain_mask_dil.nii.gz - - # Template with 2mm resolution to be used during FNIRT-based brain extraction in ABCD-options pipeline. - T1w_template_res-2: /opt/dcan-tools/pipeline/global/templates/MNI152_T1_2mm.nii.gz # option parameters ANTs: diff --git a/CPAC/resources/configs/pipeline_config_blank.yml b/CPAC/resources/configs/pipeline_config_blank.yml index 454d8add59..5b7f3f5188 100644 --- a/CPAC/resources/configs/pipeline_config_blank.yml +++ b/CPAC/resources/configs/pipeline_config_blank.yml @@ -209,6 +209,12 @@ surface_analysis: abcd_prefreesurfer_prep: run: Off + # Reference mask with 2mm resolution to be used during FNIRT-based brain extraction in ABCD-options pipeline. + ref_mask_res-2: $FSLDIR/data/standard/MNI152_T1_2mm_brain_mask_dil.nii.gz + + # Template with 2mm resolution to be used during FNIRT-based brain extraction in ABCD-options pipeline. + T1w_template_res-2: $FSLDIR/data/standard/MNI152_T1_2mm.nii.gz + # Will run Freesurfer for surface-based analysis. Will output traditional Freesurfer derivatives. # If you wish to employ Freesurfer outputs for brain masking or tissue segmentation in the voxel-based pipeline, # select those 'Freesurfer-' labeled options further below in anatomical_preproc. @@ -580,12 +586,6 @@ registration_workflows: # It is for monkey pipeline specifically. FNIRT_T1w_template: - # Reference mask with 2mm resolution to be used during FNIRT-based brain extraction in ABCD-options pipeline. - ref_mask_res-2: $FSLDIR/data/standard/MNI152_T1_2mm_brain_mask_dil.nii.gz - - # Template with 2mm resolution to be used during FNIRT-based brain extraction in ABCD-options pipeline. - T1w_template_res-2: $FSLDIR/data/standard/MNI152_T1_2mm.nii.gz - # Configuration file to be used by FSL to set FNIRT parameters. # It is not necessary to change this path unless you intend to use custom FNIRT parameters or a non-standard template. fnirt_config: T1_2_MNI152_2mm diff --git a/CPAC/resources/cpac_templates.csv b/CPAC/resources/cpac_templates.csv index 5c2abc9947..cf4cad758f 100644 --- a/CPAC/resources/cpac_templates.csv +++ b/CPAC/resources/cpac_templates.csv @@ -31,8 +31,8 @@ T1w-template-symmetric,"voxel_mirrored_homotopic_connectivity, symmetric_registr T1w-template-symmetric-deriv,"voxel_mirrored_homotopic_connectivity, symmetric_registration, T1w_template_symmetric_funcreg","Symmetric version of the T1w-based whole-head template, resampled to the desired functional derivative resolution","registration_workflows, functional_registration, func_registration_to_template, output_resolution, func_derivative_outputs" T1w-template-symmetric-for-resample,"voxel_mirrored_homotopic_connectivity, symmetric_registration, T1w_template_symmetric_for_resample",, template-ref-mask,"registration_workflows, anatomical_registration, registration, FSL-FNIRT, ref_mask",,"registration_workflows, anatomical_registration, resolution_for_anat" -template-ref-mask-res-2,"registration_workflows, anatomical_registration, registration, FSL-FNIRT, ref_mask_res-2",, -T1w-template-res-2,"registration_workflows, anatomical_registration, registration, FSL-FNIRT, T1w_template_res-2",, +template-ref-mask-res-2,"surface_analysis, abcd_prefreesurfer_prep, ref_mask_res-2",, +T1w-template-res-2,"surface_analysis, abcd_prefreesurfer_prep, T1w_template_res-2",, template-specification-file,"network_centrality, template_specification_file",Binary ROI mask for network centrality calculations, unet-model,"anatomical_preproc, brain_extraction, UNet, unet_model",, WM-path,"segmentation, tissue_segmentation, FSL-FAST, use_priors, WM_path",Template-space WM tissue prior, From 75612ae5893011e3dbf89802ccc334de4c48ba24 Mon Sep 17 00:00:00 2001 From: "birajstha:construction_worker::penguin" Date: Tue, 28 Jan 2025 14:45:56 -0500 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=9A=9A=20moving=20ref=5Fmask=5Fres-2?= =?UTF-8?q?=20and=20T1w=5Ftemplate=5Fres-2=20from=20default=20and=20fmripr?= =?UTF-8?q?ep-options=20config=20too?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CPAC/resources/configs/pipeline_config_default.yml | 12 ++++++------ .../configs/pipeline_config_fmriprep-options.yml | 6 ------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/CPAC/resources/configs/pipeline_config_default.yml b/CPAC/resources/configs/pipeline_config_default.yml index b7aa56c13f..3d067fbbcf 100644 --- a/CPAC/resources/configs/pipeline_config_default.yml +++ b/CPAC/resources/configs/pipeline_config_default.yml @@ -197,6 +197,12 @@ surface_analysis: abcd_prefreesurfer_prep: run: Off + # Reference mask with 2mm resolution to be used during FNIRT-based brain extraction in ABCD-options pipeline. + ref_mask_res-2: $FSLDIR/data/standard/MNI152_T1_2mm_brain_mask_dil.nii.gz + + # Template with 2mm resolution to be used during FNIRT-based brain extraction in ABCD-options pipeline. + T1w_template_res-2: $FSLDIR/data/standard/MNI152_T1_2mm.nii.gz + # Will run Freesurfer for surface-based analysis. Will output traditional Freesurfer derivatives. # If you wish to employ Freesurfer outputs for brain masking or tissue segmentation in the voxel-based pipeline, # select those 'Freesurfer-' labeled options further below in anatomical_preproc. @@ -738,12 +744,6 @@ registration_workflows: # It is not necessary to change this path unless you intend to use a different template. identity_matrix: $FSLDIR/etc/flirtsch/ident.mat - # Reference mask with 2mm resolution to be used during FNIRT-based brain extraction in ABCD-options pipeline. - ref_mask_res-2: $FSLDIR/data/standard/MNI152_T1_2mm_brain_mask_dil.nii.gz - - # Template with 2mm resolution to be used during FNIRT-based brain extraction in ABCD-options pipeline. - T1w_template_res-2: $FSLDIR/data/standard/MNI152_T1_2mm.nii.gz - overwrite_transform: run: Off diff --git a/CPAC/resources/configs/pipeline_config_fmriprep-options.yml b/CPAC/resources/configs/pipeline_config_fmriprep-options.yml index 555b52302d..f97bcf3180 100644 --- a/CPAC/resources/configs/pipeline_config_fmriprep-options.yml +++ b/CPAC/resources/configs/pipeline_config_fmriprep-options.yml @@ -151,12 +151,6 @@ registration_workflows: registration: FSL-FNIRT: - # Reference mask with 2mm resolution to be used during FNIRT-based brain extraction in ABCD-options pipeline. - ref_mask_res-2: - - # Template with 2mm resolution to be used during FNIRT-based brain extraction in ABCD-options pipeline. - T1w_template_res-2: - # Reference mask for FSL registration. ref_mask: From 6d65824a3102fa4cc367bc9828877fcb7ad67921 Mon Sep 17 00:00:00 2001 From: "birajstha:construction_worker::penguin" Date: Tue, 28 Jan 2025 14:58:55 -0500 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=A6=BA=20pushing=20with=20pre-commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CPAC/resources/configs/pipeline_config_abcd-options.yml | 4 ++-- CPAC/resources/configs/pipeline_config_abcd-prep.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CPAC/resources/configs/pipeline_config_abcd-options.yml b/CPAC/resources/configs/pipeline_config_abcd-options.yml index be0025d113..937ab7a636 100644 --- a/CPAC/resources/configs/pipeline_config_abcd-options.yml +++ b/CPAC/resources/configs/pipeline_config_abcd-options.yml @@ -31,10 +31,10 @@ surface_analysis: # Run freesurfer_abcd_preproc to obtain preprocessed T1w for reconall abcd_prefreesurfer_prep: run: On - + # Reference mask with 2mm resolution to be used during FNIRT-based brain extraction in ABCD-options pipeline. ref_mask_res-2: /opt/dcan-tools/pipeline/global/templates/MNI152_T1_2mm_brain_mask_dil.nii.gz - + # Template with 2mm resolution to be used during FNIRT-based brain extraction in ABCD-options pipeline. T1w_template_res-2: /opt/dcan-tools/pipeline/global/templates/MNI152_T1_2mm.nii.gz diff --git a/CPAC/resources/configs/pipeline_config_abcd-prep.yml b/CPAC/resources/configs/pipeline_config_abcd-prep.yml index b1f696cbdd..32ba79beac 100644 --- a/CPAC/resources/configs/pipeline_config_abcd-prep.yml +++ b/CPAC/resources/configs/pipeline_config_abcd-prep.yml @@ -31,10 +31,10 @@ surface_analysis: # Run freesurfer_abcd_preproc to obtain preprocessed T1w for reconall abcd_prefreesurfer_prep: run: On - + # Reference mask with 2mm resolution to be used during FNIRT-based brain extraction in ABCD-options pipeline. ref_mask_res-2: /opt/dcan-tools/pipeline/global/templates/MNI152_T1_2mm_brain_mask_dil.nii.gz - + # Template with 2mm resolution to be used during FNIRT-based brain extraction in ABCD-options pipeline. T1w_template_res-2: /opt/dcan-tools/pipeline/global/templates/MNI152_T1_2mm.nii.gz