ITK  5.2.0
Insight Toolkit
itkAttributeUniqueLabelMapFilter.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 itkAttributeUniqueLabelMapFilter_h
19 #define itkAttributeUniqueLabelMapFilter_h
20 
23 
24 namespace itk
25 {
47 template <typename TImage,
48  typename TAttributeAccessor =
49  typename Functor::AttributeLabelObjectAccessor<typename TImage::LabelObjectType>>
50 class ITK_TEMPLATE_EXPORT AttributeUniqueLabelMapFilter : public InPlaceLabelMapFilter<TImage>
51 {
52 public:
53  ITK_DISALLOW_COPY_AND_ASSIGN(AttributeUniqueLabelMapFilter);
54 
60 
62  using ImageType = TImage;
63  using ImagePointer = typename ImageType::Pointer;
64  using ImageConstPointer = typename ImageType::ConstPointer;
65  using PixelType = typename ImageType::PixelType;
66  using IndexType = typename ImageType::IndexType;
67  using LabelObjectType = typename ImageType::LabelObjectType;
68 
69  using AttributeAccessorType = TAttributeAccessor;
71 
72  using LineType = typename LabelObjectType::LineType;
73 
75  static constexpr unsigned int ImageDimension = TImage::ImageDimension;
76 
78  itkNewMacro(Self);
79 
82 
83 #ifdef ITK_USE_CONCEPT_CHECKING
84  // Begin concept checking
85  /* itkConceptMacro(InputEqualityComparableCheck,
86  (Concept::EqualityComparable<InputImagePixelType>));
87  itkConceptMacro(IntConvertibleToInputCheck,
88  (Concept::Convertible<int, InputImagePixelType>));
89  itkConceptMacro(InputOStreamWritableCheck,
90  (Concept::OStreamWritable<InputImagePixelType>));*/
91  // End concept checking
92 #endif
93 
99  itkSetMacro(ReverseOrdering, bool);
100  itkGetConstReferenceMacro(ReverseOrdering, bool);
101  itkBooleanMacro(ReverseOrdering);
103 
104 protected:
106  ~AttributeUniqueLabelMapFilter() override = default;
107 
108  void
109  GenerateData() override;
110 
111  void
112  PrintSelf(std::ostream & os, Indent indent) const override;
113 
115 
116 private:
118  {
119  using LineType = typename LabelObjectType::LineType;
120 
122  {
123  this->line = l;
124  this->labelObject = lo;
125  }
128  };
129 
131  {
132  public:
133  bool
135  {
136  for (int i = ImageDimension - 1; i >= 0; i--)
137  {
138  if (lla.line.GetIndex()[i] > llb.line.GetIndex()[i])
139  {
140  return true;
141  }
142  else if (lla.line.GetIndex()[i] < llb.line.GetIndex()[i])
143  {
144  return false;
145  }
146  }
147  return false;
148  }
149  };
150 
151 }; // end of class
152 
153 } // end namespace itk
154 
155 #ifndef ITK_MANUAL_INSTANTIATION
156 # include "itkAttributeUniqueLabelMapFilter.hxx"
157 #endif
158 
159 #endif
itk::AttributeUniqueLabelMapFilter::LineOfLabelObject::LineType
typename LabelObjectType::LineType LineType
Definition: itkAttributeUniqueLabelMapFilter.h:119
itk::AttributeUniqueLabelMapFilter< TImage, Functor::LabelLabelObjectAccessor< TImage::LabelObjectType > >::LabelObjectType
typename ImageType::LabelObjectType LabelObjectType
Definition: itkAttributeUniqueLabelMapFilter.h:67
itk::InPlaceLabelMapFilter
Base class for filters that takes an image as input and overwrites that image as the output.
Definition: itkInPlaceLabelMapFilter.h:84
itk::AttributeUniqueLabelMapFilter
Make sure that the objects are not overlapping.
Definition: itkAttributeUniqueLabelMapFilter.h:50
itk::AttributeUniqueLabelMapFilter::LineOfLabelObject::LineOfLabelObject
LineOfLabelObject(const LineType l, LabelObjectType *lo)
Definition: itkAttributeUniqueLabelMapFilter.h:121
itk::AttributeUniqueLabelMapFilter< TImage, Functor::LabelLabelObjectAccessor< TImage::LabelObjectType > >::ImageConstPointer
typename ImageType::ConstPointer ImageConstPointer
Definition: itkAttributeUniqueLabelMapFilter.h:64
itk::AttributeUniqueLabelMapFilter::LineOfLabelObject
Definition: itkAttributeUniqueLabelMapFilter.h:117
itk::AttributeUniqueLabelMapFilter::m_ReverseOrdering
bool m_ReverseOrdering
Definition: itkAttributeUniqueLabelMapFilter.h:114
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::AttributeUniqueLabelMapFilter< TImage, Functor::LabelLabelObjectAccessor< TImage::LabelObjectType > >::ImageType
TImage ImageType
Definition: itkAttributeUniqueLabelMapFilter.h:62
itk::AttributeUniqueLabelMapFilter::LineOfLabelObjectComparator
Definition: itkAttributeUniqueLabelMapFilter.h:130
itk::AttributeUniqueLabelMapFilter::LineOfLabelObjectComparator::operator()
bool operator()(const LineOfLabelObject &lla, const LineOfLabelObject &llb)
Definition: itkAttributeUniqueLabelMapFilter.h:134
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::AttributeUniqueLabelMapFilter< TImage, Functor::LabelLabelObjectAccessor< TImage::LabelObjectType > >::ImagePointer
typename ImageType::Pointer ImagePointer
Definition: itkAttributeUniqueLabelMapFilter.h:63
itk::AttributeUniqueLabelMapFilter::LineOfLabelObject::labelObject
LabelObjectType * labelObject
Definition: itkAttributeUniqueLabelMapFilter.h:127
itkAttributeLabelObject.h
itk::AttributeUniqueLabelMapFilter< TImage, Functor::LabelLabelObjectAccessor< TImage::LabelObjectType > >::LineType
typename LabelObjectType::LineType LineType
Definition: itkAttributeUniqueLabelMapFilter.h:72
itkInPlaceLabelMapFilter.h
itk::AttributeUniqueLabelMapFilter< TImage, Functor::LabelLabelObjectAccessor< TImage::LabelObjectType > >::IndexType
typename ImageType::IndexType IndexType
Definition: itkAttributeUniqueLabelMapFilter.h:66
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::AttributeUniqueLabelMapFilter::LineOfLabelObject::line
LineType line
Definition: itkAttributeUniqueLabelMapFilter.h:126
itk::AttributeUniqueLabelMapFilter< TImage, Functor::LabelLabelObjectAccessor< TImage::LabelObjectType > >::PixelType
typename ImageType::PixelType PixelType
Definition: itkAttributeUniqueLabelMapFilter.h:65
itk::Functor::LabelLabelObjectAccessor
Definition: itkLabelObjectAccessors.h:38
itk::AttributeUniqueLabelMapFilter< TImage, Functor::LabelLabelObjectAccessor< TImage::LabelObjectType > >::AttributeValueType
typename AttributeAccessorType::AttributeValueType AttributeValueType
Definition: itkAttributeUniqueLabelMapFilter.h:70
itk::Functor::LabelLabelObjectAccessor::AttributeValueType
typename LabelObjectType::LabelType AttributeValueType
Definition: itkLabelObjectAccessors.h:42