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

itkBinaryImageToShapeLabelMapFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkBinaryImageToShapeLabelMapFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-08-04 15:08:28 $
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 __itkBinaryImageToShapeLabelMapFilter_h
00018 #define __itkBinaryImageToShapeLabelMapFilter_h
00019 
00020 #include "itkImageToImageFilter.h"
00021 #include "itkShapeLabelObject.h"
00022 #include "itkLabelMap.h"
00023 #include "itkBinaryImageToLabelMapFilter.h"
00024 #include "itkShapeLabelMapFilter.h"
00025 
00026 
00027 namespace itk {
00028 
00044 template<class TInputImage, class TOutputImage=LabelMap< ShapeLabelObject< unsigned long, ::itk::GetImageDimension<TInputImage>::ImageDimension> > >
00045 class ITK_EXPORT BinaryImageToShapeLabelMapFilter : 
00046     public ImageToImageFilter<TInputImage, TOutputImage>
00047 {
00048 public:
00050   typedef BinaryImageToShapeLabelMapFilter              Self;
00051   typedef ImageToImageFilter<TInputImage, TOutputImage> Superclass;
00052   typedef SmartPointer<Self>                            Pointer;
00053   typedef SmartPointer<const Self>                      ConstPointer;
00054 
00056   typedef TInputImage                              InputImageType;
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 
00062   typedef TOutputImage                              OutputImageType;
00063   typedef typename OutputImageType::Pointer         OutputImagePointer;
00064   typedef typename OutputImageType::ConstPointer    OutputImageConstPointer;
00065   typedef typename OutputImageType::RegionType      OutputImageRegionType;
00066   typedef typename OutputImageType::PixelType       OutputImagePixelType;
00067   typedef typename OutputImageType::LabelObjectType LabelObjectType;
00068   
00070   itkStaticConstMacro( InputImageDimension, unsigned int, TInputImage::ImageDimension );
00071   itkStaticConstMacro( OutputImageDimension, unsigned int, TInputImage::ImageDimension );
00072   itkStaticConstMacro( ImageDimension, unsigned int, TInputImage::ImageDimension );
00074 
00075   typedef BinaryImageToLabelMapFilter< InputImageType, OutputImageType > LabelizerType;
00076   typedef Image< typename OutputImageType::PixelType, itkGetStaticConstMacro(OutputImageDimension)> 
00077                                                                          ShapeLabelFilterOutput;
00078   typedef ShapeLabelMapFilter< TOutputImage, ShapeLabelFilterOutput >    LabelObjectValuatorType;
00079 
00081   itkNewMacro( Self );
00082 
00084   itkTypeMacro( BinaryImageToShapeLabelMapFilter, ImageToImageFilter );
00085 
00091   itkSetMacro( FullyConnected, bool );
00092   itkGetConstReferenceMacro( FullyConnected, bool );
00093   itkBooleanMacro( FullyConnected );
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( OutputBackgroundValue, OutputImagePixelType );
00113   itkGetConstMacro( OutputBackgroundValue, OutputImagePixelType );
00115 
00120   itkSetMacro( InputForegroundValue, InputImagePixelType );
00121   itkGetConstMacro( InputForegroundValue, InputImagePixelType );
00123 
00128   itkSetMacro( ComputeFeretDiameter, bool );
00129   itkGetConstReferenceMacro( ComputeFeretDiameter, bool );
00130   itkBooleanMacro( ComputeFeretDiameter );
00132 
00137   itkSetMacro( ComputePerimeter, bool );
00138   itkGetConstReferenceMacro( ComputePerimeter, bool );
00139   itkBooleanMacro( ComputePerimeter );
00141 
00142 
00143 protected:
00144   BinaryImageToShapeLabelMapFilter();
00145   ~BinaryImageToShapeLabelMapFilter() {};
00146   void PrintSelf( std::ostream& os, Indent indent ) const;
00147 
00150   void GenerateInputRequestedRegion();
00151 
00153   void EnlargeOutputRequestedRegion( DataObject *itkNotUsed( output ) );
00154 
00157   void GenerateData();
00158 
00159 
00160 private:
00161   BinaryImageToShapeLabelMapFilter(const Self&); //purposely not implemented
00162   void operator=(const Self&); //purposely not implemented
00163 
00164   bool                 m_FullyConnected;
00165   OutputImagePixelType m_OutputBackgroundValue;
00166   InputImagePixelType  m_InputForegroundValue;
00167   bool                 m_ComputeFeretDiameter;
00168   bool                 m_ComputePerimeter;
00169 
00170 }; // end of class
00171 
00172 } // end namespace itk
00173   
00174 #ifndef ITK_MANUAL_INSTANTIATION
00175 #include "itkBinaryImageToShapeLabelMapFilter.txx"
00176 #endif
00177 
00178 #endif
00179 

Generated at Mon Jul 12 2010 17:48:26 for ITK by doxygen 1.7.1 written by Dimitri van Heesch, © 1997-2000