ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkBinaryReconstructionLabelMapFilter.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 itkBinaryReconstructionLabelMapFilter_h
19 #define itkBinaryReconstructionLabelMapFilter_h
20 
23 
24 namespace itk {
43 template<typename TImage, typename TMarkerImage, typename TAttributeAccessor=
44  typename Functor::AttributeLabelObjectAccessor< typename TImage::LabelObjectType > >
45 class ITK_TEMPLATE_EXPORT BinaryReconstructionLabelMapFilter :
46  public InPlaceLabelMapFilter<TImage>
47 {
48 public:
49  ITK_DISALLOW_COPY_AND_ASSIGN(BinaryReconstructionLabelMapFilter);
50 
56 
58  using ImageType = TImage;
59  using ImagePointer = typename ImageType::Pointer;
60  using ImageConstPointer = typename ImageType::ConstPointer;
61  using PixelType = typename ImageType::PixelType;
62  using IndexType = typename ImageType::IndexType;
63  using LabelObjectType = typename ImageType::LabelObjectType;
64 
65  using MarkerImageType = TMarkerImage;
66  using MarkerImagePointer = typename MarkerImageType::Pointer;
67  using MarkerImageConstPointer = typename MarkerImageType::ConstPointer;
68  using MarkerImagePixelType = typename MarkerImageType::PixelType;
69 
70  using AttributeAccessorType = TAttributeAccessor;
71 
73  static constexpr unsigned int ImageDimension = TImage::ImageDimension;
74 
76  itkNewMacro(Self);
77 
81 
82 #ifdef ITK_USE_CONCEPT_CHECKING
83  // Begin concept checking
84 /* itkConceptMacro(InputEqualityComparableCheck,
85  (Concept::EqualityComparable<PixelType>));
86  itkConceptMacro(IntConvertibleToInputCheck,
87  (Concept::Convertible<int, PixelType>));
88  itkConceptMacro(InputOStreamWritableCheck,
89  (Concept::OStreamWritable<PixelType>));*/
90  // End concept checking
91 #endif
92 
94  void SetMarkerImage(TMarkerImage *input)
95  {
96  // Process object is not const-correct so the const casting is required.
97  this->SetNthInput( 1, const_cast<TMarkerImage *>(input) );
98  }
99 
102  {
103  return static_cast<MarkerImageType*>(const_cast<DataObject *>(this->ProcessObject::GetInput(1)));
104  }
105 
107  void SetInput1(TImage *input)
108  {
109  this->SetInput( input );
110  }
111 
113  void SetInput2(TMarkerImage *input)
114  {
115  this->SetMarkerImage( input );
116  }
117 
122  itkSetMacro(ForegroundValue, MarkerImagePixelType);
123  itkGetConstMacro(ForegroundValue, MarkerImagePixelType);
125 
126 protected:
128  ~BinaryReconstructionLabelMapFilter() override = default;
129 
130  void ThreadedProcessLabelObject( LabelObjectType * labelObject ) override;
131 
132  void PrintSelf(std::ostream& os, Indent indent) const override;
133 
134 private:
136 
137 }; // end of class
138 
139 } // end namespace itk
140 
141 #ifndef ITK_MANUAL_INSTANTIATION
142 #include "itkBinaryReconstructionLabelMapFilter.hxx"
143 #endif
144 
145 #endif
Light weight base class for most itk classes.
Mark the objects at least partially at the same position as the objects in a binary image...
typename MarkerImageType::ConstPointer MarkerImageConstPointer
Base class for filters that takes an image as input and overwrites that image as the output...
DataObject * GetInput(const DataObjectIdentifierType &key)
Return an input.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for all data objects in ITK.