ITK  5.4.0
Insight Toolkit
itkBinaryStatisticsOpeningImageFilter.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 itkBinaryStatisticsOpeningImageFilter_h
19 #define itkBinaryStatisticsOpeningImageFilter_h
20 
25 
26 namespace itk
27 {
49 template <typename TInputImage, typename TFeatureImage>
50 class ITK_TEMPLATE_EXPORT BinaryStatisticsOpeningImageFilter : public ImageToImageFilter<TInputImage, TInputImage>
51 {
52 public:
53  ITK_DISALLOW_COPY_AND_MOVE(BinaryStatisticsOpeningImageFilter);
54 
60 
62  using InputImageType = TInputImage;
63  using OutputImageType = TInputImage;
67  using InputImagePixelType = typename InputImageType::PixelType;
71  using OutputImagePixelType = typename OutputImageType::PixelType;
72 
73  using FeatureImageType = TFeatureImage;
76  using FeatureImagePixelType = typename FeatureImageType::PixelType;
77 
79  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
80  static constexpr unsigned int OutputImageDimension = TInputImage::ImageDimension;
81  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
82 
84 
89  using AttributeType = typename LabelObjectType::AttributeType;
92 
94  itkNewMacro(Self);
95 
97  itkOverrideGetNameOfClassMacro(BinaryStatisticsOpeningImageFilter);
98 
105  itkSetMacro(FullyConnected, bool);
106  itkGetConstReferenceMacro(FullyConnected, bool);
107  itkBooleanMacro(FullyConnected);
110 #ifdef ITK_USE_CONCEPT_CHECKING
111  // Begin concept checking
112  itkConceptMacro(InputEqualityComparableCheck, (Concept::EqualityComparable<InputImagePixelType>));
115  // End concept checking
116 #endif
117 
122  itkSetMacro(BackgroundValue, OutputImagePixelType);
123  itkGetConstMacro(BackgroundValue, OutputImagePixelType);
130  itkSetMacro(ForegroundValue, OutputImagePixelType);
131  itkGetConstMacro(ForegroundValue, OutputImagePixelType);
137  itkGetConstMacro(Lambda, double);
138  itkSetMacro(Lambda, double);
147  itkGetConstMacro(ReverseOrdering, bool);
148  itkSetMacro(ReverseOrdering, bool);
149  itkBooleanMacro(ReverseOrdering);
156  itkGetConstMacro(Attribute, AttributeType);
157  itkSetMacro(Attribute, AttributeType);
158  void
159  SetAttribute(const std::string & s)
160  {
161  this->SetAttribute(LabelObjectType::GetAttributeFromName(s));
162  }
166  void
167  SetFeatureImage(const TFeatureImage * input)
168  {
169  // Process object is not const-correct so the const casting is required.
170  this->SetNthInput(1, const_cast<TFeatureImage *>(input));
171  }
172 
174  const FeatureImageType *
176  {
177  return static_cast<const FeatureImageType *>(this->ProcessObject::GetInput(1));
178  }
179 
181  void
182  SetInput1(const InputImageType * input)
183  {
184  this->SetInput(input);
185  }
186 
188  void
190  {
191  this->SetFeatureImage(input);
192  }
193 
194 protected:
196  ~BinaryStatisticsOpeningImageFilter() override = default;
197  void
198  PrintSelf(std::ostream & os, Indent indent) const override;
199 
202  void
203  GenerateInputRequestedRegion() override;
204 
206  void
207  EnlargeOutputRequestedRegion(DataObject * itkNotUsed(output)) override;
208 
211  void
212  GenerateData() override;
213 
214 private:
215  bool m_FullyConnected{};
216  OutputImagePixelType m_BackgroundValue{};
217  OutputImagePixelType m_ForegroundValue{};
218  double m_Lambda{};
219  bool m_ReverseOrdering{};
220  AttributeType m_Attribute{};
221 }; // end of class
222 } // end namespace itk
223 
224 #ifndef ITK_MANUAL_INSTANTIATION
225 # include "itkBinaryStatisticsOpeningImageFilter.hxx"
226 #endif
227 
228 #endif
itk::BinaryStatisticsOpeningImageFilter::OutputImagePixelType
typename OutputImageType::PixelType OutputImagePixelType
Definition: itkBinaryStatisticsOpeningImageFilter.h:71
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::Concept::OStreamWritable
Definition: itkConceptChecking.h:636
itk::BinaryStatisticsOpeningImageFilter::FeatureImagePointer
typename FeatureImageType::Pointer FeatureImagePointer
Definition: itkBinaryStatisticsOpeningImageFilter.h:74
itk::BinaryStatisticsOpeningImageFilter::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkBinaryStatisticsOpeningImageFilter.h:68
itk::BinaryStatisticsOpeningImageFilter::SetFeatureImage
void SetFeatureImage(const TFeatureImage *input)
Definition: itkBinaryStatisticsOpeningImageFilter.h:167
itk::StatisticsLabelMapFilter
The valuator class for the StatisticsLabelObject.
Definition: itkStatisticsLabelMapFilter.h:41
itk::BinaryStatisticsOpeningImageFilter::FeatureImagePixelType
typename FeatureImageType::PixelType FeatureImagePixelType
Definition: itkBinaryStatisticsOpeningImageFilter.h:76
itk::BinaryStatisticsOpeningImageFilter::FeatureImageType
TFeatureImage FeatureImageType
Definition: itkBinaryStatisticsOpeningImageFilter.h:73
itkStatisticsLabelMapFilter.h
itk::LabelMapToBinaryImageFilter
Convert a LabelMap to a binary image.
Definition: itkLabelMapToBinaryImageFilter.h:45
itk::StatisticsLabelObject
A Label object to store the common attributes related to the statistics of the object.
Definition: itkStatisticsLabelObject.h:41
itk::BinaryStatisticsOpeningImageFilter::AttributeType
typename LabelObjectType::AttributeType AttributeType
Definition: itkBinaryStatisticsOpeningImageFilter.h:89
itk::BinaryStatisticsOpeningImageFilter::InputImageType
TInputImage InputImageType
Definition: itkBinaryStatisticsOpeningImageFilter.h:62
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::BinaryStatisticsOpeningImageFilter::OutputImageType
TInputImage OutputImageType
Definition: itkBinaryStatisticsOpeningImageFilter.h:63
itk::BinaryStatisticsOpeningImageFilter::InputImagePixelType
typename InputImageType::PixelType InputImagePixelType
Definition: itkBinaryStatisticsOpeningImageFilter.h:67
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
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::BinaryStatisticsOpeningImageFilter::SetAttribute
void SetAttribute(const std::string &s)
Definition: itkBinaryStatisticsOpeningImageFilter.h:159
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::BinaryStatisticsOpeningImageFilter::InputImageRegionType
typename InputImageType::RegionType InputImageRegionType
Definition: itkBinaryStatisticsOpeningImageFilter.h:66
itk::BinaryStatisticsOpeningImageFilter::OutputImageConstPointer
typename OutputImageType::ConstPointer OutputImageConstPointer
Definition: itkBinaryStatisticsOpeningImageFilter.h:69
itk::StatisticsOpeningLabelMapFilter
remove the objects according to the value of their statistics attribute
Definition: itkStatisticsOpeningLabelMapFilter.h:45
itk::BinaryStatisticsOpeningImageFilter::SetInput2
void SetInput2(const FeatureImageType *input)
Definition: itkBinaryStatisticsOpeningImageFilter.h:189
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::BinaryStatisticsOpeningImageFilter::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkBinaryStatisticsOpeningImageFilter.h:70
itkLabelMapToBinaryImageFilter.h
itkBinaryImageToLabelMapFilter.h
itk::BinaryStatisticsOpeningImageFilter
Remove objects based on the value of their Statistics attribute.
Definition: itkBinaryStatisticsOpeningImageFilter.h:50
itk::BinaryStatisticsOpeningImageFilter::InputImageConstPointer
typename InputImageType::ConstPointer InputImageConstPointer
Definition: itkBinaryStatisticsOpeningImageFilter.h:65
itkStatisticsOpeningLabelMapFilter.h
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::BinaryStatisticsOpeningImageFilter::SetInput1
void SetInput1(const InputImageType *input)
Definition: itkBinaryStatisticsOpeningImageFilter.h:182
itk::Concept::Convertible
Definition: itkConceptChecking.h:216
itk::BinaryStatisticsOpeningImageFilter::FeatureImageConstPointer
typename FeatureImageType::ConstPointer FeatureImageConstPointer
Definition: itkBinaryStatisticsOpeningImageFilter.h:75
itk::BinaryStatisticsOpeningImageFilter::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkBinaryStatisticsOpeningImageFilter.h:64
itk::ProcessObject::GetInput
DataObject * GetInput(const DataObjectIdentifierType &key)
Return an input.
itk::Concept::EqualityComparable
Definition: itkConceptChecking.h:306
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:83
itk::BinaryStatisticsOpeningImageFilter::LabelType
SizeValueType LabelType
Definition: itkBinaryStatisticsOpeningImageFilter.h:83
itk::BinaryStatisticsOpeningImageFilter::GetFeatureImage
const FeatureImageType * GetFeatureImage()
Definition: itkBinaryStatisticsOpeningImageFilter.h:175
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293