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

itkLabelShapeOpeningImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkLabelShapeOpeningImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-08-08 01:21:23 $
00007   Version:   $Revision: 1.3 $
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 __itkLabelShapeOpeningImageFilter_h
00018 #define __itkLabelShapeOpeningImageFilter_h
00019 
00020 #include "itkImageToImageFilter.h"
00021 #include "itkShapeLabelObject.h"
00022 #include "itkLabelMap.h"
00023 #include "itkLabelImageToLabelMapFilter.h"
00024 #include "itkShapeLabelMapFilter.h"
00025 #include "itkShapeOpeningLabelMapFilter.h"
00026 #include "itkLabelMapToLabelImageFilter.h"
00027 
00028 
00029 namespace itk {
00030 
00047 template<class TInputImage>
00048 class ITK_EXPORT LabelShapeOpeningImageFilter : 
00049     public ImageToImageFilter<TInputImage, TInputImage>
00050 {
00051 public:
00053   typedef LabelShapeOpeningImageFilter                 Self;
00054   typedef ImageToImageFilter<TInputImage, TInputImage> Superclass;
00055   typedef SmartPointer<Self>                           Pointer;
00056   typedef SmartPointer<const Self>                     ConstPointer;
00057 
00059   typedef TInputImage                              InputImageType;
00060   typedef TInputImage                              OutputImageType;
00061   typedef typename InputImageType::Pointer         InputImagePointer;
00062   typedef typename InputImageType::ConstPointer    InputImageConstPointer;
00063   typedef typename InputImageType::RegionType      InputImageRegionType;
00064   typedef typename InputImageType::PixelType       InputImagePixelType;
00065   typedef typename OutputImageType::Pointer        OutputImagePointer;
00066   typedef typename OutputImageType::ConstPointer   OutputImageConstPointer;
00067   typedef typename OutputImageType::RegionType     OutputImageRegionType;
00068   typedef typename OutputImageType::PixelType      OutputImagePixelType;
00069 
00071   itkStaticConstMacro(InputImageDimension, unsigned int,
00072                       TInputImage::ImageDimension);
00073   itkStaticConstMacro(OutputImageDimension, unsigned int,
00074                       TInputImage::ImageDimension);
00075   itkStaticConstMacro(ImageDimension, unsigned int,
00076                       TInputImage::ImageDimension);
00078 
00079   typedef ShapeLabelObject<InputImagePixelType, itkGetStaticConstMacro(ImageDimension)>                     LabelObjectType;
00080   typedef LabelMap< LabelObjectType >                                               LabelMapType;
00081   typedef LabelImageToLabelMapFilter< InputImageType, LabelMapType >                LabelizerType;
00082   typedef Image< typename OutputImageType::PixelType, itkGetStaticConstMacro(OutputImageDimension)>
00083      ShapeLabelFilterOutput;
00084   typedef ShapeLabelMapFilter< LabelMapType, ShapeLabelFilterOutput >               LabelObjectValuatorType;
00085   typedef typename LabelObjectType::AttributeType                                   AttributeType;
00086   typedef ShapeOpeningLabelMapFilter< LabelMapType >                                OpeningType;
00087   typedef LabelMapToLabelImageFilter< LabelMapType, OutputImageType >               BinarizerType;
00088 
00090   itkNewMacro(Self);  
00091 
00093   itkTypeMacro(LabelShapeOpeningImageFilter, 
00094                ImageToImageFilter);
00095 
00096 #ifdef ITK_USE_CONCEPT_CHECKING
00097 
00098   itkConceptMacro(InputEqualityComparableCheck,
00099     (Concept::EqualityComparable<InputImagePixelType>));
00100   itkConceptMacro(IntConvertibleToInputCheck,
00101     (Concept::Convertible<int, InputImagePixelType>));
00102   itkConceptMacro(InputOStreamWritableCheck,
00103     (Concept::OStreamWritable<InputImagePixelType>));
00104 
00106 #endif
00107 
00112   itkSetMacro(BackgroundValue, OutputImagePixelType);
00113   itkGetConstMacro(BackgroundValue, OutputImagePixelType);
00115 
00119   itkGetConstMacro(Lambda, double);
00120   itkSetMacro(Lambda, double);
00122 
00129   itkGetConstMacro( ReverseOrdering, bool );
00130   itkSetMacro( ReverseOrdering, bool );
00131   itkBooleanMacro( ReverseOrdering );
00133 
00138   itkGetConstMacro( Attribute, AttributeType );
00139   itkSetMacro( Attribute, AttributeType );
00140   void SetAttribute( const std::string & s )
00141     {
00142     this->SetAttribute( LabelObjectType::GetAttributeFromName( s ) );
00143     }
00145 
00146 
00147 protected:
00148   LabelShapeOpeningImageFilter();
00149   ~LabelShapeOpeningImageFilter() {};
00150   void PrintSelf(std::ostream& os, Indent indent) const;
00151 
00155   void GenerateInputRequestedRegion();
00156 
00158   void EnlargeOutputRequestedRegion(DataObject *itkNotUsed(output));
00159 
00162   void GenerateData();
00163 
00164 
00165 private:
00166   LabelShapeOpeningImageFilter(const Self&); //purposely not implemented
00167   void operator=(const Self&); //purposely not implemented
00168 
00169   OutputImagePixelType m_BackgroundValue;
00170   double               m_Lambda;
00171   bool                 m_ReverseOrdering;
00172   AttributeType        m_Attribute;
00173 }; // end of class
00174 
00175 } // end namespace itk
00176   
00177 #ifndef ITK_MANUAL_INSTANTIATION
00178 #include "itkLabelShapeOpeningImageFilter.txx"
00179 #endif
00180 
00181 #endif
00182 

Generated at Tue Sep 15 03:47:57 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000