From f2b847de4796c13195b78a40f51796eb55dd99b3 Mon Sep 17 00:00:00 2001 From: David Meunier Date: Wed, 28 May 2025 16:41:34 +0200 Subject: [PATCH 01/20] -skull option --- docs/command.rst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/command.rst b/docs/command.rst index 8992554..77af2a2 100644 --- a/docs/command.rst +++ b/docs/command.rst @@ -74,7 +74,8 @@ mandatory parameters * ``_4animal`` : will use bet4animal (FSL) for brain extraction, for faster computation (by default atlas_brex is used) * ``_quick`` : will use hd-bet (Deep Learning) for brain extraction, for faster computation (by default atlas_brex is used) - **NB: ** hd-bet requires a specific version of macapype/skullTo3d, not available by default + +**NB:** hd-bet requires a specific version of macapype/skullTo3d, not available by default This option should be used if the coregistration to template in preparation is not performed correctly: @@ -87,7 +88,11 @@ mandatory parameters * ``_noseg`` (at the end) will perform data preparation and brain extraction (no segmentation) **Some options are specific to skullTo3d:** - * ``_skull`` after SPM or ANTS if you want to process skull or angio *specific to skullTo3d*; otherwise the main pipelines of macapype will be launched (only brain segmentation will be performed) **NB : ** ``_skullnoisypetra`` instead of ``_skull`` available for macaque with issues on petra + * ``_skull`` after SPM or ANTS if you want to process skull or angio *specific to skullTo3d*; otherwise the main pipelines of macapype will be launched (only brain segmentation will be performed) + +**NB :** ``_skullnoisypetra`` instead of ``_skull`` available for macaque with issues on petra +**NB :** ``-soft skull`` without processing brain is possible, but is still experimental. It only works if ``-skull_dt CT petra`` and -deriv -padback are NOT defined + * ``_noskullmask`` (at the end) will perform realignement to stereo and headmask (only realignement for CT) * ``_noheadmask`` (at the end) will perform only realignement to stereo From 555cbe2217b8881adc0b4962d6beb5f346730edf Mon Sep 17 00:00:00 2001 From: David Meunier Date: Wed, 28 May 2025 16:46:52 +0200 Subject: [PATCH 02/20] NB --- docs/command.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/command.rst b/docs/command.rst index 77af2a2..db4820d 100644 --- a/docs/command.rst +++ b/docs/command.rst @@ -75,7 +75,7 @@ mandatory parameters * ``_4animal`` : will use bet4animal (FSL) for brain extraction, for faster computation (by default atlas_brex is used) * ``_quick`` : will use hd-bet (Deep Learning) for brain extraction, for faster computation (by default atlas_brex is used) -**NB:** hd-bet requires a specific version of macapype/skullTo3d, not available by default + **NB:** hd-bet requires a specific version of macapype/skullTo3d, not available by default This option should be used if the coregistration to template in preparation is not performed correctly: @@ -88,10 +88,12 @@ mandatory parameters * ``_noseg`` (at the end) will perform data preparation and brain extraction (no segmentation) **Some options are specific to skullTo3d:** + * ``_skull`` after SPM or ANTS if you want to process skull or angio *specific to skullTo3d*; otherwise the main pipelines of macapype will be launched (only brain segmentation will be performed) -**NB :** ``_skullnoisypetra`` instead of ``_skull`` available for macaque with issues on petra -**NB :** ``-soft skull`` without processing brain is possible, but is still experimental. It only works if ``-skull_dt CT petra`` and -deriv -padback are NOT defined + **NB :** ``_skullnoisypetra`` instead of ``_skull`` available for macaque with issues on petra + + **NB :** ``-soft skull`` without processing brain is possible, but is still experimental. It only works if ``-skull_dt CT petra`` and -deriv -padback are NOT defined * ``_noskullmask`` (at the end) will perform realignement to stereo and headmask (only realignement for CT) * ``_noheadmask`` (at the end) will perform only realignement to stereo From cf0f16e150eb602f880544af63a610279be3c0af Mon Sep 17 00:00:00 2001 From: David Meunier Date: Wed, 28 May 2025 16:52:47 +0200 Subject: [PATCH 03/20] `` --- docs/command.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/command.rst b/docs/command.rst index db4820d..4c8a472 100644 --- a/docs/command.rst +++ b/docs/command.rst @@ -93,7 +93,7 @@ mandatory parameters **NB :** ``_skullnoisypetra`` instead of ``_skull`` available for macaque with issues on petra - **NB :** ``-soft skull`` without processing brain is possible, but is still experimental. It only works if ``-skull_dt CT petra`` and -deriv -padback are NOT defined + **NB :** ``-soft skull`` without processing brain is possible, but is still experimental. It only works if ``-skull_dt CT petra`` and ``-deriv`` and ``-padback`` are NOT defined * ``_noskullmask`` (at the end) will perform realignement to stereo and headmask (only realignement for CT) * ``_noheadmask`` (at the end) will perform only realignement to stereo From e5f807c71201300e9ed1d6d40ec3020b5f2131c3 Mon Sep 17 00:00:00 2001 From: David Meunier Date: Wed, 28 May 2025 17:13:33 +0200 Subject: [PATCH 04/20] | --- docs/command.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/command.rst b/docs/command.rst index 4c8a472..2b12162 100644 --- a/docs/command.rst +++ b/docs/command.rst @@ -77,16 +77,22 @@ mandatory parameters **NB:** hd-bet requires a specific version of macapype/skullTo3d, not available by default +| + This option should be used if the coregistration to template in preparation is not performed correctly: * ``_robustreg`` (at the end) to have a more robust registration (in two steps) +| + Finally, these option are available (to place after SPM or ANTS) and will modify the parameters but can be launched in sequence: * ``_test`` : (at the end) to check if the full pipeline is coherent (will only generate the graph.dot and graph.png) * ``_prep`` (at the end) will perform data preparation (no brain extraction and segmentation) * ``_noseg`` (at the end) will perform data preparation and brain extraction (no segmentation) +| + **Some options are specific to skullTo3d:** * ``_skull`` after SPM or ANTS if you want to process skull or angio *specific to skullTo3d*; otherwise the main pipelines of macapype will be launched (only brain segmentation will be performed) From 9524aa781cb3f8e033f76c432976e82d19bd3e89 Mon Sep 17 00:00:00 2001 From: David Meunier Date: Wed, 10 Dec 2025 10:30:08 +0100 Subject: [PATCH 05/20] Tips and tricks --- docs/index.rst | 3 +++ docs/tips_tricks.rst | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 docs/tips_tricks.rst diff --git a/docs/index.rst b/docs/index.rst index 7781d30..c6c2202 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -43,6 +43,8 @@ See :ref:`Commands ` for a description on the avalaible command paramet If ``-deriv``` is provided, see :ref:`Derivatives ` for a descrition of the outputs +Also, check `Tips and Tricks ` on how to format images to improve quality of registration between images and segmentation + Table of contents ****************** @@ -57,6 +59,7 @@ Table of contents derivatives params indiv_params + tips_tricks diff --git a/docs/tips_tricks.rst b/docs/tips_tricks.rst new file mode 100644 index 0000000..7d8fded --- /dev/null +++ b/docs/tips_tricks.rst @@ -0,0 +1,44 @@ +.. _tips_tricks: + +Tips and tricks +*************** + +CT images registration to MRI (be it T1w or T2w) can be somehow tricky. + +Here a few tricks: + +Reorientation can help +###################### + +The -orient LPS corresponds to the direction where the increasing numbers are pointing at (typically RAS in radiological convention) and take the opposite directions (special AFNI...). + +If you want to exchange to axis, change "target" letters accordingly +RPI -> RIP + +If you want to revert one dimension, be careful to modify another axis: +RPI -> RPS becomes LPS to exchange I by S, and good R-L dimension as well + +.. code:: bash + + $ 3drefit -orient LPS sub-Phoenix_ses-01_acq-CT_T2star.nii.gz + +Possibly followed by + +.. code:: bash + + $ fslreorient2std sub-Phoenix_ses-01_acq-CT_T2star.nii.gz sub-Phoenix_ses-01_acq-CT_T2star_reorient.nii.gz + + +Cropping (both T1w et T2w) can help +################################### + +Include the full head for the CT image + +Be careful with Left-Right orientation +###################################### + +Most of the images in our center are acquired in the right direction, but with an encoding matching inverse Left-Right Encoding to the one that is coming out of the MRI + +.. code:: bash + + $ 3drefit -orient LPI sub-Rusty/ses-01/anat/sub-Rusty_ses-01_acq-CT_run-02_T2star.nii.gz From 79b1a60c0efaae3907e2e12c61c48e5089f3cebd Mon Sep 17 00:00:00 2001 From: David Meunier Date: Wed, 10 Dec 2025 10:38:18 +0100 Subject: [PATCH 06/20] ref --- docs/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index c6c2202..006acdb 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -43,7 +43,7 @@ See :ref:`Commands ` for a description on the avalaible command paramet If ``-deriv``` is provided, see :ref:`Derivatives ` for a descrition of the outputs -Also, check `Tips and Tricks ` on how to format images to improve quality of registration between images and segmentation +Also, check :ref:`Tips and Tricks ` on how to format images to improve quality of registration between images and segmentation Table of contents From 83889f09c53fd3b78871833240a1b6be7b7c68f5 Mon Sep 17 00:00:00 2001 From: David Meunier Date: Wed, 10 Dec 2025 10:41:19 +0100 Subject: [PATCH 07/20] ___ --- docs/.indiv_params.rst.kate-swp | Bin 0 -> 77 bytes docs/tips_tricks.rst | 4 +++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 docs/.indiv_params.rst.kate-swp diff --git a/docs/.indiv_params.rst.kate-swp b/docs/.indiv_params.rst.kate-swp new file mode 100644 index 0000000000000000000000000000000000000000..0dfe6e8dc7a6d7dcefa5bdd06c0860a77c8895e0 GIT binary patch literal 77 zcmZQzU=Z?7EJ;-eE>A2_aLdd|RWQ;sU|?VniR3wVbB^Upt&q<%q~_nctg~9hVn%Qf TP=*;K3&f(X!JbH5#&}l%Jtq<= literal 0 HcmV?d00001 diff --git a/docs/tips_tricks.rst b/docs/tips_tricks.rst index 7d8fded..a94c02d 100644 --- a/docs/tips_tricks.rst +++ b/docs/tips_tricks.rst @@ -1,7 +1,9 @@ +:orphan: + .. _tips_tricks: Tips and tricks -*************** +_______________ CT images registration to MRI (be it T1w or T2w) can be somehow tricky. From 9823a9a03f1b5df4c8d64220599ba48e6f406b50 Mon Sep 17 00:00:00 2001 From: David Meunier Date: Wed, 10 Dec 2025 10:55:38 +0100 Subject: [PATCH 08/20] -skull option # Conflicts: # docs/command.rst --- docs/command.rst | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/docs/command.rst b/docs/command.rst index 2b12162..c30c3b6 100644 --- a/docs/command.rst +++ b/docs/command.rst @@ -75,9 +75,7 @@ mandatory parameters * ``_4animal`` : will use bet4animal (FSL) for brain extraction, for faster computation (by default atlas_brex is used) * ``_quick`` : will use hd-bet (Deep Learning) for brain extraction, for faster computation (by default atlas_brex is used) - **NB:** hd-bet requires a specific version of macapype/skullTo3d, not available by default - -| +**NB:** hd-bet requires a specific version of macapype/skullTo3d, not available by default This option should be used if the coregistration to template in preparation is not performed correctly: @@ -91,15 +89,10 @@ mandatory parameters * ``_prep`` (at the end) will perform data preparation (no brain extraction and segmentation) * ``_noseg`` (at the end) will perform data preparation and brain extraction (no segmentation) -| - - **Some options are specific to skullTo3d:** - * ``_skull`` after SPM or ANTS if you want to process skull or angio *specific to skullTo3d*; otherwise the main pipelines of macapype will be launched (only brain segmentation will be performed) - **NB :** ``_skullnoisypetra`` instead of ``_skull`` available for macaque with issues on petra - - **NB :** ``-soft skull`` without processing brain is possible, but is still experimental. It only works if ``-skull_dt CT petra`` and ``-deriv`` and ``-padback`` are NOT defined +**NB :** ``_skullnoisypetra`` instead of ``_skull`` available for macaque with issues on petra +**NB :** ``-soft skull`` without processing brain is possible, but is still experimental. It only works if ``-skull_dt CT petra`` and -deriv -padback are NOT defined * ``_noskullmask`` (at the end) will perform realignement to stereo and headmask (only realignement for CT) * ``_noheadmask`` (at the end) will perform only realignement to stereo From 4856a05f4efe46a7dcd78fc23340e67e8793088a Mon Sep 17 00:00:00 2001 From: David Meunier Date: Wed, 10 Dec 2025 11:02:27 +0100 Subject: [PATCH 09/20] indent NB --- docs/command.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/command.rst b/docs/command.rst index c30c3b6..a23574b 100644 --- a/docs/command.rst +++ b/docs/command.rst @@ -75,7 +75,7 @@ mandatory parameters * ``_4animal`` : will use bet4animal (FSL) for brain extraction, for faster computation (by default atlas_brex is used) * ``_quick`` : will use hd-bet (Deep Learning) for brain extraction, for faster computation (by default atlas_brex is used) -**NB:** hd-bet requires a specific version of macapype/skullTo3d, not available by default + **NB:** hd-bet requires a specific version of macapype/skullTo3d, not available by default This option should be used if the coregistration to template in preparation is not performed correctly: From 1fa041ce03eb110c2fcb1314523e178252c3dd3e Mon Sep 17 00:00:00 2001 From: David Meunier Date: Wed, 10 Dec 2025 11:05:15 +0100 Subject: [PATCH 10/20] no indent --- docs/command.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/command.rst b/docs/command.rst index a23574b..c30c3b6 100644 --- a/docs/command.rst +++ b/docs/command.rst @@ -75,7 +75,7 @@ mandatory parameters * ``_4animal`` : will use bet4animal (FSL) for brain extraction, for faster computation (by default atlas_brex is used) * ``_quick`` : will use hd-bet (Deep Learning) for brain extraction, for faster computation (by default atlas_brex is used) - **NB:** hd-bet requires a specific version of macapype/skullTo3d, not available by default +**NB:** hd-bet requires a specific version of macapype/skullTo3d, not available by default This option should be used if the coregistration to template in preparation is not performed correctly: From cb21cc064593fedb0566ac19c51d540ed0925d33 Mon Sep 17 00:00:00 2001 From: David Meunier Date: Wed, 10 Dec 2025 11:12:53 +0100 Subject: [PATCH 11/20] indent --- docs/command.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/command.rst b/docs/command.rst index c30c3b6..8d25138 100644 --- a/docs/command.rst +++ b/docs/command.rst @@ -88,11 +88,10 @@ mandatory parameters * ``_test`` : (at the end) to check if the full pipeline is coherent (will only generate the graph.dot and graph.png) * ``_prep`` (at the end) will perform data preparation (no brain extraction and segmentation) * ``_noseg`` (at the end) will perform data preparation and brain extraction (no segmentation) - * ``_skull`` after SPM or ANTS if you want to process skull or angio *specific to skullTo3d*; otherwise the main pipelines of macapype will be launched (only brain segmentation will be performed) -**NB :** ``_skullnoisypetra`` instead of ``_skull`` available for macaque with issues on petra -**NB :** ``-soft skull`` without processing brain is possible, but is still experimental. It only works if ``-skull_dt CT petra`` and -deriv -padback are NOT defined + **NB :** ``_skullnoisypetra`` instead of ``_skull`` available for macaque with issues on petra + **NB :** ``-soft skull`` without processing brain is possible, but is still experimental. It only works if ``-skull_dt CT petra`` and -deriv -padback are NOT defined * ``_noskullmask`` (at the end) will perform realignement to stereo and headmask (only realignement for CT) * ``_noheadmask`` (at the end) will perform only realignement to stereo From 737998aaa139d211b9e15d2e7e095753629c8616 Mon Sep 17 00:00:00 2001 From: David Meunier Date: Wed, 10 Dec 2025 11:16:41 +0100 Subject: [PATCH 12/20] simplified indent --- docs/command.rst | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/docs/command.rst b/docs/command.rst index 8d25138..ce12bc9 100644 --- a/docs/command.rst +++ b/docs/command.rst @@ -73,30 +73,18 @@ mandatory parameters For ``-soft`` value, it is possible to add some key words (e.g. ``-soft ANTS_robustreg_prep``) all these options are available (to place after SPM or ANTS, e.g) and will change the brain extraction: * ``_4animal`` : will use bet4animal (FSL) for brain extraction, for faster computation (by default atlas_brex is used) - * ``_quick`` : will use hd-bet (Deep Learning) for brain extraction, for faster computation (by default atlas_brex is used) - -**NB:** hd-bet requires a specific version of macapype/skullTo3d, not available by default - - This option should be used if the coregistration to template in preparation is not performed correctly: - - * ``_robustreg`` (at the end) to have a more robust registration (in two steps) - -| + * ``_quick`` : will use hd-bet (Deep Learning) for brain extraction, for faster computation (by default atlas_brex is used) **NB:** hd-bet requires a specific version of macapype/skullTo3d, not available by default + * ``_robustreg`` (at the end) to have a more robust registration (in two steps) . This option should be used if the coregistration to template in preparation is not performed correctly Finally, these option are available (to place after SPM or ANTS) and will modify the parameters but can be launched in sequence: * ``_test`` : (at the end) to check if the full pipeline is coherent (will only generate the graph.dot and graph.png) * ``_prep`` (at the end) will perform data preparation (no brain extraction and segmentation) * ``_noseg`` (at the end) will perform data preparation and brain extraction (no segmentation) - * ``_skull`` after SPM or ANTS if you want to process skull or angio *specific to skullTo3d*; otherwise the main pipelines of macapype will be launched (only brain segmentation will be performed) - - **NB :** ``_skullnoisypetra`` instead of ``_skull`` available for macaque with issues on petra - **NB :** ``-soft skull`` without processing brain is possible, but is still experimental. It only works if ``-skull_dt CT petra`` and -deriv -padback are NOT defined - + * ``_skull`` after SPM or ANTS if you want to process skull or angio *specific to skullTo3d*; otherwise the main pipelines of macapype will be launched (only brain segmentation will be performed) **NB :** ``_skullnoisypetra`` instead of ``_skull`` available for macaque with issues on petra **NB :** ``-soft skull`` without processing brain is possible, but is still experimental. It only works if ``-skull_dt CT petra`` and -deriv -padback are NOT defined * ``_noskullmask`` (at the end) will perform realignement to stereo and headmask (only realignement for CT) * ``_noheadmask`` (at the end) will perform only realignement to stereo - -------------------- exclusive parameters -------------------- From b86332c9f12c8f36052abef2acb01885acf164df Mon Sep 17 00:00:00 2001 From: David Meunier Date: Wed, 10 Dec 2025 11:21:54 +0100 Subject: [PATCH 13/20] all bold --- docs/command.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/command.rst b/docs/command.rst index ce12bc9..f0fc61d 100644 --- a/docs/command.rst +++ b/docs/command.rst @@ -73,7 +73,7 @@ mandatory parameters For ``-soft`` value, it is possible to add some key words (e.g. ``-soft ANTS_robustreg_prep``) all these options are available (to place after SPM or ANTS, e.g) and will change the brain extraction: * ``_4animal`` : will use bet4animal (FSL) for brain extraction, for faster computation (by default atlas_brex is used) - * ``_quick`` : will use hd-bet (Deep Learning) for brain extraction, for faster computation (by default atlas_brex is used) **NB:** hd-bet requires a specific version of macapype/skullTo3d, not available by default + * ``_quick`` : will use hd-bet (Deep Learning) for brain extraction, for faster computation (by default atlas_brex is used) **NB: hd-bet requires a specific version of macapype/skullTo3d, not available by default** * ``_robustreg`` (at the end) to have a more robust registration (in two steps) . This option should be used if the coregistration to template in preparation is not performed correctly Finally, these option are available (to place after SPM or ANTS) and will modify the parameters but can be launched in sequence: @@ -81,7 +81,7 @@ mandatory parameters * ``_test`` : (at the end) to check if the full pipeline is coherent (will only generate the graph.dot and graph.png) * ``_prep`` (at the end) will perform data preparation (no brain extraction and segmentation) * ``_noseg`` (at the end) will perform data preparation and brain extraction (no segmentation) - * ``_skull`` after SPM or ANTS if you want to process skull or angio *specific to skullTo3d*; otherwise the main pipelines of macapype will be launched (only brain segmentation will be performed) **NB :** ``_skullnoisypetra`` instead of ``_skull`` available for macaque with issues on petra **NB :** ``-soft skull`` without processing brain is possible, but is still experimental. It only works if ``-skull_dt CT petra`` and -deriv -padback are NOT defined + * ``_skull`` after SPM or ANTS if you want to process skull or angio *specific to skullTo3d*; otherwise the main pipelines of macapype will be launched (only brain segmentation will be performed) **NB: ``_skullnoisypetra`` instead of ``_skull`` available for macaque with issues on petra NB: ``-soft skull`` without processing brain is possible, but is still experimental. It only works if ``-skull_dt CT petra`` and -deriv -padback are NOT defined** * ``_noskullmask`` (at the end) will perform realignement to stereo and headmask (only realignement for CT) * ``_noheadmask`` (at the end) will perform only realignement to stereo @@ -93,8 +93,8 @@ exclusive parameters * ``-params`` : *(mandatory if -species is omitted)* a json file specifiying the global parameters of the analysis. See :ref:`Parameters ` for more details * ``-species`` : *(mandatory if -params is omitted)* followed the NHP species corresponding to the image, e.g. {macaque | marmo } -**NB** marmoT2 can be used for segmenting from the T2w image (by default, T1w is used for marmo) -**NB** macaque_0p5 is available to use downsampled template (faster results) +**NB:** marmoT2 can be used for segmenting from the T2w image (by default, T1w is used for marmo) +**NB:** macaque_0p5 is available to use downsampled template (faster results) ------------------- optional parameters From 0f56ac5b9a3c7c233a33755c1af3cd9baaf0bc3e Mon Sep 17 00:00:00 2001 From: David Meunier Date: Wed, 10 Dec 2025 11:24:21 +0100 Subject: [PATCH 14/20] NB --- docs/command.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/command.rst b/docs/command.rst index f0fc61d..3b65482 100644 --- a/docs/command.rst +++ b/docs/command.rst @@ -73,7 +73,7 @@ mandatory parameters For ``-soft`` value, it is possible to add some key words (e.g. ``-soft ANTS_robustreg_prep``) all these options are available (to place after SPM or ANTS, e.g) and will change the brain extraction: * ``_4animal`` : will use bet4animal (FSL) for brain extraction, for faster computation (by default atlas_brex is used) - * ``_quick`` : will use hd-bet (Deep Learning) for brain extraction, for faster computation (by default atlas_brex is used) **NB: hd-bet requires a specific version of macapype/skullTo3d, not available by default** + * ``_quick`` : will use hd-bet (Deep Learning) for brain extraction, for faster computation (by default atlas_brex is used) **NB:** hd-bet requires a specific version of macapype/skullTo3d, not available by default * ``_robustreg`` (at the end) to have a more robust registration (in two steps) . This option should be used if the coregistration to template in preparation is not performed correctly Finally, these option are available (to place after SPM or ANTS) and will modify the parameters but can be launched in sequence: @@ -81,7 +81,7 @@ mandatory parameters * ``_test`` : (at the end) to check if the full pipeline is coherent (will only generate the graph.dot and graph.png) * ``_prep`` (at the end) will perform data preparation (no brain extraction and segmentation) * ``_noseg`` (at the end) will perform data preparation and brain extraction (no segmentation) - * ``_skull`` after SPM or ANTS if you want to process skull or angio *specific to skullTo3d*; otherwise the main pipelines of macapype will be launched (only brain segmentation will be performed) **NB: ``_skullnoisypetra`` instead of ``_skull`` available for macaque with issues on petra NB: ``-soft skull`` without processing brain is possible, but is still experimental. It only works if ``-skull_dt CT petra`` and -deriv -padback are NOT defined** + * ``_skull`` after SPM or ANTS if you want to process skull or angio *specific to skullTo3d*; otherwise the main pipelines of macapype will be launched (only brain segmentation will be performed) **NB:** ``_skullnoisypetra`` instead of ``_skull`` available for macaque with issues on petra **NB:** ``-soft skull`` without processing brain is possible, but is still experimental. It only works if ``-skull_dt CT petra`` and -deriv -padback are NOT defined * ``_noskullmask`` (at the end) will perform realignement to stereo and headmask (only realignement for CT) * ``_noheadmask`` (at the end) will perform only realignement to stereo From 59cb168080eaedfed2d5f04fd1fedf49c794bb5a Mon Sep 17 00:00:00 2001 From: David Meunier Date: Wed, 10 Dec 2025 11:29:08 +0100 Subject: [PATCH 15/20] spaces --- docs/command.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/command.rst b/docs/command.rst index 3b65482..68f9649 100644 --- a/docs/command.rst +++ b/docs/command.rst @@ -81,9 +81,12 @@ mandatory parameters * ``_test`` : (at the end) to check if the full pipeline is coherent (will only generate the graph.dot and graph.png) * ``_prep`` (at the end) will perform data preparation (no brain extraction and segmentation) * ``_noseg`` (at the end) will perform data preparation and brain extraction (no segmentation) + * ``_skull`` after SPM or ANTS if you want to process skull or angio *specific to skullTo3d*; otherwise the main pipelines of macapype will be launched (only brain segmentation will be performed) **NB:** ``_skullnoisypetra`` instead of ``_skull`` available for macaque with issues on petra **NB:** ``-soft skull`` without processing brain is possible, but is still experimental. It only works if ``-skull_dt CT petra`` and -deriv -padback are NOT defined - * ``_noskullmask`` (at the end) will perform realignement to stereo and headmask (only realignement for CT) + * ``_noheadmask`` (at the end) will perform only realignement to stereo + * ``_noskullmask`` (at the end) will perform realignement to stereo and compute headmask (only realignement for CT) + * ``_nofullskullmask`` (at the end) will not perform fullskullmask (only realignement for CT) -------------------- exclusive parameters From d57dcba89a7058c80b153be73b3c655b65b535cb Mon Sep 17 00:00:00 2001 From: David Meunier Date: Thu, 18 Dec 2025 15:15:17 +0100 Subject: [PATCH 16/20] template_parcel --- workflows/segment_skull.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/workflows/segment_skull.py b/workflows/segment_skull.py index 6762f6a..68cf601 100644 --- a/workflows/segment_skull.py +++ b/workflows/segment_skull.py @@ -376,6 +376,18 @@ def create_main_workflow(cmd, data_dir, process_dir, soft, species, subjects, "Could not find template_seg {}".format(template_seg) params_template["template_seg"] = template_seg + elif len(template_files) == 4: + + template_seg = os.path.join(template_path, template_files[2]) + assert os.path.exists(template_seg), \ + "Could not find template_seg {}".format(template_seg) + params_template["template_seg"] = template_seg + + template_parcel = os.path.join(template_path, template_files[3]) + assert os.path.exists(template_parcel), \ + "Could not find template_parcel {}".format(template_parcel) + params_template["template_parcel"] = template_parcel + elif len(template_files) == 5: template_gm = os.path.join(template_path, template_files[2]) From f34865c2dbfab5959e2203a641ca869f1bfb4b25 Mon Sep 17 00:00:00 2001 From: David Meunier Date: Tue, 6 Jan 2026 13:11:33 +0100 Subject: [PATCH 17/20] added template stereoINTv2 + petra_head_auto_mask --- ...rams_segment_marmo_ants_4animal_skull.json | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/workflows/params_segment_marmo_ants_4animal_skull.json b/workflows/params_segment_marmo_ants_4animal_skull.json index c752c9a..f8592c9 100644 --- a/workflows/params_segment_marmo_ants_4animal_skull.json +++ b/workflows/params_segment_marmo_ants_4animal_skull.json @@ -1,7 +1,7 @@ { "general": { - "template_name": "MBM_v3.0.1_6seg_stereoINT" + "template_name": "template_MBM_space-stereoINTv2" }, "short_preparation_pipe": { @@ -17,14 +17,6 @@ "rig_only_flag":true } }, - "pad_template": - { - "operation" : "PadImage", - "op2" : "90" - }, - "denoise": - { - }, "fast": { "args": "-l 3" @@ -45,16 +37,12 @@ }, "brain_segment_pipe": { - "reg": + "reg_f3d": { - "n": 2, - "m": "ref", - "dof": 12 }, "segment_atropos_pipe": { "use_priors":0.0, - "Atropos": { "dimension": 3 @@ -157,6 +145,11 @@ "headmask_petra_pipe": { "petra_itkdebias":{}, + "petra_head_auto_mask": + { + "operation": "lower", + "index": 1 + }, "petra_head_dilate": { "operation": "modal", @@ -294,6 +287,11 @@ "kernel_size": 7.0 } } + "petra_head_auto_mask": + { + "operation": "lower", + "index": 1 + }, }, "skull_ct_pipe": From 250fa3291e280b30f6b659ba5c895d4f547cb81e Mon Sep 17 00:00:00 2001 From: David Meunier Date: Tue, 6 Jan 2026 13:26:34 +0100 Subject: [PATCH 18/20] "petra_head_auto_mask": { "operation": "lower", "index": 1 }, --- workflows/params_segment_marmo_ants_4animal_skull.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/workflows/params_segment_marmo_ants_4animal_skull.json b/workflows/params_segment_marmo_ants_4animal_skull.json index f8592c9..7ae2819 100644 --- a/workflows/params_segment_marmo_ants_4animal_skull.json +++ b/workflows/params_segment_marmo_ants_4animal_skull.json @@ -287,11 +287,6 @@ "kernel_size": 7.0 } } - "petra_head_auto_mask": - { - "operation": "lower", - "index": 1 - }, }, "skull_ct_pipe": From 5c95fc07b9b360e6554ec616f8fb7fe202e68a6e Mon Sep 17 00:00:00 2001 From: David Meunier Date: Tue, 6 Jan 2026 16:54:07 +0100 Subject: [PATCH 19/20] modif automask lithresh --- workflows/params_segment_marmo_ants_4animal_skull.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/workflows/params_segment_marmo_ants_4animal_skull.json b/workflows/params_segment_marmo_ants_4animal_skull.json index 7ae2819..aebcc7f 100644 --- a/workflows/params_segment_marmo_ants_4animal_skull.json +++ b/workflows/params_segment_marmo_ants_4animal_skull.json @@ -145,11 +145,6 @@ "headmask_petra_pipe": { "petra_itkdebias":{}, - "petra_head_auto_mask": - { - "operation": "lower", - "index": 1 - }, "petra_head_dilate": { "operation": "modal", From 279f197371e8f11eb2e612dbf9170f63a8b089f7 Mon Sep 17 00:00:00 2001 From: David Meunier Date: Wed, 7 Jan 2026 10:37:31 +0100 Subject: [PATCH 20/20] forgot to add parcelgm --- workflows/params_segment_marmo_ants_4animal_skull.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/workflows/params_segment_marmo_ants_4animal_skull.json b/workflows/params_segment_marmo_ants_4animal_skull.json index aebcc7f..5893ae2 100644 --- a/workflows/params_segment_marmo_ants_4animal_skull.json +++ b/workflows/params_segment_marmo_ants_4animal_skull.json @@ -54,7 +54,9 @@ "wm": 3, "csf": 4 } - } + }, + "parcel_gm": + {} }, "export_5tt_pipe": {