ITK  5.2.0
Insight Toolkit
itkLabelStatisticsOpeningImageFilter.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  * 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 itkLabelStatisticsOpeningImageFilter_h
19 #define itkLabelStatisticsOpeningImageFilter_h
20 
25 
26 namespace itk
27 {
45 template <typename TInputImage, typename TFeatureImage>
46 class ITK_TEMPLATE_EXPORT LabelStatisticsOpeningImageFilter : public ImageToImageFilter<TInputImage, TInputImage>
47 {
48 public:
49  ITK_DISALLOW_COPY_AND_MOVE(LabelStatisticsOpeningImageFilter);
50 
56 
58  using InputImageType = TInputImage;
59  using OutputImageType = TInputImage;
60  using InputImagePointer = typename InputImageType::Pointer;
61  using InputImageConstPointer = typename InputImageType::ConstPointer;
63  using InputImagePixelType = typename InputImageType::PixelType;
64  using OutputImagePointer = typename OutputImageType::Pointer;
65  using OutputImageConstPointer = typename OutputImageType::ConstPointer;
67  using OutputImagePixelType = typename OutputImageType::PixelType;
68 
69  using FeatureImageType = TFeatureImage;
70  using FeatureImagePointer = typename FeatureImageType::Pointer;
71  using FeatureImageConstPointer = typename FeatureImageType::ConstPointer;
72  using FeatureImagePixelType = typename FeatureImageType::PixelType;
73 
75  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
76  static constexpr unsigned int OutputImageDimension = TInputImage::ImageDimension;
77  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
78 
86 
88  itkNewMacro(Self);
89 
92 
93 #ifdef ITK_USE_CONCEPT_CHECKING
94  // Begin concept checking
98  // End concept checking
99 #endif
100 
105  itkSetMacro(BackgroundValue, OutputImagePixelType);
106  itkGetConstMacro(BackgroundValue, OutputImagePixelType);
108 
112  itkGetConstMacro(Lambda, double);
113  itkSetMacro(Lambda, double);
115 
122  itkGetConstMacro(ReverseOrdering, bool);
123  itkSetMacro(ReverseOrdering, bool);
124  itkBooleanMacro(ReverseOrdering);
126 
131  itkGetConstMacro(Attribute, AttributeType);
132  itkSetMacro(Attribute, AttributeType);
133  void
134  SetAttribute(const std::string & s)
135  {
136  this->SetAttribute(LabelObjectType::GetAttributeFromName(s));
137  }
139 
141  void
142  SetFeatureImage(const TFeatureImage * input)
143  {
144  // Process object is not const-correct so the const casting is required.
145  this->SetNthInput(1, const_cast<TFeatureImage *>(input));
146  }
147 
149  const FeatureImageType *
151  {
152  return static_cast<const FeatureImageType *>(this->ProcessObject::GetInput(1));
153  }
154 
156  void
157  SetInput1(const InputImageType * input)
158  {
159  this->SetInput(input);
160  }
161 
163  void
165  {
166  this->SetFeatureImage(input);
167  }
168 
169 protected:
171  ~LabelStatisticsOpeningImageFilter() override = default;
172  void
173  PrintSelf(std::ostream & os, Indent indent) const override;
174 
178  void
179  GenerateInputRequestedRegion() override;
180 
182  void
183  EnlargeOutputRequestedRegion(DataObject * itkNotUsed(output)) override;
184 
187  void
188  GenerateData() override;
189 
190 private:
192  double m_Lambda;
195 }; // end of class
196 } // end namespace itk
197 
198 #ifndef ITK_MANUAL_INSTANTIATION
199 # include "itkLabelStatisticsOpeningImageFilter.hxx"
200 #endif
201 
202 #endif
itkLabelImageToLabelMapFilter.h
itk::LabelStatisticsOpeningImageFilter::SetFeatureImage
void SetFeatureImage(const TFeatureImage *input)
Definition: itkLabelStatisticsOpeningImageFilter.h:142
itk::LabelStatisticsOpeningImageFilter::GetFeatureImage
const FeatureImageType * GetFeatureImage()
Definition: itkLabelStatisticsOpeningImageFilter.h:150
itk::Concept::OStreamWritable
Definition: itkConceptChecking.h:636
itk::StatisticsLabelMapFilter
The valuator class for the StatisticsLabelObject.
Definition: itkStatisticsLabelMapFilter.h:41
itk::LabelStatisticsOpeningImageFilter::InputImageRegionType
typename InputImageType::RegionType InputImageRegionType
Definition: itkLabelStatisticsOpeningImageFilter.h:62
itk::LabelStatisticsOpeningImageFilter::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkLabelStatisticsOpeningImageFilter.h:66
itk::LabelStatisticsOpeningImageFilter::m_ReverseOrdering
bool m_ReverseOrdering
Definition: itkLabelStatisticsOpeningImageFilter.h:193
itk::LabelStatisticsOpeningImageFilter::OutputImagePixelType
typename OutputImageType::PixelType OutputImagePixelType
Definition: itkLabelStatisticsOpeningImageFilter.h:67
itkStatisticsLabelMapFilter.h
itk::LabelImageToLabelMapFilter
convert a labeled image to a label collection image
Definition: itkLabelImageToLabelMapFilter.h:49
itk::LabelStatisticsOpeningImageFilter::AttributeType
typename LabelObjectType::AttributeType AttributeType
Definition: itkLabelStatisticsOpeningImageFilter.h:83
itk::StatisticsLabelObject
A Label object to store the common attributes related to the statistics of the object.
Definition: itkStatisticsLabelObject.h:41
itk::LabelStatisticsOpeningImageFilter::FeatureImagePointer
typename FeatureImageType::Pointer FeatureImagePointer
Definition: itkLabelStatisticsOpeningImageFilter.h:70
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::LabelStatisticsOpeningImageFilter::SetInput1
void SetInput1(const InputImageType *input)
Definition: itkLabelStatisticsOpeningImageFilter.h:157
itk::LabelStatisticsOpeningImageFilter::SetInput2
void SetInput2(const FeatureImageType *input)
Definition: itkLabelStatisticsOpeningImageFilter.h:164
itk::LabelStatisticsOpeningImageFilter::m_BackgroundValue
OutputImagePixelType m_BackgroundValue
Definition: itkLabelStatisticsOpeningImageFilter.h:191
itk::LabelStatisticsOpeningImageFilter::InputImageConstPointer
typename InputImageType::ConstPointer InputImageConstPointer
Definition: itkLabelStatisticsOpeningImageFilter.h:61
itk::LabelMap
Templated n-dimensional image to store labeled objects.
Definition: itkLabelMap.h:70
itk::LabelStatisticsOpeningImageFilter::InputImageType
TInputImage InputImageType
Definition: itkLabelStatisticsOpeningImageFilter.h:58
itk::LabelStatisticsOpeningImageFilter::OutputImageConstPointer
typename OutputImageType::ConstPointer OutputImageConstPointer
Definition: itkLabelStatisticsOpeningImageFilter.h:65
itk::LabelStatisticsOpeningImageFilter::FeatureImagePixelType
typename FeatureImageType::PixelType FeatureImagePixelType
Definition: itkLabelStatisticsOpeningImageFilter.h:72
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::LabelStatisticsOpeningImageFilter::FeatureImageType
TFeatureImage FeatureImageType
Definition: itkLabelStatisticsOpeningImageFilter.h:69
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::LabelStatisticsOpeningImageFilter::m_Lambda
double m_Lambda
Definition: itkLabelStatisticsOpeningImageFilter.h:192
itk::StatisticsOpeningLabelMapFilter
remove the objects according to the value of their statistics attribute
Definition: itkStatisticsOpeningLabelMapFilter.h:45
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::LabelStatisticsOpeningImageFilter::InputImagePixelType
typename InputImageType::PixelType InputImagePixelType
Definition: itkLabelStatisticsOpeningImageFilter.h:63
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::LabelStatisticsOpeningImageFilter::SetAttribute
void SetAttribute(const std::string &s)
Definition: itkLabelStatisticsOpeningImageFilter.h:134
itk::LabelStatisticsOpeningImageFilter::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkLabelStatisticsOpeningImageFilter.h:64
itk::Concept::Convertible
Definition: itkConceptChecking.h:216
itk::LabelMapToLabelImageFilter
Converts a LabelMap to a labeled image.
Definition: itkLabelMapToLabelImageFilter.h:46
itk::StatisticsLabelObject::AttributeType
typename Superclass::AttributeType AttributeType
Definition: itkStatisticsLabelObject.h:80
itk::LabelStatisticsOpeningImageFilter::m_Attribute
AttributeType m_Attribute
Definition: itkLabelStatisticsOpeningImageFilter.h:194
itk::LabelStatisticsOpeningImageFilter::OutputImageType
TInputImage OutputImageType
Definition: itkLabelStatisticsOpeningImageFilter.h:59
itkLabelMapToLabelImageFilter.h
itk::LabelStatisticsOpeningImageFilter::FeatureImageConstPointer
typename FeatureImageType::ConstPointer FeatureImageConstPointer
Definition: itkLabelStatisticsOpeningImageFilter.h:71
itk::LabelStatisticsOpeningImageFilter::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkLabelStatisticsOpeningImageFilter.h:60
itk::LabelStatisticsOpeningImageFilter
remove the objects according to the value of their statistics attribute
Definition: itkLabelStatisticsOpeningImageFilter.h:46
itk::ProcessObject::GetInput
DataObject * GetInput(const DataObjectIdentifierType &key)
Return an input.
itk::Concept::EqualityComparable
Definition: itkConceptChecking.h:306
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293