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: 2007/01/26 15:01:47 $
00007   Version:   $Revision: 1.1 $
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 
00044 template<class TInputImage, class TLabelImage>
00045 class ITK_EXPORT MorphologicalWatershedFromMarkersImageFilter : 
00046     public ImageToImageFilter<TInputImage, TLabelImage>
00047 {
00048 public:
00050   typedef MorphologicalWatershedFromMarkersImageFilter Self;
00051   typedef ImageToImageFilter<TInputImage, TLabelImage> Superclass;
00052   typedef SmartPointer<Self>                           Pointer;
00053   typedef SmartPointer<const Self>                     ConstPointer;
00054 
00056   typedef TInputImage                             InputImageType;
00057   typedef TLabelImage                             LabelImageType;
00058   typedef typename InputImageType::Pointer        InputImagePointer;
00059   typedef typename InputImageType::ConstPointer   InputImageConstPointer;
00060   typedef typename InputImageType::RegionType     InputImageRegionType;
00061   typedef typename InputImageType::PixelType      InputImagePixelType;
00062   typedef typename LabelImageType::Pointer        LabelImagePointer;
00063   typedef typename LabelImageType::ConstPointer   LabelImageConstPointer;
00064   typedef typename LabelImageType::RegionType     LabelImageRegionType;
00065   typedef typename LabelImageType::PixelType      LabelImagePixelType;
00066 
00067   typedef typename LabelImageType::IndexType      IndexType;
00068   
00070   itkStaticConstMacro(ImageDimension, unsigned int,
00071                       TInputImage::ImageDimension);
00072 
00074   itkNewMacro(Self);  
00075 
00077   itkTypeMacro(MorphologicalWatershedFromMarkersImageFilter, 
00078                ImageToImageFilter);
00079 
00080 
00082   void SetMarkerImage(TLabelImage *input)
00083     {
00084     // Process object is not const-correct so the const casting is required.
00085     this->SetNthInput( 1, const_cast<TLabelImage *>(input) );
00086     }
00087 
00089   const LabelImageType * GetMarkerImage() const
00090     {
00091     return static_cast<LabelImageType*>(
00092       const_cast<DataObject *>(this->ProcessObject::GetInput(1)));
00093     }
00094 
00096   void SetInput1(TInputImage *input)
00097     {
00098     this->SetInput( input );
00099     }
00100 
00102   void SetInput2(TLabelImage *input)
00103     {
00104     this->SetMarkerImage( input );
00105     }
00106 
00113   itkSetMacro(FullyConnected, bool);
00114   itkGetConstReferenceMacro(FullyConnected, bool);
00115   itkBooleanMacro(FullyConnected);
00117 
00123   itkSetMacro(MarkWatershedLine, bool);
00124   itkGetConstReferenceMacro(MarkWatershedLine, bool);
00125   itkBooleanMacro(MarkWatershedLine);
00127 
00128 protected:
00129   MorphologicalWatershedFromMarkersImageFilter();
00130   ~MorphologicalWatershedFromMarkersImageFilter() {};
00131   void PrintSelf(std::ostream& os, Indent indent) const;
00132 
00139   void GenerateInputRequestedRegion();
00140 
00145   void EnlargeOutputRequestedRegion(DataObject *itkNotUsed(output));
00146 
00153   void GenerateData();
00154 
00155 private:
00156   //purposely not implemented
00157   MorphologicalWatershedFromMarkersImageFilter(const Self&);
00158   void operator=(const Self&); //purposely not implemented
00159 
00160   bool m_FullyConnected;
00161 
00162   bool m_MarkWatershedLine;
00163 
00164 }; // end of class
00165 
00166 } // end namespace itk
00167   
00168 #ifndef ITK_MANUAL_INSTANTIATION
00169 #include "itkMorphologicalWatershedFromMarkersImageFilter.txx"
00170 #endif
00171 
00172 #endif
00173 

Generated at Mon Mar 12 01:41:17 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000