ITK  6.0.0
Insight Toolkit
itkChangeLabelLabelMapFilter.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 itkChangeLabelLabelMapFilter_h
19 #define itkChangeLabelLabelMapFilter_h
20 
22 #include <map>
23 
24 namespace itk
25 {
48 template <typename TImage>
49 class ITK_TEMPLATE_EXPORT ChangeLabelLabelMapFilter : public InPlaceLabelMapFilter<TImage>
50 {
51 public:
52  ITK_DISALLOW_COPY_AND_MOVE(ChangeLabelLabelMapFilter);
53 
59 
61  using ImageType = TImage;
62  using ImagePointer = typename ImageType::Pointer;
64  using PixelType = typename ImageType::PixelType;
65  using IndexType = typename ImageType::IndexType;
66  using LabelObjectType = typename ImageType::LabelObjectType;
67 
69  static constexpr unsigned int ImageDimension = TImage::ImageDimension;
70 
72  itkNewMacro(Self);
73 
75  itkOverrideGetNameOfClassMacro(ChangeLabelLabelMapFilter);
76 
77  using ChangeMapType = typename std::map<PixelType, PixelType>;
78  using ChangeMapIterator = typename ChangeMapType::const_iterator;
79 
80 #ifdef ITK_USE_CONCEPT_CHECKING
81  // Begin concept checking
82 /* itkConceptMacro(InputEqualityComparableCheck,
83  (Concept::EqualityComparable<InputImagePixelType>));
84  itkConceptMacro(IntConvertibleToInputCheck,
85  (Concept::Convertible<int, InputImagePixelType>));
86  itkConceptMacro(InputOStreamWritableCheck,
87  (Concept::OStreamWritable<InputImagePixelType>));*/
88 // End concept checking
89 #endif
90 
93  void
94  SetChangeMap(const ChangeMapType & changeMap);
95 
96  const ChangeMapType &
97  GetChangeMap() const;
98 
99  void
100  SetChange(const PixelType & oldLabel, const PixelType & newLabel);
101 
102  void
103  ClearChangeMap();
104 
105 protected:
106  ChangeLabelLabelMapFilter() = default;
107  ~ChangeLabelLabelMapFilter() override = default;
108 
109  void
110  GenerateData() override;
111 
112  void
113  PrintSelf(std::ostream & os, Indent indent) const override;
114 
115  ChangeMapType m_MapOfLabelToBeReplaced{};
116 }; // end of class
117 } // end namespace itk
118 
119 #ifndef ITK_MANUAL_INSTANTIATION
120 # include "itkChangeLabelLabelMapFilter.hxx"
121 #endif
122 
123 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::ChangeLabelLabelMapFilter::PixelType
typename ImageType::PixelType PixelType
Definition: itkChangeLabelLabelMapFilter.h:64
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::InPlaceLabelMapFilter
Base class for filters that takes an image as input and overwrites that image as the output.
Definition: itkInPlaceLabelMapFilter.h:83
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
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:55
itk::ChangeLabelLabelMapFilter::ImageConstPointer
typename ImageType::ConstPointer ImageConstPointer
Definition: itkChangeLabelLabelMapFilter.h:63
itkInPlaceLabelMapFilter.h
itk::ChangeLabelLabelMapFilter::IndexType
typename ImageType::IndexType IndexType
Definition: itkChangeLabelLabelMapFilter.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::ChangeLabelLabelMapFilter::LabelObjectType
typename ImageType::LabelObjectType LabelObjectType
Definition: itkChangeLabelLabelMapFilter.h:66
itk::ChangeLabelLabelMapFilter::ImagePointer
typename ImageType::Pointer ImagePointer
Definition: itkChangeLabelLabelMapFilter.h:62
itk::ChangeLabelLabelMapFilter::ImageType
TImage ImageType
Definition: itkChangeLabelLabelMapFilter.h:61
itk::ChangeLabelLabelMapFilter::ChangeMapType
typename std::map< PixelType, PixelType > ChangeMapType
Definition: itkChangeLabelLabelMapFilter.h:77
itk::ChangeLabelLabelMapFilter
Replace the label Ids of selected LabelObjects with new label Ids.
Definition: itkChangeLabelLabelMapFilter.h:49
itk::ChangeLabelLabelMapFilter::ChangeMapIterator
typename ChangeMapType::const_iterator ChangeMapIterator
Definition: itkChangeLabelLabelMapFilter.h:78