ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkBinaryShapeOpeningImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkBinaryShapeOpeningImageFilter_h
19 #define itkBinaryShapeOpeningImageFilter_h
20 
21 #include "itkShapeLabelObject.h"
23 #include "itkShapeLabelMapFilter.h"
26 
27 namespace itk
28 {
46 template< typename TInputImage >
47 class ITK_TEMPLATE_EXPORT BinaryShapeOpeningImageFilter:
48  public ImageToImageFilter< TInputImage, TInputImage >
49 {
50 public:
51  ITK_DISALLOW_COPY_AND_ASSIGN(BinaryShapeOpeningImageFilter);
52 
58 
60  using InputImageType = TInputImage;
61  using OutputImageType = TInputImage;
62  using InputImagePointer = typename InputImageType::Pointer;
63  using InputImageConstPointer = typename InputImageType::ConstPointer;
65  using InputImagePixelType = typename InputImageType::PixelType;
66  using OutputImagePointer = typename OutputImageType::Pointer;
67  using OutputImageConstPointer = typename OutputImageType::ConstPointer;
69  using OutputImagePixelType = typename OutputImageType::PixelType;
70 
72  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
73  static constexpr unsigned int OutputImageDimension = TInputImage::ImageDimension;
74  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
75 
77 
87 
89  itkNewMacro(Self);
90 
93 
100  itkSetMacro(FullyConnected, bool);
101  itkGetConstReferenceMacro(FullyConnected, bool);
102  itkBooleanMacro(FullyConnected);
104 
105 #ifdef ITK_USE_CONCEPT_CHECKING
106  // Begin concept checking
107  itkConceptMacro( InputEqualityComparableCheck,
109  itkConceptMacro( IntConvertibleToInputCheck,
111  itkConceptMacro( InputOStreamWritableCheck,
113  // End concept checking
114 #endif
115 
120  itkSetMacro(BackgroundValue, OutputImagePixelType);
121  itkGetConstMacro(BackgroundValue, OutputImagePixelType);
123 
128  itkSetMacro(ForegroundValue, OutputImagePixelType);
129  itkGetConstMacro(ForegroundValue, OutputImagePixelType);
131 
135  itkGetConstMacro(Lambda, double);
136  itkSetMacro(Lambda, double);
138 
145  itkGetConstMacro(ReverseOrdering, bool);
146  itkSetMacro(ReverseOrdering, bool);
147  itkBooleanMacro(ReverseOrdering);
149 
154  itkGetConstMacro(Attribute, AttributeType);
155  itkSetMacro(Attribute, AttributeType);
156  void SetAttribute(const std::string & s)
157  {
158  this->SetAttribute( LabelObjectType::GetAttributeFromName(s) );
159  }
161 
162 protected:
164  ~BinaryShapeOpeningImageFilter() override = default;
165  void PrintSelf(std::ostream & os, Indent indent) const override;
166 
169  void GenerateInputRequestedRegion() override;
170 
172  void EnlargeOutputRequestedRegion( DataObject *itkNotUsed(output) ) override;
173 
176  void GenerateData() override;
177 
178 private:
182  double m_Lambda;
185 }; // end of class
186 } // end namespace itk
187 
188 #ifndef ITK_MANUAL_INSTANTIATION
189 #include "itkBinaryShapeOpeningImageFilter.hxx"
190 #endif
191 
192 #endif
typename InputImageType::RegionType InputImageRegionType
Light weight base class for most itk classes.
unsigned long SizeValueType
Definition: itkIntTypes.h:83
typename OutputImageType::PixelType OutputImagePixelType
typename OutputImageType::RegionType OutputImageRegionType
Remove objects based on the value of their shape attribute.
Remove objects according to the value of their shape attribute.
typename InputImageType::ConstPointer InputImageConstPointer
typename InputImageType::PixelType InputImagePixelType
A Label object to store the common attributes related to the shape of the object. ...
Label the connected components in a binary image and produce a collection of label objects...
typename LabelObjectType::AttributeType AttributeType
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Templated n-dimensional image to store labeled objects.
Definition: itkLabelMap.h:70
#define itkConceptMacro(name, concept)
typename OutputImageType::ConstPointer OutputImageConstPointer
The valuator class for the ShapeLabelObject.
typename Superclass::AttributeType AttributeType
Base class for all data objects in ITK.
Templated n-dimensional image class.
Definition: itkImage.h:75
Convert a LabelMap to a binary image.
typename InputImageType::Pointer InputImagePointer
typename OutputImageType::Pointer OutputImagePointer