ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkLabelSelectionLabelMapFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 itkLabelSelectionLabelMapFilter_h
19 #define itkLabelSelectionLabelMapFilter_h
20 
22 #include "itkLabelObject.h"
24 #include <set>
25 
26 
27 namespace itk {
52 template<typename TImage>
54  public AttributeSelectionLabelMapFilter<TImage, typename Functor::LabelLabelObjectAccessor< typename TImage::LabelObjectType > >
55 {
56 public:
57  ITK_DISALLOW_COPY_AND_ASSIGN(LabelSelectionLabelMapFilter);
58 
61  using Superclass =
65 
67  using ImageType = TImage;
68  using ImagePointer = typename ImageType::Pointer;
69  using ImageConstPointer = typename ImageType::ConstPointer;
70  using PixelType = typename ImageType::PixelType;
71  using IndexType = typename ImageType::IndexType;
72 
75 
77 
79  static constexpr unsigned int ImageDimension = TImage::ImageDimension;
80 
82  itkNewMacro(Self);
83 
85  itkTypeMacro(LabelSelectionLabelMapFilter,
87 
88 #ifdef ITK_USE_CONCEPT_CHECKING
89  // Begin concept checking
90 /* itkConceptMacro(InputEqualityComparableCheck,
91  (Concept::EqualityComparable<InputImagePixelType>));
92  itkConceptMacro(IntConvertibleToInputCheck,
93  (Concept::Convertible<int, InputImagePixelType>));
94  itkConceptMacro(InputOStreamWritableCheck,
95  (Concept::OStreamWritable<InputImagePixelType>));*/
96  // End concept checking
97 #endif
98 
99  const AttributeSetType & GetLabelSet() const
100  {
101  return this->GetAttributeSet();
102  }
103 
104  void SetLabelSet( const AttributeSetType & set )
105  {
106  this->SetAttributeSet( set );
107  }
108 
110  void SetLabel( const AttributeValueType & attr )
111  {
112  this->SetAttribute( attr );
113  }
114 
116  {
117  this->ClearAttributeSet();
118  }
119 
120  void AddLabel( const AttributeValueType & attr )
121  {
122  this->AddAttribute( attr );
123  }
124 
125 protected:
126  LabelSelectionLabelMapFilter() = default;
127  ~LabelSelectionLabelMapFilter() override = default;
128 }; // end of class
129 
130 } // end namespace itk
131 
132 #endif
typename Superclass::AttributeSetType AttributeSetType
Light weight base class for most itk classes.
typename AttributeAccessorType::AttributeValueType AttributeValueType
~LabelSelectionLabelMapFilter() override=default
typename std::set< AttributeValueType > AttributeSetType
typename Superclass::AttributeAccessorType AttributeAccessorType
remove the objects according to the value of their attribute
typename Superclass::AttributeValueType AttributeValueType
const AttributeSetType & GetLabelSet() const
void SetLabel(const AttributeValueType &attr)
void SetLabelSet(const AttributeSetType &set)
typename ImageType::ConstPointer ImageConstPointer
void AddLabel(const AttributeValueType &attr)
remove the objects according to the value of their attribute