00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
#ifndef __itkBinaryMedianImageFilter_h
00018
#define __itkBinaryMedianImageFilter_h
00019
00020
#include "itkImageToImageFilter.h"
00021
#include "itkImage.h"
00022
00023
namespace itk
00024 {
00047
template <
class TInputImage,
class TOutputImage>
00048 class ITK_EXPORT BinaryMedianImageFilter :
00049
public ImageToImageFilter< TInputImage, TOutputImage >
00050 {
00051
public:
00053
itkStaticConstMacro(InputImageDimension,
unsigned int,
00054 TInputImage::ImageDimension);
00055
itkStaticConstMacro(OutputImageDimension,
unsigned int,
00056 TOutputImage::ImageDimension);
00057
00059
typedef TInputImage
InputImageType;
00060 typedef TOutputImage
OutputImageType;
00061
00063
typedef BinaryMedianImageFilter
Self;
00064 typedef ImageToImageFilter< InputImageType, OutputImageType> Superclass;
00065 typedef SmartPointer<Self> Pointer;
00066 typedef SmartPointer<const Self> ConstPointer;
00067
00069
itkNewMacro(
Self);
00070
00072
itkTypeMacro(BinaryMedianImageFilter,
ImageToImageFilter);
00073
00075
typedef typename InputImageType::PixelType
InputPixelType;
00076 typedef typename OutputImageType::PixelType
OutputPixelType;
00077
00078
typedef typename InputImageType::RegionType
InputImageRegionType;
00079 typedef typename OutputImageType::RegionType
OutputImageRegionType;
00080
00081
typedef typename InputImageType::SizeType
InputSizeType;
00082
00084
itkSetMacro(Radius,
InputSizeType);
00085
00087
itkGetConstReferenceMacro(Radius,
InputSizeType);
00088
00091
itkSetMacro(BackgroundValue,
InputPixelType);
00092
itkSetMacro(ForegroundValue,
InputPixelType);
00093
00096
itkGetConstReferenceMacro(BackgroundValue,
InputPixelType);
00097
itkGetConstReferenceMacro(ForegroundValue,
InputPixelType);
00098
00099
00106
virtual void GenerateInputRequestedRegion() throw(
InvalidRequestedRegionError);
00107
00108 protected:
00109 BinaryMedianImageFilter();
00110 virtual ~BinaryMedianImageFilter() {}
00111
void PrintSelf(std::ostream& os,
Indent indent)
const;
00112
00123
void ThreadedGenerateData(
const OutputImageRegionType& outputRegionForThread,
00124
int threadId );
00125
00126
private:
00127 BinaryMedianImageFilter(
const Self&);
00128
void operator=(
const Self&);
00129
00130 InputSizeType m_Radius;
00131
00132 InputPixelType m_ForegroundValue;
00133 InputPixelType m_BackgroundValue;
00134
00135 };
00136
00137 }
00138
00139
#ifndef ITK_MANUAL_INSTANTIATION
00140
#include "itkBinaryMedianImageFilter.txx"
00141
#endif
00142
00143
#endif