Exemple #1
0
class HistogramMaskInputSpec(BaseInterfaceInputSpec):
    in_file = traits.File(desc="Input Image", exists=True, mandatory=True)
    out_file = traits.File(name_template='%s_histo_mask',
                           name_source='in_file',
                           keep_extension=True,
                           desc="Output Image")
    volume_threshold = traits.Int(1650,
                                  desc="Volume threshold. [default: 1650]",
                                  usedefault=True)
    intensity_threshold = traits.Int(desc="Intensity threshold. "
                                     "[default: 500]")
    terminal_output = traits.Enum(
        'stream',
        'allatonce',
        'file',
        'none',
        deprecated='1.0.0',
        desc=('Control terminal output: `stream` - '
              'displays to terminal immediately (default), '
              '`allatonce` - waits till command is '
              'finished to display output, `file` - '
              'writes output to file, `none` - output'
              ' is ignored'),
        nohash=True)
    lower_cutoff = traits.Float(
        .2,
        desc="lower fraction of the histogram to be discarded. In case of "
        "failure, it is usually advisable to increase lower_cutoff "
        "[default: 0.2]",
        usedefault=True)
    upper_cutoff = traits.Float(
        .85,
        desc="upper fraction of the histogram to be discarded."
        "[default: 0.85]",
        usedefault=True)
    connected = traits.Bool(True,
                            desc="keep only the largest connect component",
                            usedefault=True)
    opening = traits.Int(
        5,
        desc="Order of the morphological opening to perform, to keep only "
        "large structures. This step is useful to remove parts of the "
        "skull that might have been included. If the opening order is "
        "`n` > 0, 2`n` closing operations are performed after estimation "
        "of the largest connected constituent, followed by `n` erosions. "
        "This corresponds to 1 opening operation of order `n` followed "
        "by a closing operator of order `n`. Note that turning off "
        "opening (opening=0) will also prevent any smoothing applied to "
        "the image during the mask computation. [default: 2]",
        usedefault=True)
    closing = traits.Int(
        0,
        desc="Number of binary closing iterations to post-process the mask. "
        "[default: 10]",
        usedefault=True)
    dilation_size = traits.Tuple(
        (1, 1, 2),
        desc="Element size for binary dilation if needed",
        usedefault=True)
    verbose = traits.Bool(False, desc="be very verbose", usedefault=True)
Exemple #2
0
class MathMorphoMaskInputSpec(CommandLineInputSpec):
    in_file = traits.File(desc="Input Image",
                          exists=True,
                          mandatory=True,
                          argstr="%s",
                          position=0)
    out_file = traits.File(desc="Output Image",
                           name_template='%s_morpho_mask',
                           name_source='in_file',
                           keep_extension=True,
                           argstr="%s",
                           position=1)
    volume_threshold = traits.Int(
        desc="Volume threshold (the parameter V in the paper). "
        "[default: 1650]",
        argstr="-v %s")
    intensity_threshold = traits.Int(
        desc="Intensity threshold (the parameter T in the paper). "
        "[default: 500]",
        argstr="-t %s")