00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __itkDiscreteGaussianDerivativeImageFilter_h
00019 #define __itkDiscreteGaussianDerivativeImageFilter_h
00020
00021 #include "itkImageToImageFilter.h"
00022 #include "itkFixedArray.h"
00023 #include "itkImage.h"
00024
00025 namespace itk
00026 {
00059 template <class TInputImage, class TOutputImage >
00060 class ITK_EXPORT DiscreteGaussianDerivativeImageFilter :
00061 public ImageToImageFilter< TInputImage, TOutputImage >
00062 {
00063 public:
00065 typedef DiscreteGaussianDerivativeImageFilter Self;
00066 typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
00067 typedef SmartPointer<Self> Pointer;
00068 typedef SmartPointer<const Self> ConstPointer;
00069
00071 itkNewMacro(Self);
00072
00074 itkTypeMacro(DiscreteGaussianDerivativeImageFilter, ImageToImageFilter);
00075
00077 typedef TInputImage InputImageType;
00078 typedef TOutputImage OutputImageType;
00079
00082 typedef typename TOutputImage::PixelType OutputPixelType;
00083 typedef typename TOutputImage::InternalPixelType OutputInternalPixelType;
00084 typedef typename TInputImage::PixelType InputPixelType;
00085 typedef typename TInputImage::InternalPixelType InputInternalPixelType;
00086
00089 itkStaticConstMacro(ImageDimension, unsigned int,
00090 TOutputImage::ImageDimension);
00091
00093 typedef FixedArray<double, itkGetStaticConstMacro(ImageDimension)> ArrayType;
00094
00096 typedef FixedArray<unsigned int, itkGetStaticConstMacro(ImageDimension)> OrderArrayType;
00097
00101 itkSetMacro(Order, OrderArrayType);
00102 itkGetMacro(Order, const OrderArrayType);
00104
00110 itkSetMacro(Variance, ArrayType);
00111 itkGetMacro(Variance, const ArrayType);
00113
00117 itkSetMacro(MaximumError, ArrayType);
00118 itkGetMacro(MaximumError, const ArrayType);
00120
00123 itkGetMacro(MaximumKernelWidth, int);
00124 itkSetMacro(MaximumKernelWidth, int);
00126
00129 void SetOrder (const typename OrderArrayType::ValueType v)
00130 {
00131 m_Order.Fill(v);
00132 }
00133
00134 void SetVariance (const typename ArrayType::ValueType v)
00135 {
00136 m_Variance.Fill(v);
00137 }
00138
00139 void SetMaximumError (const typename ArrayType::ValueType v)
00140 {
00141 m_MaximumError.Fill(v);
00142 }
00143
00144 void SetOrder (const unsigned int *v)
00145 {
00146 OrderArrayType dv;
00147 for (unsigned int i = 0; i < ImageDimension; i++)
00148 {
00149 dv[i] = v[i];
00150 }
00151 this->SetOrder(dv);
00152 }
00153
00154 void SetVariance (const double *v)
00155 {
00156 ArrayType dv;
00157 for (unsigned int i = 0; i < ImageDimension; i++)
00158 {
00159 dv[i] = v[i];
00160 }
00161 this->SetVariance(dv);
00162 }
00163
00164 void SetVariance (const float *v)
00165 {
00166 ArrayType dv;
00167 for (unsigned int i = 0; i < ImageDimension; i++)
00168 {
00169 dv[i] = v[i];
00170 }
00171 this->SetVariance(dv);
00172 }
00173
00174 void SetMaximumError (const double *v)
00175 {
00176 ArrayType dv;
00177 for (unsigned int i = 0; i < ImageDimension; i++)
00178 {
00179 dv[i] = v[i];
00180 }
00181 this->SetMaximumError(dv);
00182 }
00183
00184 void SetMaximumError (const float *v)
00185 {
00186 ArrayType dv;
00187 for (unsigned int i = 0; i < ImageDimension; i++)
00188 {
00189 dv[i] = v[i];
00190 }
00191 this->SetMaximumError(dv);
00192 }
00193
00197 void SetUseImageSpacingOn() { this->SetUseImageSpacing(true); }
00198
00201 void SetUseImageSpacingOff() { this->SetUseImageSpacing(false); }
00202
00205 itkSetMacro(UseImageSpacing, bool);
00206 itkGetMacro(UseImageSpacing, bool);
00208
00215 virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
00216
00217 #ifdef ITK_USE_CONCEPT_CHECKING
00218
00219 itkConceptMacro(OutputHasNumericTraitsCheck,
00220 (Concept::HasNumericTraits<OutputPixelType>));
00221
00223 #endif
00224
00225 protected:
00226
00227 DiscreteGaussianDerivativeImageFilter()
00228 {
00229 m_Order.Fill(1);
00230 m_Variance.Fill(0.0);
00231 m_MaximumError.Fill(0.01);
00232 m_MaximumKernelWidth = 32;
00233 m_UseImageSpacing = true;
00234 }
00235 virtual ~DiscreteGaussianDerivativeImageFilter() {}
00236 void PrintSelf(std::ostream& os, Indent indent) const;
00237
00243 void GenerateData();
00244
00245 private:
00246
00247 DiscreteGaussianDerivativeImageFilter(const Self&);
00248 void operator=(const Self&);
00249
00251 OrderArrayType m_Order;
00252
00254 ArrayType m_Variance;
00255
00259 ArrayType m_MaximumError;
00260
00263 int m_MaximumKernelWidth;
00264
00266 bool m_UseImageSpacing;
00267 };
00268
00269 }
00270
00271 #ifndef ITK_MANUAL_INSTANTIATION
00272 #include "itkDiscreteGaussianDerivativeImageFilter.txx"
00273 #endif
00274
00275 #endif
00276