Skip to content

Commit

Permalink
ENH: Specify in SRTV json if masks were manual/automatic
Browse files Browse the repository at this point in the history
  • Loading branch information
pdedumast committed Nov 24, 2020
1 parent 3d4bb07 commit d1f9ebc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pymialsrtk/interfaces/reconstruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ class MialsrtkTVSuperResolutionInputSpec(BaseInterfaceInputSpec):
input_rad_dilatation = traits.Float(1.0, usedefault=True)

sub_ses = traits.Str("x", usedefault=True)
use_manual_masks = traits.Bool(False, usedefault=True)


class MialsrtkTVSuperResolutionOutputSpec(TraitedSpec):
Expand Down Expand Up @@ -379,10 +380,12 @@ def _run_interface(self, runtime):
self.m_output_dict["Input sources run order"] = self.inputs.stacks_order
self.m_output_dict["CustomMetaData"] = {}
self.m_output_dict["CustomMetaData"]["Number of scans used"] = str(len(self.inputs.stacks_order))
self.m_output_dict["CustomMetaData"]["Masks used"] = 'Manual' if self.inputs.use_manual_masks else 'Automatic'
self.m_output_dict["CustomMetaData"]["TV regularization weight lambda"] = self.inputs.in_lambda
self.m_output_dict["CustomMetaData"]["Optimization time step"] = self.inputs.in_deltat
self.m_output_dict["CustomMetaData"]["Primal/dual loops"] = self.inputs.in_loop


output_json_path = ''.join([self.m_out_files, '.json'])
with open(output_json_path, 'w') as outfile:
json.dump(self.m_output_dict, outfile)
Expand Down
1 change: 1 addition & 0 deletions pymialsrtk/pipelines/anatomical/srr.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ def create_workflow(self):
srtkTVSuperResolution.inputs.in_loop = self.primal_dual_loops
srtkTVSuperResolution.inputs.in_deltat = self.deltatTV
srtkTVSuperResolution.inputs.in_lambda = self.lambdaTV
srtkTVSuperResolution.inputs.use_manual_masks = self.use_manual_masks

srTVdictSink = Node(JSONFileSink(),name='srtv_json_sinker')

Expand Down

0 comments on commit d1f9ebc

Please sign in to comment.