From f2b847de4796c13195b78a40f51796eb55dd99b3 Mon Sep 17 00:00:00 2001 From: David Meunier Date: Wed, 28 May 2025 16:41:34 +0200 Subject: [PATCH 1/5] -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 2/5] 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 3/5] `` --- 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 4/5] | --- 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 ab0a404a9dc8bbdc7e18ac8119a1af8e79446c42 Mon Sep 17 00:00:00 2001 From: David Meunier Date: Fri, 29 Aug 2025 15:46:31 +0200 Subject: [PATCH 5/5] based on ssoft --- skullTo3d/utils/utils_params.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/skullTo3d/utils/utils_params.py b/skullTo3d/utils/utils_params.py index 54a07eb..962a53e 100644 --- a/skullTo3d/utils/utils_params.py +++ b/skullTo3d/utils/utils_params.py @@ -105,6 +105,30 @@ def update_skull_params(ssoft, params): print('deleting skullmask_ct_pipe') del spp["skullmask_ct_pipe"] + # if no brain seg mask, removed fullskullmask + if "noseg" in ssoft or "prep" in ssoft: + + if "skull_petra_pipe" in params: + spp = params["skull_petra_pipe"] + + if "fullskullmask_petra_pipe" in spp: + print('deleting fullskullmask_petra_pipe') + del spp["fullskullmask_petra_pipe"] + + if "skull_megre_pipe" in params: + smp = params["skull_megre_pipe"] + + if "fullskullmask_megre_pipe" in smp: + print('deleting fullskullmask_megre_pipe') + del smp["fullskullmask_megre_pipe"] + + if "skull_t1_pipe" in params: + spp = params["skull_t1_pipe"] + + if "fullskullmask_t1_pipe" in spp: + print('deleting fullskullmask_t1_pipe') + del spp["fullskullmask_t1_pipe"] + return params