ITK  6.0.0
Insight Toolkit
itkBinaryShapeOpeningImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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  * https://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 : public ImageToImageFilter<TInputImage, TInputImage>
48 {
49 public:
50  ITK_DISALLOW_COPY_AND_MOVE(BinaryShapeOpeningImageFilter);
51 
57 
59  using InputImageType = TInputImage;
60  using OutputImageType = TInputImage;
64  using InputImagePixelType = typename InputImageType::PixelType;
68  using OutputImagePixelType = typename OutputImageType::PixelType;
69 
71  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
72  static constexpr unsigned int OutputImageDimension = TInputImage::ImageDimension;
73  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
74 
76 
82  using AttributeType = typename LabelObjectType::AttributeType;
85 
87  itkNewMacro(Self);
88 
90  itkOverrideGetNameOfClassMacro(BinaryShapeOpeningImageFilter);
91 
98  itkSetMacro(FullyConnected, bool);
99  itkGetConstReferenceMacro(FullyConnected, bool);
100  itkBooleanMacro(FullyConnected);
103 #ifdef ITK_USE_CONCEPT_CHECKING
104  // Begin concept checking
105  itkConceptMacro(InputEqualityComparableCheck, (Concept::EqualityComparable<InputImagePixelType>));
108  // End concept checking
109 #endif
110 
115  itkSetMacro(BackgroundValue, OutputImagePixelType);
116  itkGetConstMacro(BackgroundValue, OutputImagePixelType);
123  itkSetMacro(ForegroundValue, OutputImagePixelType);
124  itkGetConstMacro(ForegroundValue, OutputImagePixelType);
130  itkGetConstMacro(Lambda, double);
131  itkSetMacro(Lambda, double);
140  itkGetConstMacro(ReverseOrdering, bool);
141  itkSetMacro(ReverseOrdering, bool);
142  itkBooleanMacro(ReverseOrdering);
149  itkGetConstMacro(Attribute, AttributeType);
150  itkSetMacro(Attribute, AttributeType);
151  void
152  SetAttribute(const std::string & s)
153  {
154  this->SetAttribute(LabelObjectType::GetAttributeFromName(s));
155  }
158 protected:
160  ~BinaryShapeOpeningImageFilter() override = default;
161  void
162  PrintSelf(std::ostream & os, Indent indent) const override;
163 
166  void
167  GenerateInputRequestedRegion() override;
168 
170  void
171  EnlargeOutputRequestedRegion(DataObject * itkNotUsed(output)) override;
172 
175  void
176  GenerateData() override;
177 
178 private:
179  bool m_FullyConnected{};
180  OutputImagePixelType m_BackgroundValue{};
181  OutputImagePixelType m_ForegroundValue{};
182  double m_Lambda{};
183  bool m_ReverseOrdering{};
184  AttributeType m_Attribute{};
185 }; // end of class
186 } // end namespace itk
187 
188 #ifndef ITK_MANUAL_INSTANTIATION
189 # include "itkBinaryShapeOpeningImageFilter.hxx"
190 #endif
191 
192 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::Concept::OStreamWritable
Definition: itkConceptChecking.h:639
itk::BinaryShapeOpeningImageFilter::InputImageType
TInputImage InputImageType
Definition: itkBinaryShapeOpeningImageFilter.h:59
itk::LabelMapToBinaryImageFilter
Convert a LabelMap to a binary image.
Definition: itkLabelMapToBinaryImageFilter.h:45
itk::BinaryShapeOpeningImageFilter::OutputImagePixelType
typename OutputImageType::PixelType OutputImagePixelType
Definition: itkBinaryShapeOpeningImageFilter.h:68
itk::BinaryShapeOpeningImageFilter::InputImageConstPointer
typename InputImageType::ConstPointer InputImageConstPointer
Definition: itkBinaryShapeOpeningImageFilter.h:62
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ShapeLabelMapFilter
The valuator class for the ShapeLabelObject.
Definition: itkShapeLabelMapFilter.h:53
itk::BinaryShapeOpeningImageFilter::SetAttribute
void SetAttribute(const std::string &s)
Definition: itkBinaryShapeOpeningImageFilter.h:152
itkShapeOpeningLabelMapFilter.h
itk::BinaryShapeOpeningImageFilter::LabelType
SizeValueType LabelType
Definition: itkBinaryShapeOpeningImageFilter.h:75
itk::BinaryImageToLabelMapFilter
Label the connected components in a binary image and produce a collection of label objects.
Definition: itkBinaryImageToLabelMapFilter.h:55
itk::LabelMap
Templated n-dimensional image to store labeled objects.
Definition: itkLabelMap.h:70
itkShapeLabelMapFilter.h
itkShapeLabelObject.h
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::BinaryShapeOpeningImageFilter::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkBinaryShapeOpeningImageFilter.h:67
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::BinaryShapeOpeningImageFilter::OutputImageConstPointer
typename OutputImageType::ConstPointer OutputImageConstPointer
Definition: itkBinaryShapeOpeningImageFilter.h:66
itk::BinaryShapeOpeningImageFilter::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkBinaryShapeOpeningImageFilter.h:65
itk::BinaryShapeOpeningImageFilter::AttributeType
typename LabelObjectType::AttributeType AttributeType
Definition: itkBinaryShapeOpeningImageFilter.h:82
itk::BinaryShapeOpeningImageFilter
Remove objects based on the value of their shape attribute.
Definition: itkBinaryShapeOpeningImageFilter.h:47
itk::BinaryShapeOpeningImageFilter::InputImageRegionType
typename InputImageType::RegionType InputImageRegionType
Definition: itkBinaryShapeOpeningImageFilter.h:63
itk::BinaryShapeOpeningImageFilter::InputImagePixelType
typename InputImageType::PixelType InputImagePixelType
Definition: itkBinaryShapeOpeningImageFilter.h:64
itkLabelMapToBinaryImageFilter.h
itk::ShapeOpeningLabelMapFilter
Remove objects according to the value of their shape attribute.
Definition: itkShapeOpeningLabelMapFilter.h:49
itkBinaryImageToLabelMapFilter.h
itk::BinaryShapeOpeningImageFilter::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkBinaryShapeOpeningImageFilter.h:61
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::BinaryShapeOpeningImageFilter::OutputImageType
TInputImage OutputImageType
Definition: itkBinaryShapeOpeningImageFilter.h:60
itk::ShapeLabelObject
A Label object to store the common attributes related to the shape of the object.
Definition: itkShapeLabelObject.h:43
itk::Concept::Convertible
Definition: itkConceptChecking.h:217
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:88
itk::Concept::EqualityComparable
Definition: itkConceptChecking.h:307
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:86
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293