Skip to content

Commit 0d20249

Browse files
[HOT] Hotfix noskullmask noheadmask (#59)
nohead/noskull in rename ssoft but noheadmask/noskullmask in utils_params if t1, skull_t1_pipe is empty when noheadmask -> bug , sorted with adding one empty node
1 parent 786580f commit 0d20249

5 files changed

Lines changed: 35 additions & 7 deletions

File tree

docs/command.rst

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,33 @@ mandatory parameters
7474

7575
* ``_4animal`` : will use bet4animal (FSL) for brain extraction, for faster computation (by default atlas_brex is used)
7676
* ``_quick`` : will use hd-bet (Deep Learning) for brain extraction, for faster computation (by default atlas_brex is used)
77-
**NB: ** hd-bet requires a specific version of macapype/skullTo3d, not available by default
77+
78+
**NB:** hd-bet requires a specific version of macapype/skullTo3d, not available by default
79+
80+
|
7881
7982
This option should be used if the coregistration to template in preparation is not performed correctly:
8083

8184
* ``_robustreg`` (at the end) to have a more robust registration (in two steps)
8285

86+
|
87+
8388
Finally, these option are available (to place after SPM or ANTS) and will modify the parameters but can be launched in sequence:
8489

8590
* ``_test`` : (at the end) to check if the full pipeline is coherent (will only generate the graph.dot and graph.png)
8691
* ``_prep`` (at the end) will perform data preparation (no brain extraction and segmentation)
8792
* ``_noseg`` (at the end) will perform data preparation and brain extraction (no segmentation)
8893

94+
|
95+
8996
**Some options are specific to skullTo3d:**
90-
* ``_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
97+
98+
* ``_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)
99+
100+
**NB :** ``_skullnoisypetra`` instead of ``_skull`` available for macaque with issues on petra
101+
102+
**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
103+
91104
* ``_noskullmask`` (at the end) will perform realignement to stereo and headmask (only realignement for CT)
92105
* ``_noheadmask`` (at the end) will perform only realignement to stereo
93106

skullTo3d/nodes/utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
def empty_node(in_file):
3+
out_file = in_file
4+
return out_file

skullTo3d/pipelines/skull_pipe.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131

3232
from macapype.nodes.correct_bias import itk_debias
3333

34+
from skullTo3d.nodes.utils import empty_node
35+
3436
from skullTo3d.nodes.skull import mask_auto_img
3537

3638
from macapype.nodes.prepare import apply_li_thresh
@@ -510,6 +512,16 @@ def create_skull_t1_pipe(name="skull_t1_pipe", params={}):
510512
skull_t1_pipe.connect(inputnode, "indiv_params",
511513
headmask_t1_pipe, "inputnode.indiv_params")
512514
else:
515+
empty = pe.Node(
516+
interface=niu.Function(
517+
input_names=["in_file"],
518+
output_names=["out_file"],
519+
function=empty_node),
520+
name="empty")
521+
522+
skull_t1_pipe.connect(inputnode, "stereo_T1",
523+
empty, "in_file")
524+
513525
return skull_t1_pipe
514526

515527
skull_t1_pipe.connect(

skullTo3d/utils/utils_params.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11

2-
32
def update_skull_params(ssoft, params):
43

54
if "noheadmask" in ssoft:

workflows/segment_skull.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,11 @@ def create_main_workflow(cmd, data_dir, process_dir, soft, species, subjects,
178178
if 'prep' in ssoft:
179179
new_ssoft.remove('prep')
180180

181-
if 'noskull' in ssoft:
182-
new_ssoft.remove('noskull')
181+
if 'noskullmask' in ssoft:
182+
new_ssoft.remove('noskullmask')
183183

184-
if 'nohead' in ssoft:
185-
new_ssoft.remove('nohead')
184+
if 'noheadmask' in ssoft:
185+
new_ssoft.remove('noheadmask')
186186

187187
if 'noseg' in ssoft:
188188
new_ssoft.remove('noseg')

0 commit comments

Comments
 (0)