Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkShapeRelabelImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkShapeRelabelImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-08-08 01:21:23 $
00007   Version:   $Revision: 1.4 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkShapeRelabelImageFilter_h
00018 #define __itkShapeRelabelImageFilter_h
00019 
00020 #include "itkImageToImageFilter.h"
00021 #include "itkShapeLabelObject.h"
00022 #include "itkLabelMap.h"
00023 #include "itkLabelImageToLabelMapFilter.h"
00024 #include "itkShapeLabelMapFilter.h"
00025 #include "itkShapeRelabelLabelMapFilter.h"
00026 #include "itkLabelMapToLabelImageFilter.h"
00027 
00028 
00029 namespace itk {
00030 
00046 template<class TInputImage>
00047 class ITK_EXPORT ShapeRelabelImageFilter : 
00048     public ImageToImageFilter<TInputImage, TInputImage>
00049 {
00050 public:
00052   typedef ShapeRelabelImageFilter                      Self;
00053   typedef ImageToImageFilter<TInputImage, TInputImage> Superclass;
00054   typedef SmartPointer<Self>                           Pointer;
00055   typedef SmartPointer<const Self>                     ConstPointer;
00056 
00058   typedef TInputImage                              InputImageType;
00059   typedef TInputImage                              OutputImageType;
00060   typedef typename InputImageType::Pointer         InputImagePointer;
00061   typedef typename InputImageType::ConstPointer    InputImageConstPointer;
00062   typedef typename InputImageType::RegionType      InputImageRegionType;
00063   typedef typename InputImageType::PixelType       InputImagePixelType;
00064   typedef typename OutputImageType::Pointer        OutputImagePointer;
00065   typedef typename OutputImageType::ConstPointer   OutputImageConstPointer;
00066   typedef typename OutputImageType::RegionType     OutputImageRegionType;
00067   typedef typename OutputImageType::PixelType      OutputImagePixelType;
00068 
00070   itkStaticConstMacro(InputImageDimension, unsigned int,
00071                       TInputImage::ImageDimension);
00072   itkStaticConstMacro(OutputImageDimension, unsigned int,
00073                       TInputImage::ImageDimension);
00074   itkStaticConstMacro(ImageDimension, unsigned int,
00075                       TInputImage::ImageDimension);
00077 
00078   typedef ShapeLabelObject<InputImagePixelType, itkGetStaticConstMacro(ImageDimension)>                     LabelObjectType;
00079   typedef LabelMap< LabelObjectType >                                               LabelMapType;
00080   typedef LabelImageToLabelMapFilter< InputImageType, LabelMapType >                LabelizerType;
00081   typedef Image< typename OutputImageType::PixelType, itkGetStaticConstMacro(OutputImageDimension)>
00082      ShapeLabelFilterOutput;
00083   typedef ShapeLabelMapFilter< LabelMapType, ShapeLabelFilterOutput >               LabelObjectValuatorType;
00084   typedef typename LabelObjectType::AttributeType                                   AttributeType;
00085   typedef ShapeRelabelLabelMapFilter< LabelMapType >                                RelabelType;
00086   typedef LabelMapToLabelImageFilter< LabelMapType, OutputImageType >               BinarizerType;
00087 
00089   itkNewMacro(Self);  
00090 
00092   itkTypeMacro(ShapeRelabelImageFilter, 
00093                ImageToImageFilter);
00094 
00095 #ifdef ITK_USE_CONCEPT_CHECKING
00096 
00097   itkConceptMacro(InputEqualityComparableCheck,
00098     (Concept::EqualityComparable<InputImagePixelType>));
00099   itkConceptMacro(IntConvertibleToInputCheck,
00100     (Concept::Convertible<int, InputImagePixelType>));
00101   itkConceptMacro(InputOStreamWritableCheck,
00102     (Concept::OStreamWritable<InputImagePixelType>));
00103 
00105 #endif
00106 
00111   itkSetMacro(BackgroundValue, OutputImagePixelType);
00112   itkGetConstMacro(BackgroundValue, OutputImagePixelType);
00114 
00120   itkGetConstMacro( ReverseOrdering, bool );
00121   itkSetMacro( ReverseOrdering, bool );
00122   itkBooleanMacro( ReverseOrdering );
00124 
00128   itkGetConstMacro( Attribute, AttributeType );
00129   itkSetMacro( Attribute, AttributeType );
00130   void SetAttribute( const std::string & s )
00131     {
00132     this->SetAttribute( LabelObjectType::GetAttributeFromName( s ) );
00133     }
00135 
00136 
00137 protected:
00138   ShapeRelabelImageFilter();
00139   ~ShapeRelabelImageFilter() {};
00140   void PrintSelf(std::ostream& os, Indent indent) const;
00141 
00145   void GenerateInputRequestedRegion();
00146 
00148   void EnlargeOutputRequestedRegion(DataObject *itkNotUsed(output));
00149 
00152   void GenerateData();
00153 
00154 private:
00155   ShapeRelabelImageFilter(const Self&); //purposely not implemented
00156   void operator=(const Self&); //purposely not implemented
00157 
00158   OutputImagePixelType m_BackgroundValue;
00159   bool                 m_ReverseOrdering;
00160   AttributeType        m_Attribute;
00161 }; // end of class
00162 
00163 } // end namespace itk
00164   
00165 #ifndef ITK_MANUAL_INSTANTIATION
00166 #include "itkShapeRelabelImageFilter.txx"
00167 #endif
00168 
00169 #endif
00170 

Generated at Tue Sep 15 04:56:26 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000