ITK  4.4.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<class TImage, class TMarkerImage, class TAttributeAccessor=
44  typename Functor::AttributeLabelObjectAccessor< typename TImage::LabelObjectType > >
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 
83 /* itkConceptMacro(InputEqualityComparableCheck,
84  (Concept::EqualityComparable<PixelType>));
85  itkConceptMacro(IntConvertibleToInputCheck,
86  (Concept::Convertible<int, PixelType>));
87  itkConceptMacro(InputOStreamWritableCheck,
88  (Concept::OStreamWritable<PixelType>));*/
89 
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 
101  MarkerImageType * GetMarkerImage()
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:
129 
130  virtual void ThreadedProcessLabelObject( LabelObjectType * labelObject );
131 
132  void PrintSelf(std::ostream& os, Indent indent) const;
133 
134 private:
135  BinaryReconstructionLabelMapFilter(const Self&); //purposely not implemented
136  void operator=(const Self&); //purposely not implemented
137 
139 
140 }; // end of class
141 
142 } // end namespace itk
143 
144 #ifndef ITK_MANUAL_INSTANTIATION
145 #include "itkBinaryReconstructionLabelMapFilter.hxx"
146 #endif
147 
148 #endif
149