Skip to content

Commit

Permalink
Modif marmo ants skull (#34)
Browse files Browse the repository at this point in the history
* removed_crop_z_T1,  head mesh, copy_header = false for pad + minimal_reg by default, cmd and version in  real params
  • Loading branch information
davidmeunier79 authored Feb 20, 2025
1 parent f6b4aaf commit f371932
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 38 deletions.
2 changes: 1 addition & 1 deletion workflows/params_segment_macaque_ants_skull.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"pad_template":
{
"copy_header" : true,
"copy_header" : false,
"operation" : "PadImage",
"op2" : "70"
}
Expand Down
16 changes: 5 additions & 11 deletions workflows/params_segment_macaque_spm_skull.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,18 @@
},
"short_preparation_pipe":
{

"aladin_T2_on_T1":{},
"crop_aladin_pipe":
{
"pre_crop_z_T1":
{
"brainsize": 70
},
"reg_T1_on_template":
{
},
"reg_T1_on_template2":
{
}
},
"resample_T1_pad":
},
"pad_template":
{
"pad_val": 30
"copy_header" : false,
"operation" : "PadImage",
"op2" : "70"
}
},
"debias":
Expand Down
23 changes: 5 additions & 18 deletions workflows/params_segment_marmo_ants_skull.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,23 @@
},
"short_preparation_pipe":
{
"aladin_T2_on_T1":{},

"use_T2":{},
"aladin_T2_on_T1": {},

"crop_aladin_pipe":
{
"remove_capsule_pipe":{},

"reg_T1_on_template":
{
"nac_flag": true,
"rig_only_flag": true,
"nosym_flag": true,
"ln_val": 12,
"lp_val": 10,
"smoo_r_val": 1.0
},
"reg_T1_on_template2":
{
"rig_only_flag": true,
"nosym_flag": true,
"ln_val": 17,
"lp_val": 15,
"smoo_r_val": 1.0
"rig_only_flag": true
}
},
"pad_template":
{
"copy_header" : true,
"copy_header" : false,
"operation" : "PadImage",
"op2" : "70"
"op2" : "90"
}
},
"fast":
Expand Down
20 changes: 13 additions & 7 deletions workflows/params_segment_marmo_spm_skull.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,25 @@
"template_name": "MBM_v3.0.1",
"template_stereo_name": "bma-1_0p2mm"
},
"short_preparation_pipe":
"short_preparation_pipe":
{
"use_T2":{},
"aladin_T2_on_T1": {},

"crop_aladin_pipe":
{
"use_T2": {},
"remove_capsule_pipe":{},

"reg_T1_on_template":
{
},
"reg_T1_on_template2":
{
}
},
"resample_T1_pad": {}
},
"pad_template":
{
"copy_header" : false,
"operation" : "PadImage",
"op2" : "90"
}
},
"debias":
{
Expand Down
13 changes: 12 additions & 1 deletion workflows/segment_skull.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
# Julien Sein ([email protected])
# Adam Sghari ([email protected])

import sys

import os
import os.path as op

Expand Down Expand Up @@ -92,11 +94,12 @@
rename_all_skull_t1_derivatives,
rename_all_skull_ct_derivatives, rename_all_angio_derivatives)

from skullTo3d._version import __version__

fsl.FSLCommand.set_default_output_type('NIFTI_GZ')
##########################################################################

def create_main_workflow(data_dir, process_dir, soft, species, subjects,
def create_main_workflow(cmd, data_dir, process_dir, soft, species, subjects,
sessions, brain_dt, skull_dt, acquisitions,
reconstructions, params_file, indiv_params_file,
mask_file, template_path, template_files, nprocs,
Expand Down Expand Up @@ -880,6 +883,11 @@ def create_main_workflow(data_dir, process_dir, soft, species, subjects,
main_workflow.write_graph(graph2use="colored")
main_workflow.config['execution'] = {'remove_unnecessary_outputs': 'false'}

# saving real params.json
params["skullTo3d"] = __version__

params["full_command"] = cmd

# saving real params.json
real_params_file = op.join(process_dir, wf_name, "real_params.json")
with open(real_params_file, 'w+') as fp:
Expand Down Expand Up @@ -984,9 +992,12 @@ def main():

args = parser.parse_args()

cmd = " ".join(sys.argv)

# main_workflow
print("Initialising the pipeline...")
create_main_workflow(
cmd=cmd,
data_dir=args.data,
soft=args.soft,
process_dir=args.out,
Expand Down

0 comments on commit f371932

Please sign in to comment.