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

itkThresholdMaximumConnectedComponentsImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002   
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkThresholdMaximumConnectedComponentsImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2006/05/24 12:44:48 $
00007   Version:   $Revision: 1.1 $
00008 
00009   Copyright (c) Ken Urish 2005. All rights reserved.
00010   
00011   Portions of this code are covered under the ITK and VTK copyright.
00012   See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
00013   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00014 
00015 
00016      This software is distributed WITHOUT ANY WARRANTY; without even 
00017      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00018      PURPOSE.  See the above copyright notices for more information.
00019 =========================================================================*/
00020 
00021 #ifndef __itkThresholdMaximumConnectedComponentsImageFilter_h
00022 #define __itkThresholdMaximumConnectedComponentsImageFilter_h
00023 
00024 #include "itkInPlaceImageFilter.h"
00025 #include "itkBinaryThresholdImageFilter.h"
00026 #include "itkConnectedComponentImageFilter.h"
00027 #include "itkRelabelComponentImageFilter.h"
00028 #include "itkMinimumMaximumImageCalculator.h"
00029 #include "itkCastImageFilter.h"
00030 
00031 #include "itkConceptChecking.h"
00032 
00033 namespace itk
00034 {
00035 
00077 template <class TInputImage>
00078 class ITK_EXPORT ThresholdMaximumConnectedComponentsImageFilter : 
00079   public ImageToImageFilter< TInputImage , TInputImage >
00080 {
00081 public:
00083   typedef ThresholdMaximumConnectedComponentsImageFilter Self;
00084   typedef ImageToImageFilter<TInputImage,TInputImage>    Superclass;
00085   typedef SmartPointer<Self>                             Pointer;
00086   typedef SmartPointer<const Self>                       ConstPointer;
00087 
00089   itkNewMacro(Self);  
00090 
00092   itkTypeMacro( ThresholdMaximumConnectedComponentsImageFilter,
00093                 ImageToImageFilter );
00094 
00096   typedef typename TInputImage::PixelType   PixelType;
00097 
00099   itkConceptMacro(PixelTypeComparable, (Concept::Comparable<PixelType>));
00100 
00108   itkSetMacro( MinimumObjectSizeInPixels, unsigned int );
00109   itkGetMacro( MinimumObjectSizeInPixels, unsigned int );
00111 
00125   itkSetMacro( InsideValue, PixelType );
00126   itkSetMacro( OutsideValue, PixelType );
00127   itkSetMacro( UpperBoundary, PixelType );
00128   itkGetMacro( InsideValue, PixelType );
00129   itkGetMacro( OutsideValue, PixelType );
00130   itkGetMacro( UpperBoundary, PixelType );
00132 
00137   itkGetMacro( NumberOfObjects, unsigned long );
00138 
00142   itkGetMacro( ThresholdValue, PixelType );
00143 
00145   typedef TInputImage                           InputImageType;
00146   typedef typename InputImageType::ConstPointer InputImagePointer;
00147   typedef typename InputImageType::RegionType   InputImageRegionType;
00148   typedef typename InputImageType::PixelType    InputImagePixelType;
00149 
00151   typedef TInputImage                          OutputImageType;
00152   typedef typename OutputImageType::Pointer    OutputImagePointer;
00153   typedef typename OutputImageType::RegionType OutputImageRegionType;
00154   typedef typename OutputImageType::PixelType  OutputImagePixelType;
00155 
00156 
00157 protected:
00158   ThresholdMaximumConnectedComponentsImageFilter();
00159   ~ThresholdMaximumConnectedComponentsImageFilter() {};
00160   void PrintSelf(std::ostream& os, Indent indent) const;
00161 
00164   void GenerateData(void);
00165 
00170   unsigned long int ComputeConnectedComponents(void); 
00171 
00172 
00173 private:
00174  
00176   typedef unsigned int FilterPixelType;
00177 
00178   itkStaticConstMacro( ImageDimension,
00179                        unsigned int,
00180                        TInputImage::ImageDimension );
00181 
00182   typedef itk::Image< FilterPixelType, itkGetStaticConstMacro(ImageDimension) >
00183  FilterImageType; 
00184 
00185   typedef typename FilterImageType::Pointer FilterImagePointer;
00186 
00187   //purposely not implemented
00188   ThresholdMaximumConnectedComponentsImageFilter(const Self&);
00189   void operator=(const Self&); //purposely not implemented
00190    
00191   
00192   //
00193   // Binary Threshold Filter
00194   //
00195   typedef BinaryThresholdImageFilter< InputImageType, InputImageType >
00196   ThresholdFilterType;
00197 
00198   
00199   // 
00200   // Connected Components Filter  
00201   //
00202   typedef ConnectedComponentImageFilter< InputImageType, FilterImageType >
00203   ConnectedFilterType;
00204 
00205   
00206   //
00207   // Relabeled Components Filter
00208   //
00209   typedef RelabelComponentImageFilter< FilterImageType, FilterImageType >
00210   RelabelFilterType;
00211 
00212   
00213   //
00214   // Minimum maximum calculator
00215   //
00216   typedef MinimumMaximumImageCalculator< InputImageType > MinMaxCalculatorType;
00217 
00218   // 
00219   // Declare member variables for the filters of the internal pipeline.
00220   //
00221   typename ThresholdFilterType::Pointer            m_ThresholdFilter;
00222   typename ConnectedFilterType::Pointer            m_ConnectedComponent;
00223   typename RelabelFilterType::Pointer              m_LabeledComponent;
00224   typename MinMaxCalculatorType::Pointer           m_MinMaxCalculator;
00225 
00226   // Variables defined by the user
00227   unsigned int m_MinimumObjectSizeInPixels;
00228   
00229   // Binary threshold variables
00230   PixelType  m_OutsideValue;
00231   PixelType  m_InsideValue;
00232   PixelType  m_LowerBoundary;
00233   PixelType  m_UpperBoundary;
00234 
00235   // Filter variables
00236   PixelType      m_ThresholdValue;
00237   unsigned long  m_NumberOfObjects;
00238   
00239 };
00240 
00241   
00242 } // end namespace itk
00243   
00244 #ifndef ITK_MANUAL_INSTANTIATION
00245 #include "itkThresholdMaximumConnectedComponentsImageFilter.txx"
00246 #endif
00247   
00248 #endif
00249 

Generated at Sat Sep 2 21:12:03 2006 for ITK by doxygen 1.4.7 written by Dimitri van Heesch, © 1997-2000