ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkChangeRegionLabelMapFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 /*=========================================================================
00019  *
00020  *  Portions of this file are subject to the VTK Toolkit Version 3 copyright.
00021  *
00022  *  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00023  *
00024  *  For complete copyright, license and disclaimer of warranty information
00025  *  please refer to the NOTICE file at the top of the ITK source tree.
00026  *
00027  *=========================================================================*/
00028 #ifndef __itkChangeRegionLabelMapFilter_h
00029 #define __itkChangeRegionLabelMapFilter_h
00030 
00031 #include "itkInPlaceLabelMapFilter.h"
00032 
00033 namespace itk
00034 {
00055 template< class TInputImage >
00056 class ITK_EXPORT ChangeRegionLabelMapFilter:public InPlaceLabelMapFilter< TInputImage >
00057 {
00058 public:
00060   typedef ChangeRegionLabelMapFilter           Self;
00061   typedef InPlaceLabelMapFilter< TInputImage > Superclass;
00062   typedef SmartPointer< Self >                 Pointer;
00063   typedef SmartPointer< const Self >           ConstPointer;
00064 
00066   itkTypeMacro(ChangeRegionLabelMapFilter, InPlaceImageFilter);
00067 
00069   itkNewMacro(Self);
00070 
00072   typedef typename Superclass::OutputImageType       OutputImageType;
00073   typedef typename Superclass::OutputImagePointer    OutputImagePointer;
00074   typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00075   typedef typename Superclass::OutputImagePixelType  OutputImagePixelType;
00076 
00078   typedef TInputImage                              InputImageType;
00079   typedef typename InputImageType::Pointer         InputImagePointer;
00080   typedef typename InputImageType::ConstPointer    InputImageConstPointer;
00081   typedef typename InputImageType::RegionType      InputImageRegionType;
00082   typedef typename InputImageType::PixelType       InputImagePixelType;
00083   typedef typename InputImageType::LabelObjectType LabelObjectType;
00084 
00085   typedef typename InputImageType::PixelType      PixelType;
00086   typedef typename InputImageType::IndexType      IndexType;
00087   typedef typename InputImageType::IndexValueType IndexValueType;
00088   typedef typename InputImageType::SizeType       SizeType;
00089   typedef typename InputImageType::RegionType     RegionType;
00090 
00091   typedef TInputImage TOutputImage;
00092 
00094   itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
00095   itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
00096   itkStaticConstMacro(ImageDimension, unsigned int, TOutputImage::ImageDimension);
00098 
00100   itkSetMacro(Region, OutputImageRegionType);
00101   itkGetConstReferenceMacro(Region, OutputImageRegionType);
00102 protected:
00103   ChangeRegionLabelMapFilter() {}
00104   ~ChangeRegionLabelMapFilter() {}
00106 
00107   virtual void PrintSelf(std::ostream & os, Indent indent) const;
00108 
00109   virtual void ThreadedProcessLabelObject(LabelObjectType *labelObject);
00110 
00111   void GenerateInputRequestedRegion();
00112 
00113   void EnlargeOutputRequestedRegion( DataObject *itkNotUsed(output) );
00114 
00115   virtual void GenerateOutputInformation();
00116 
00117   void GenerateData();
00118 
00119 private:
00120   ChangeRegionLabelMapFilter(const Self &); //purposely not implemented
00121   void operator=(const Self &);             //purposely not implemented
00122 
00123   OutputImageRegionType m_Region;
00124 };
00125 } // end namespace itk
00126 
00127 #ifndef ITK_MANUAL_INSTANTIATION
00128 #include "itkChangeRegionLabelMapFilter.hxx"
00129 #endif
00130 
00131 #endif
00132