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

itkMorphologicalWatershedFromMarkersImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkMorphologicalWatershedFromMarkersImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-01-28 18:14:36 $
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 __itkMorphologicalWatershedFromMarkersImageFilter_h
00018 #define __itkMorphologicalWatershedFromMarkersImageFilter_h
00019 
00020 #include "itkImageToImageFilter.h"
00021 
00022 namespace itk {
00023 
00071 template<class TInputImage, class TLabelImage>
00072 class ITK_EXPORT MorphologicalWatershedFromMarkersImageFilter : 
00073     public ImageToImageFilter<TInputImage, TLabelImage>
00074 {
00075 public:
00077   typedef MorphologicalWatershedFromMarkersImageFilter Self;
00078   typedef ImageToImageFilter<TInputImage, TLabelImage> Superclass;
00079   typedef SmartPointer<Self>                           Pointer;
00080   typedef SmartPointer<const Self>                     ConstPointer;
00081 
00083   typedef TInputImage                             InputImageType;
00084   typedef TLabelImage                             LabelImageType;
00085   typedef typename InputImageType::Pointer        InputImagePointer;
00086   typedef typename InputImageType::ConstPointer   InputImageConstPointer;
00087   typedef typename InputImageType::RegionType     InputImageRegionType;
00088   typedef typename InputImageType::PixelType      InputImagePixelType;
00089   typedef typename LabelImageType::Pointer        LabelImagePointer;
00090   typedef typename LabelImageType::ConstPointer   LabelImageConstPointer;
00091   typedef typename LabelImageType::RegionType     LabelImageRegionType;
00092   typedef typename LabelImageType::PixelType      LabelImagePixelType;
00093 
00094   typedef typename LabelImageType::IndexType      IndexType;
00095   
00097   itkStaticConstMacro(ImageDimension, unsigned int,
00098                       TInputImage::ImageDimension);
00099 
00101   itkNewMacro(Self);  
00102 
00104   itkTypeMacro(MorphologicalWatershedFromMarkersImageFilter, 
00105                ImageToImageFilter);
00106 
00107 
00109   void SetMarkerImage(const TLabelImage *input)
00110     {
00111     // Process object is not const-correct so the const casting is required.
00112     this->SetNthInput( 1, const_cast<TLabelImage *>(input) );
00113     }
00114 
00116   const LabelImageType * GetMarkerImage() const
00117     {
00118     return static_cast<LabelImageType*>(
00119       const_cast<DataObject *>(this->ProcessObject::GetInput(1)));
00120     }
00121 
00123   void SetInput1(const TInputImage *input)
00124     {
00125     this->SetInput( input );
00126     }
00127 
00129   void SetInput2(const TLabelImage *input)
00130     {
00131     this->SetMarkerImage( input );
00132     }
00133 
00140   itkSetMacro(FullyConnected, bool);
00141   itkGetConstReferenceMacro(FullyConnected, bool);
00142   itkBooleanMacro(FullyConnected);
00144 
00150   itkSetMacro(MarkWatershedLine, bool);
00151   itkGetConstReferenceMacro(MarkWatershedLine, bool);
00152   itkBooleanMacro(MarkWatershedLine);
00154 
00155 protected:
00156   MorphologicalWatershedFromMarkersImageFilter();
00157   ~MorphologicalWatershedFromMarkersImageFilter() {};
00158   void PrintSelf(std::ostream& os, Indent indent) const;
00159 
00163   void GenerateInputRequestedRegion();
00164 
00168   void EnlargeOutputRequestedRegion(DataObject *itkNotUsed(output));
00169 
00171   void GenerateData();
00172 
00173 private:
00174   //purposely not implemented
00175   MorphologicalWatershedFromMarkersImageFilter(const Self&);
00176   void operator=(const Self&); //purposely not implemented
00177 
00178   bool m_FullyConnected;
00179 
00180   bool m_MarkWatershedLine;
00181 
00182 }; // end of class
00183 
00184 } // end namespace itk
00185   
00186 #ifndef ITK_MANUAL_INSTANTIATION
00187 #include "itkMorphologicalWatershedFromMarkersImageFilter.txx"
00188 #endif
00189 
00190 #endif
00191 

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