ITK  4.13.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:
54 
56  typedef TImage ImageType;
57  typedef typename ImageType::Pointer ImagePointer;
58  typedef typename ImageType::ConstPointer ImageConstPointer;
59  typedef typename ImageType::PixelType PixelType;
60  typedef typename ImageType::IndexType IndexType;
61  typedef typename ImageType::LabelObjectType LabelObjectType;
62 
63  typedef TMarkerImage MarkerImageType;
64  typedef typename MarkerImageType::Pointer MarkerImagePointer;
65  typedef typename MarkerImageType::ConstPointer MarkerImageConstPointer;
66  typedef typename MarkerImageType::PixelType MarkerImagePixelType;
67 
68  typedef TAttributeAccessor AttributeAccessorType;
69 
71  itkStaticConstMacro(ImageDimension, unsigned int,
72  TImage::ImageDimension);
73 
75  itkNewMacro(Self);
76 
80 
81 #ifdef ITK_USE_CONCEPT_CHECKING
82  // Begin concept checking
83 /* itkConceptMacro(InputEqualityComparableCheck,
84  (Concept::EqualityComparable<PixelType>));
85  itkConceptMacro(IntConvertibleToInputCheck,
86  (Concept::Convertible<int, PixelType>));
87  itkConceptMacro(InputOStreamWritableCheck,
88  (Concept::OStreamWritable<PixelType>));*/
89  // End concept checking
90 #endif
91 
93  void SetMarkerImage(TMarkerImage *input)
94  {
95  // Process object is not const-correct so the const casting is required.
96  this->SetNthInput( 1, const_cast<TMarkerImage *>(input) );
97  }
98 
101  {
102  return static_cast<MarkerImageType*>(const_cast<DataObject *>(this->ProcessObject::GetInput(1)));
103  }
104 
106  void SetInput1(TImage *input)
107  {
108  this->SetInput( input );
109  }
110 
112  void SetInput2(TMarkerImage *input)
113  {
114  this->SetMarkerImage( input );
115  }
116 
121  itkSetMacro(ForegroundValue, MarkerImagePixelType);
122  itkGetConstMacro(ForegroundValue, MarkerImagePixelType);
124 
125 protected:
128 
129  virtual void ThreadedProcessLabelObject( LabelObjectType * labelObject ) ITK_OVERRIDE;
130 
131  void PrintSelf(std::ostream& os, Indent indent) const ITK_OVERRIDE;
132 
133 private:
134  ITK_DISALLOW_COPY_AND_ASSIGN(BinaryReconstructionLabelMapFilter);
135 
137 
138 }; // end of class
139 
140 } // end namespace itk
141 
142 #ifndef ITK_MANUAL_INSTANTIATION
143 #include "itkBinaryReconstructionLabelMapFilter.hxx"
144 #endif
145 
146 #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...
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.