Orfeo Toolbox  4.0
itkLabelMapMaskImageFilter.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 __itkLabelMapMaskImageFilter_h
19 #define __itkLabelMapMaskImageFilter_h
20 
21 #include "itkLabelMapFilter.h"
22 #include "itkBarrier.h"
23 
24 namespace itk {
25 
46 template<typename TInputImage, typename TOutputImage>
48  public LabelMapFilter<TInputImage, TOutputImage>
49 {
50 public:
56 
58  typedef TInputImage InputImageType;
59  typedef TOutputImage OutputImageType;
60  typedef typename InputImageType::Pointer InputImagePointer;
61  typedef typename InputImageType::ConstPointer InputImageConstPointer;
62  typedef typename InputImageType::RegionType InputImageRegionType;
63  typedef typename InputImageType::PixelType InputImagePixelType;
64  typedef typename InputImageType::LabelObjectType LabelObjectType;
65  typedef typename LabelObjectType::LabelType LabelType;
66  typedef typename LabelObjectType::LengthType LengthType;
67 
68  typedef typename OutputImageType::Pointer OutputImagePointer;
69  typedef typename OutputImageType::ConstPointer OutputImageConstPointer;
70  typedef typename OutputImageType::RegionType OutputImageRegionType;
71  typedef typename OutputImageType::PixelType OutputImagePixelType;
72  typedef typename OutputImageType::IndexType IndexType;
73  typedef typename OutputImageType::SizeType SizeType;
74  typedef typename OutputImageType::RegionType RegionType;
75 
76 
78  itkStaticConstMacro(InputImageDimension, unsigned int,
79  TInputImage::ImageDimension);
80  itkStaticConstMacro(OutputImageDimension, unsigned int,
81  TOutputImage::ImageDimension);
82  itkStaticConstMacro(ImageDimension, unsigned int,
83  TOutputImage::ImageDimension);
84 
86  itkNewMacro(Self);
87 
89  itkTypeMacro(LabelMapMaskImageFilter,
91 
93  void SetFeatureImage(const TOutputImage *input)
94  {
95  // Process object is not const-correct so the const casting is required.
96  this->SetNthInput( 1, const_cast<TOutputImage *>(input) );
97  }
98 
101  {
102  return static_cast<OutputImageType*>(const_cast<DataObject *>(this->ProcessObject::GetInput(1)));
103  }
104 
106  void SetInput1(const TInputImage *input)
107  {
108  this->SetInput( input );
109  }
110 
112  void SetInput2(const TOutputImage *input)
113  {
114  this->SetFeatureImage( input );
115  }
116 
121  itkSetMacro(BackgroundValue, OutputImagePixelType);
122  itkGetConstMacro(BackgroundValue, OutputImagePixelType);
123 
127  itkSetMacro(Label, InputImagePixelType);
128  itkGetConstMacro(Label, InputImagePixelType);
129 
133  itkSetMacro(Negated, bool);
134  itkGetConstReferenceMacro(Negated, bool);
135  itkBooleanMacro(Negated);
136 
140  itkSetMacro(Crop, bool);
141  itkGetConstReferenceMacro(Crop, bool);
142  itkBooleanMacro(Crop);
143 
148  itkSetMacro(CropBorder, SizeType);
149  itkGetConstReferenceMacro(CropBorder, SizeType);
150 
151 protected:
154 
159 
161  void EnlargeOutputRequestedRegion(DataObject *itkNotUsed(output));
162 
163  virtual void GenerateOutputInformation();
164 
165  virtual void BeforeThreadedGenerateData();
166 
167  virtual void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, ThreadIdType threadId );
168 
169  virtual void ThreadedProcessLabelObject( LabelObjectType * labelObject );
170 
171  void PrintSelf(std::ostream& os, Indent indent) const;
172 
173 private:
174  LabelMapMaskImageFilter(const Self&); //purposely not implemented
175  void operator=(const Self&); //purposely not implemented
176 
179  bool m_Negated;
180  bool m_Crop;
182 
184 
186 
187 }; // end of class
188 
189 } // end namespace itk
190 
191 #ifndef ITK_MANUAL_INSTANTIATION
193 #endif
194 
195 #endif

Generated at Sat Mar 8 2014 15:03:17 for Orfeo Toolbox with doxygen 1.8.3.1