/
votingbinaryholefillingimagefilter.py
77 lines (62 loc) · 2.8 KB
/
votingbinaryholefillingimagefilter.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
# -*- 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 VotingBinaryHoleFillingImageFilterInputSpec(CommandLineInputSpec):
radius = InputMultiPath(
traits.Int,
desc="The radius of a hole to be filled",
sep=",",
argstr="--radius %s",
)
majorityThreshold = traits.Int(
desc="The number of pixels over 50% that will decide whether an OFF pixel will become ON or not. For example, if the neighborhood of a pixel has 124 pixels (excluding itself), the 50% will be 62, and if you set a Majority threshold of 5, that means that the filter will require 67 or more neighbor pixels to be ON in order to switch the current OFF pixel to ON.",
argstr="--majorityThreshold %d",
)
background = traits.Int(
desc="The value associated with the background (not object)",
argstr="--background %d",
)
foreground = traits.Int(
desc="The value associated with the foreground (object)",
argstr="--foreground %d",
)
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 VotingBinaryHoleFillingImageFilterOutputSpec(TraitedSpec):
outputVolume = File(position=-1, desc="Output filtered", exists=True)
class VotingBinaryHoleFillingImageFilter(SEMLikeCommandLine):
"""title: Voting Binary Hole Filling Image Filter
category: Filtering
description: Applies a voting operation in order to fill-in cavities. This can be used for smoothing contours and for filling holes in binary images. This technique is used frequently when segmenting complete organs that may have ducts or vasculature that may not have been included in the initial segmentation, e.g. lungs, kidneys, liver.
version: 0.1.0.$Revision: 19608 $(alpha)
documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/4.1/Modules/VotingBinaryHoleFillingImageFilter
contributor: Bill Lorensen (GE)
acknowledgements: This command module was derived from Insight/Examples/Filtering/VotingBinaryHoleFillingImageFilter (copyright) Insight Software Consortium
"""
input_spec = VotingBinaryHoleFillingImageFilterInputSpec
output_spec = VotingBinaryHoleFillingImageFilterOutputSpec
_cmd = "VotingBinaryHoleFillingImageFilter "
_outputs_filenames = {"outputVolume": "outputVolume.nii"}