/
simpleregiongrowingsegmentation.py
83 lines (68 loc) · 2.99 KB
/
simpleregiongrowingsegmentation.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# -*- coding: utf-8 -*-
# -*- coding: utf8 -*-
"""Autogenerated file - DO NOT EDIT
If you spot a bug, please report it on the mailing list and/or change the generator."""
from nipype.interfaces.base import (
CommandLine,
CommandLineInputSpec,
SEMLikeCommandLine,
TraitedSpec,
File,
Directory,
traits,
isdefined,
InputMultiPath,
OutputMultiPath,
)
import os
class SimpleRegionGrowingSegmentationInputSpec(CommandLineInputSpec):
smoothingIterations = traits.Int(
desc="Number of smoothing iterations", argstr="--smoothingIterations %d"
)
timestep = traits.Float(desc="Timestep for curvature flow", argstr="--timestep %f")
iterations = traits.Int(
desc="Number of iterations of region growing", argstr="--iterations %d"
)
multiplier = traits.Float(
desc="Number of standard deviations to include in intensity model",
argstr="--multiplier %f",
)
neighborhood = traits.Int(
desc="The radius of the neighborhood over which to calculate intensity model",
argstr="--neighborhood %d",
)
labelvalue = traits.Int(
desc="The integer value (0-255) to use for the segmentation results. This will determine the color of the segmentation that will be generated by the Region growing algorithm",
argstr="--labelvalue %d",
)
seed = InputMultiPath(
traits.List(traits.Float(), minlen=3, maxlen=3),
desc="Seed point(s) for region growing",
argstr="--seed %s...",
)
inputVolume = File(
position=-2, desc="Input volume to be filtered", exists=True, argstr="%s"
)
outputVolume = traits.Either(
traits.Bool,
File(),
position=-1,
hash_files=False,
desc="Output filtered",
argstr="%s",
)
class SimpleRegionGrowingSegmentationOutputSpec(TraitedSpec):
outputVolume = File(position=-1, desc="Output filtered", exists=True)
class SimpleRegionGrowingSegmentation(SEMLikeCommandLine):
"""title: Simple Region Growing Segmentation
category: Segmentation
description: A simple region growing segmentation algorithm based on intensity statistics. To create a list of fiducials (Seeds) for this algorithm, click on the tool bar icon of an arrow pointing to a starburst fiducial to enter the 'place a new object mode' and then use the fiducials module. This module uses the Slicer Command Line Interface (CLI) and the ITK filters CurvatureFlowImageFilter and ConfidenceConnectedImageFilter.
version: 0.1.0.$Revision: 19904 $(alpha)
documentation-url: http://www.slicer.org/slicerWiki/index.php/Documentation/4.1/Modules/SimpleRegionGrowingSegmentation
contributor: Jim Miller (GE)
acknowledgements: This command module was derived from Insight/Examples (copyright) Insight Software Consortium
"""
input_spec = SimpleRegionGrowingSegmentationInputSpec
output_spec = SimpleRegionGrowingSegmentationOutputSpec
_cmd = "SimpleRegionGrowingSegmentation "
_outputs_filenames = {"outputVolume": "outputVolume.nii"}