00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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
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
00157 MorphologicalWatershedFromMarkersImageFilter(const Self&);
00158 void operator=(const Self&);
00159
00160 bool m_FullyConnected;
00161
00162 bool m_MarkWatershedLine;
00163
00164 };
00165
00166 }
00167
00168 #ifndef ITK_MANUAL_INSTANTIATION
00169 #include "itkMorphologicalWatershedFromMarkersImageFilter.txx"
00170 #endif
00171
00172 #endif
00173