Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __itkInPlaceLabelMapFilter_h
00021 #define __itkInPlaceLabelMapFilter_h
00022
00023 #include "itkLabelMapFilter.h"
00024
00025 namespace itk
00026 {
00027
00066 template <class TInputImage>
00067 class ITK_EXPORT InPlaceLabelMapFilter : public LabelMapFilter<TInputImage, TInputImage>
00068 {
00069 public:
00071 typedef InPlaceLabelMapFilter Self;
00072 typedef LabelMapFilter<TInputImage, TInputImage> Superclass;
00073 typedef SmartPointer<Self> Pointer;
00074 typedef SmartPointer<const Self> ConstPointer;
00075
00076
00078 itkTypeMacro(InPlaceLabelMapFilter, LabelMapFilter);
00079
00081 itkNewMacro(Self);
00082
00084 typedef typename Superclass::OutputImageType OutputImageType;
00085 typedef typename Superclass::OutputImagePointer OutputImagePointer;
00086 typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00087 typedef typename Superclass::OutputImagePixelType OutputImagePixelType;
00088
00090 typedef TInputImage InputImageType;
00091 typedef typename InputImageType::Pointer InputImagePointer;
00092 typedef typename InputImageType::ConstPointer InputImageConstPointer;
00093 typedef typename InputImageType::RegionType InputImageRegionType;
00094 typedef typename InputImageType::PixelType InputImagePixelType;
00095 typedef typename InputImageType::LabelObjectType LabelObjectType;
00096
00097 typedef typename InputImageType::PixelType PixelType;
00098 typedef typename InputImageType::IndexType IndexType;
00099 typedef typename InputImageType::RegionType RegionType;
00100
00101 typedef TInputImage TOutputImage;
00102
00104 itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
00105 itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
00107
00110 itkSetMacro(InPlace, bool);
00111 itkGetMacro(InPlace, bool);
00112 itkBooleanMacro(InPlace);
00114
00121 bool CanRunInPlace() const
00122 {
00123 return (typeid(TInputImage) == typeid(TOutputImage));
00124 };
00126
00127 protected:
00128 InPlaceLabelMapFilter();
00129 ~InPlaceLabelMapFilter();
00130
00131 virtual void PrintSelf(std::ostream& os, Indent indent) const;
00132
00145 virtual void AllocateOutputs();
00146
00156 virtual void ReleaseInputs();
00157
00158
00163 virtual InputImageType * GetLabelMap()
00164 {
00165 return this->GetOutput();
00166 }
00167
00168 typedef typename Superclass::LabelObjectContainerType LabelObjectContainerType;
00169 typedef typename Superclass::LabelObjectContainerConstIterator LabelObjectContainerConstIterator;
00170
00171 private:
00172 InPlaceLabelMapFilter(const Self&);
00173 void operator=(const Self&);
00174
00175 bool m_InPlace;
00176
00177 };
00178
00179 }
00180
00181 #ifndef ITK_MANUAL_INSTANTIATION
00182 #include "itkInPlaceLabelMapFilter.txx"
00183 #endif
00184
00185 #endif
00186