Skip to content

Commit

Permalink
DOC: Update postprocess.py for MialsrtkRefineHRMaskByIntersection mod…
Browse files Browse the repository at this point in the history
…ules.
  • Loading branch information
pdedumast committed Nov 3, 2020
1 parent 1abffeb commit fbdc612
Showing 1 changed file with 42 additions and 22 deletions.
64 changes: 42 additions & 22 deletions pymialsrtk/interfaces/postprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,9 @@
#######################

class MialsrtkRefineHRMaskByIntersectionInputSpec(BaseInterfaceInputSpec):
bids_dir = Directory(desc='BIDS root directory', mandatory=True, exists=True)
input_images = InputMultiPath(File(desc='Image filenames used in SR reconstruction', mandatory=True))
input_masks = InputMultiPath(File(desc='Mask filenames', mandatory=True))
input_transforms = InputMultiPath(File(desc='Transformation filenames', mandatory=True))
input_sr = File(desc='SR image filename', mandatory=True)

input_rad_dilatation = traits.Int(1,desc='Radius of the structuring element (ball)', usedefault=True)
in_use_staple = traits.Bool(True, desc='Use STAPLE for voting (default is True). If False, Majority voting is used instead', usedefault=True)

out_LRmask_postfix = traits.Str("_LRmask", desc='Suffix to be added to the Low resolution input_masks', usedefault=True)
out_srmask_postfix = traits.Str("_srMask", desc='Suffix to be added to the SR reconstruction filename to construct output SR mask filename', usedefault=True)

stacks_order = traits.List(desc='To_be_completed', mandatory=False)
"""Class used to represent inputs of the MialsrtkRefineHRMaskByIntersection interface.
class MialsrtkRefineHRMaskByIntersectionOutputSpec(TraitedSpec):
output_SRmask = File(desc='Output super-resolution reconstruction refined mask')
output_LRmasks = OutputMultiPath(File(desc='Output low-resolution reconstruction refined masks'))

class MialsrtkRefineHRMaskByIntersection(BaseInterface):
"""
Runs the MIAL SRTK mask refinement module using the Simultaneous Truth And Performance Level Estimate (STAPLE) by Warfield et al. [1]_.
Parameters
Attributes
----------
bids_dir <string>
BIDS root directory (required)
Expand Down Expand Up @@ -78,6 +58,46 @@ class MialsrtkRefineHRMaskByIntersection(BaseInterface):
stacks_order <list<int>>
order of images index. To ensure images are processed with their correct corresponding mask.
See Also
----------
pymialsrtk.interfaces.preprocess.MialsrtkRefineHRMaskByIntersection
"""
bids_dir = Directory(desc='BIDS root directory', mandatory=True, exists=True)
input_images = InputMultiPath(File(desc='Image filenames used in SR reconstruction', mandatory=True))
input_masks = InputMultiPath(File(desc='Mask filenames', mandatory=True))
input_transforms = InputMultiPath(File(desc='Transformation filenames', mandatory=True))
input_sr = File(desc='SR image filename', mandatory=True)

input_rad_dilatation = traits.Int(1,desc='Radius of the structuring element (ball)', usedefault=True)
in_use_staple = traits.Bool(True, desc='Use STAPLE for voting (default is True). If False, Majority voting is used instead', usedefault=True)

out_LRmask_postfix = traits.Str("_LRmask", desc='Suffix to be added to the Low resolution input_masks', usedefault=True)
out_srmask_postfix = traits.Str("_srMask", desc='Suffix to be added to the SR reconstruction filename to construct output SR mask filename', usedefault=True)

stacks_order = traits.List(desc='To_be_completed', mandatory=False)

class MialsrtkRefineHRMaskByIntersectionOutputSpec(TraitedSpec):
"""Class used to represent outputs of the MialsrtkRefineHRMaskByIntersection interface.
Attributes
-----------
output_LRmasks <string>
Output refined low-resolution mask file
output_SRmask <string>
Output refined high-resolution mask file
See also
--------------
pymialsrtk.interfaces.preprocess.MialsrtkRefineHRMaskByIntersection
"""
output_SRmask = File(desc='Output super-resolution reconstruction refined mask')
output_LRmasks = OutputMultiPath(File(desc='Output low-resolution reconstruction refined masks'))

class MialsrtkRefineHRMaskByIntersection(BaseInterface):
"""
Runs the MIAL SRTK mask refinement module using the Simultaneous Truth And Performance Level Estimate (STAPLE) by Warfield et al. [1]_.
References
------------
.. [1] Warfield et al.; Medical Imaging, IEEE Transactions, 2004. `(link to paper) <https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1283110/>`_
Expand Down

0 comments on commit fbdc612

Please sign in to comment.