ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkRegionFromReferenceLabelMapFilter.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 __itkRegionFromReferenceLabelMapFilter_h
00029 #define __itkRegionFromReferenceLabelMapFilter_h
00030 
00031 #include "itkChangeRegionLabelMapFilter.h"
00032 
00033 namespace itk
00034 {
00053 template< class TInputImage >
00054 class ITK_EXPORT RegionFromReferenceLabelMapFilter:public ChangeRegionLabelMapFilter< TInputImage >
00055 {
00056 public:
00058   typedef RegionFromReferenceLabelMapFilter         Self;
00059   typedef ChangeRegionLabelMapFilter< TInputImage > Superclass;
00060   typedef SmartPointer< Self >                      Pointer;
00061   typedef SmartPointer< const Self >                ConstPointer;
00062 
00064   itkTypeMacro(RegionFromReferenceLabelMapFilter, ChangeRegionImageFilter);
00065 
00067   itkNewMacro(Self);
00068 
00070   typedef typename Superclass::OutputImageType       OutputImageType;
00071   typedef typename Superclass::OutputImagePointer    OutputImagePointer;
00072   typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00073   typedef typename Superclass::OutputImagePixelType  OutputImagePixelType;
00074 
00076   typedef TInputImage                              InputImageType;
00077   typedef typename InputImageType::Pointer         InputImagePointer;
00078   typedef typename InputImageType::ConstPointer    InputImageConstPointer;
00079   typedef typename InputImageType::RegionType      InputImageRegionType;
00080   typedef typename InputImageType::PixelType       InputImagePixelType;
00081   typedef typename InputImageType::LabelObjectType LabelObjectType;
00082 
00083   typedef typename InputImageType::PixelType  PixelType;
00084   typedef typename InputImageType::IndexType  IndexType;
00085   typedef typename InputImageType::SizeType   SizeType;
00086   typedef typename InputImageType::RegionType RegionType;
00087 
00088   typedef TInputImage TOutputImage;
00089 
00091   itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
00092   itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
00093   itkStaticConstMacro(ImageDimension, unsigned int, TOutputImage::ImageDimension);
00095 
00096   typedef ImageBase< itkGetStaticConstMacro(ImageDimension) > ReferenceImageType;
00097 
00099   void SetReferenceImage(const ReferenceImageType *image);
00100 
00101   const ReferenceImageType * GetReferenceImage() const;
00102 
00104   void SetInput1(const TInputImage *input)
00105   {
00106     this->SetInput(input);
00107   }
00108 
00110   void SetInput2(const ReferenceImageType *input)
00111   {
00112     this->SetReferenceImage(input);
00113   }
00114 
00115 protected:
00116   RegionFromReferenceLabelMapFilter()
00117   {
00118     this->SetNumberOfRequiredInputs(2);
00119   }
00120 
00121   ~RegionFromReferenceLabelMapFilter() {}
00122 
00123   virtual void GenerateOutputInformation();
00124 
00125   void PrintSelf(std::ostream & os, Indent indent) const;
00126 
00127 private:
00128   RegionFromReferenceLabelMapFilter(const Self &); //purposely not implemented
00129   void operator=(const Self &);                    //purposely not implemented
00130 };
00131 } // end namespace itk
00132 
00133 #ifndef ITK_MANUAL_INSTANTIATION
00134 #include "itkRegionFromReferenceLabelMapFilter.hxx"
00135 #endif
00136 
00137 #endif
00138