00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
#ifndef __itkObjectMorphologyImageFilter_h
00018
#define __itkObjectMorphologyImageFilter_h
00019
00020
#include "itkImageToImageFilter.h"
00021
#include "itkNeighborhoodIterator.h"
00022
#include "itkNeighborhood.h"
00023
#include "itkConstSliceIterator.h"
00024
#include "itkImageBoundaryCondition.h"
00025
#include "itkImageRegionIterator.h"
00026
00027
namespace itk {
00028
00071
template<
class TInputImage,
class TOutputImage,
class TKernel>
00072 class ITK_EXPORT ObjectMorphologyImageFilter :
00073
public ImageToImageFilter<TInputImage, TOutputImage>
00074 {
00075
public:
00077 typedef ObjectMorphologyImageFilter
Self;
00078 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00079 typedef SmartPointer<Self> Pointer;
00080 typedef SmartPointer<const Self> ConstPointer;
00081
00083
itkTypeMacro(ObjectMorphologyImageFilter,
ImageToImageFilter);
00084
00086 typedef TInputImage
InputImageType;
00087 typedef TOutputImage
OutputImageType;
00088 typedef typename TInputImage::RegionType
RegionType ;
00089 typedef typename TInputImage::SizeType
SizeType ;
00090 typedef typename TInputImage::IndexType
IndexType ;
00091 typedef typename TInputImage::PixelType
PixelType ;
00092 typedef typename Superclass::OutputImageRegionType
OutputImageRegionType;
00093
00095
itkStaticConstMacro(ImageDimension,
unsigned int,
00096 TInputImage::ImageDimension);
00097
00099
typedef ConstNeighborhoodIterator<TInputImage>
00100 InputNeighborhoodIteratorType ;
00101
00102
typedef NeighborhoodIterator<TOutputImage>
00103 OutputNeighborhoodIteratorType ;
00104
00106 typedef TKernel
KernelType;
00107
00109 typedef typename KernelType::ConstIterator
KernelIteratorType ;
00110
00112 typedef typename KernelType::SizeType
RadiusType ;
00113
00115
itkSetMacro(Kernel,
KernelType);
00116
00118
itkGetConstReferenceMacro(Kernel,
KernelType);
00119
00121
itkGetMacro(ObjectValue,
PixelType);
00122
00124
itkSetMacro(ObjectValue,
PixelType);
00125
00131
void GenerateInputRequestedRegion() ;
00132
00133
protected:
00134 ObjectMorphologyImageFilter();
00135 ~ObjectMorphologyImageFilter() {};
00136
void PrintSelf(std::ostream& os,
Indent indent)
const;
00137
00139
void ThreadedGenerateData (
const OutputImageRegionType&
00140 outputRegionForThread,
00141
int threadId) ;
00142
00145
virtual void Evaluate(OutputNeighborhoodIteratorType &nit,
00146
const KernelType &kernel)=0;
00147
00151
bool IsObjectPixelOnBoundary(
const InputNeighborhoodIteratorType &nit);
00152
00154 KernelType m_Kernel ;
00155
00157 PixelType m_ObjectValue;
00158
00159
void BeforeThreadedGenerateData();
00160
00161
private:
00162 ObjectMorphologyImageFilter(
const Self&);
00163
void operator=(
const Self&);
00164
00165 } ;
00166
00167 }
00168
00169
#ifndef ITK_MANUAL_INSTANTIATION
00170
#include "itkObjectMorphologyImageFilter.txx"
00171
#endif
00172
00173
#endif