Orfeo Toolbox  3.16
itkLabelMapMaskImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkLabelMapMaskImageFilter.h,v $
5  Language: C++
6  Date: $Date: 2005/08/23 15:09:03 $
7  Version: $Revision: 1.4 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 #ifndef __itkLabelMapMaskImageFilter_h
18 #define __itkLabelMapMaskImageFilter_h
19 
20 #include "itkLabelMapFilter.h"
21 #include "itkBarrier.h"
22 
23 namespace itk {
24 
40 template<class TInputImage, class TOutputImage>
42  public LabelMapFilter<TInputImage, TOutputImage>
43 {
44 public:
51 
53  typedef TInputImage InputImageType;
54  typedef TOutputImage OutputImageType;
55  typedef typename InputImageType::Pointer InputImagePointer;
56  typedef typename InputImageType::ConstPointer InputImageConstPointer;
57  typedef typename InputImageType::RegionType InputImageRegionType;
58  typedef typename InputImageType::PixelType InputImagePixelType;
59  typedef typename InputImageType::LabelObjectType LabelObjectType;
60  typedef typename LabelObjectType::LabelType LabelType;
61 
62  typedef typename OutputImageType::Pointer OutputImagePointer;
63  typedef typename OutputImageType::ConstPointer OutputImageConstPointer;
64  typedef typename OutputImageType::RegionType OutputImageRegionType;
65  typedef typename OutputImageType::PixelType OutputImagePixelType;
66  typedef typename OutputImageType::IndexType IndexType;
67  typedef typename OutputImageType::SizeType SizeType;
68  typedef typename OutputImageType::RegionType RegionType;
69 
71  itkStaticConstMacro(InputImageDimension, unsigned int,
72  TInputImage::ImageDimension);
73  itkStaticConstMacro(OutputImageDimension, unsigned int,
74  TOutputImage::ImageDimension);
75  itkStaticConstMacro(ImageDimension, unsigned int,
76  TOutputImage::ImageDimension);
77 
79  itkNewMacro(Self);
80 
82  itkTypeMacro(LabelMapMaskImageFilter,
84 
86  void SetFeatureImage(const TOutputImage *input)
87  {
88  // Process object is not const-correct so the const casting is required.
89  this->SetNthInput( 1, const_cast<TOutputImage *>(input) );
90  }
91 
93  OutputImageType * GetFeatureImage()
94  {
95  return static_cast<OutputImageType*>(const_cast<DataObject *>(this->ProcessObject::GetInput(1)));
96  }
97 
99  void SetInput1(TInputImage *input)
100  {
101  this->SetInput( input );
102  }
103 
105  void SetInput2(TOutputImage *input)
106  {
107  this->SetFeatureImage( input );
108  }
109 
114  itkSetMacro(BackgroundValue, OutputImagePixelType);
115  itkGetConstMacro(BackgroundValue, OutputImagePixelType);
116 
120  itkSetMacro(Label, InputImagePixelType);
121  itkGetConstMacro(Label, InputImagePixelType);
122 
126  itkSetMacro(Negated, bool);
127  itkGetConstReferenceMacro(Negated, bool);
128  itkBooleanMacro(Negated);
129 
133  itkSetMacro(Crop, bool);
134  itkGetConstReferenceMacro(Crop, bool);
135  itkBooleanMacro(Crop);
136 
141  itkSetMacro(CropBorder, SizeType);
142  itkGetConstReferenceMacro(CropBorder, SizeType);
143 
144 protected:
147 
151  void GenerateInputRequestedRegion() ;
152 
154  void EnlargeOutputRequestedRegion(DataObject *itkNotUsed(output));
155 
156  virtual void GenerateOutputInformation();
157 
158  virtual void BeforeThreadedGenerateData();
159 
160  virtual void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, int threadId );
161 
162  virtual void ThreadedGenerateData( LabelObjectType * labelObject );
163 
164  void PrintSelf(std::ostream& os, Indent indent) const;
165 
166 private:
167  LabelMapMaskImageFilter(const Self&); //purposely not implemented
168  void operator=(const Self&); //purposely not implemented
169 
172  bool m_Negated;
173  bool m_Crop;
175 
177 
179 
180 } ; // end of class
181 
182 } // end namespace itk
183 
184 #ifndef ITK_MANUAL_INSTANTIATION
186 #endif
187 
188 #endif
189 
190 

Generated at Sat Feb 2 2013 23:48:45 for Orfeo Toolbox with doxygen 1.8.1.1