ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkLabelMapToAttributeImageFilter.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 #ifndef __itkLabelMapToAttributeImageFilter_h
00019 #define __itkLabelMapToAttributeImageFilter_h
00020 
00021 #include "itkImageToImageFilter.h"
00022 #include "itkAttributeLabelObject.h"
00023 
00024 namespace itk {
00025 
00042 template<class TInputImage, class TOutputImage, class TAttributeAccessor=
00043     typename Functor::AttributeLabelObjectAccessor< typename TInputImage::LabelObjectType > >
00044 class ITK_EXPORT LabelMapToAttributeImageFilter :
00045     public ImageToImageFilter<TInputImage, TOutputImage>
00046 {
00047 public:
00049   typedef LabelMapToAttributeImageFilter                Self;
00050   typedef ImageToImageFilter<TInputImage, TOutputImage> Superclass;
00051   typedef SmartPointer<Self>                            Pointer;
00052   typedef SmartPointer<const Self>                      ConstPointer;
00053 
00055   typedef TInputImage                              InputImageType;
00056   typedef TOutputImage                             OutputImageType;
00057   typedef typename InputImageType::Pointer         InputImagePointer;
00058   typedef typename InputImageType::ConstPointer    InputImageConstPointer;
00059   typedef typename InputImageType::RegionType      InputImageRegionType;
00060   typedef typename InputImageType::PixelType       InputImagePixelType;
00061   typedef typename OutputImageType::Pointer        OutputImagePointer;
00062   typedef typename OutputImageType::ConstPointer   OutputImageConstPointer;
00063   typedef typename OutputImageType::RegionType     OutputImageRegionType;
00064   typedef typename OutputImageType::PixelType      OutputImagePixelType;
00065   typedef typename OutputImageType::IndexType      IndexType;
00066 
00067   typedef TAttributeAccessor                                  AttributeAccessorType;
00068   typedef typename AttributeAccessorType::AttributeValueType  AttributeValueType;
00069 
00071   itkStaticConstMacro(InputImageDimension, unsigned int,
00072                       TInputImage::ImageDimension);
00073   itkStaticConstMacro(OutputImageDimension, unsigned int,
00074                       TOutputImage::ImageDimension);
00076 
00078   itkNewMacro(Self);
00079 
00081   itkTypeMacro(LabelMapToAttributeImageFilter,
00082                ImageToImageFilter);
00083 
00089   itkSetMacro(BackgroundValue, OutputImagePixelType);
00090   itkGetConstMacro(BackgroundValue, OutputImagePixelType);
00092 
00093 protected:
00094   LabelMapToAttributeImageFilter();
00095   ~LabelMapToAttributeImageFilter() {};
00096   void PrintSelf(std::ostream& os, Indent indent) const;
00097 
00101   void GenerateInputRequestedRegion();
00102 
00104   void EnlargeOutputRequestedRegion(DataObject *itkNotUsed(output));
00105 
00108   void GenerateData();
00109 
00110 
00111 private:
00112   LabelMapToAttributeImageFilter(const Self&); //purposely not implemented
00113   void operator=(const Self&); //purposely not implemented
00114 
00115   OutputImagePixelType m_BackgroundValue;
00116 
00117 }; // end of class
00118 
00119 } // end namespace itk
00120 
00121 #ifndef ITK_MANUAL_INSTANTIATION
00122 #include "itkLabelMapToAttributeImageFilter.hxx"
00123 #endif
00124 
00125 #endif
00126