00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #error "This filter is being replaced by itkDisplacementFieldJacobianDeterminantFilter, and is slated to be removed from CVS."
00018
00019 #ifndef __itkWarpJacobianDeterminantFilter_h
00020 #define __itkWarpJacobianDeterminantFilter_h
00021
00022 #include "itkConstNeighborhoodIterator.h"
00023 #include "itkNeighborhoodIterator.h"
00024 #include "itkImageToImageFilter.h"
00025 #include "itkImage.h"
00026 #include "itkVector.h"
00027
00028 namespace itk
00029 {
00094 template < typename TInputImage,
00095 typename TOutputImage = Image <
00096 float,::itk::GetImageDimension<TInputImage>::ImageDimension >
00097 >
00098 class ITK_EXPORT WarpJacobianDeterminantFilter :
00099 public ImageToImageFilter< TInputImage, TOutputImage >
00100 {
00101 public:
00103 typedef WarpJacobianDeterminantFilter Self;
00104 typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
00105 typedef SmartPointer<Self> Pointer;
00106 typedef SmartPointer<const Self> ConstPointer;
00107
00109 itkNewMacro(Self);
00110
00112 itkTypeMacro(WarpJacobianDeterminantFilter, ImageToImageFilter);
00113
00116 typedef typename TOutputImage::PixelType OutputPixelType;
00117 typedef typename TInputImage::PixelType InputPixelType;
00118
00120 typedef TInputImage InputImageType;
00121 typedef TOutputImage OutputImageType;
00122 typedef typename InputImageType::Pointer InputImagePointer;
00123 typedef typename OutputImageType::Pointer OutputImagePointer;
00124
00126 itkStaticConstMacro(ImageDimension, unsigned int,
00127 TOutputImage::ImageDimension);
00128
00130 itkStaticConstMacro(VectorDimension, unsigned int,
00131 InputPixelType::Dimension);
00132
00136 void SetUseImageSpacingOn()
00137 {
00138 this->SetUseImageSpacing(true);
00139 }
00140
00144 void SetUseImageSpacingOff()
00145 {
00146 this->SetUseImageSpacing(false);
00147 }
00148
00151 void SetUseImageSpacing(bool);
00152 itkGetMacro(UseImageSpacing, bool);
00154
00157 void SetDerivativeWeights( double data[] );
00158 itkGetVectorMacro(DerivativeWeights, const double, itk::GetImageDimension<TInputImage>::ImageDimension);
00160
00161 protected:
00162 WarpJacobianDeterminantFilter();
00163 virtual ~WarpJacobianDeterminantFilter() {}
00164
00167 typedef ConstNeighborhoodIterator<InputImageType> ConstNeighborhoodIteratorType;
00168 typedef typename ConstNeighborhoodIteratorType::RadiusType RadiusType;
00169
00171 typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00172
00181 virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
00182
00183
00187 void BeforeThreadedGenerateData ();
00188
00201 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00202 int threadId );
00203
00204 void PrintSelf(std::ostream& os, Indent indent) const;
00205
00207 itkGetConstReferenceMacro( NeighborhoodRadius, RadiusType );
00208 itkSetMacro( NeighborhoodRadius, RadiusType );
00210
00211 OutputPixelType EvaluateAtNeighborhood
00212 (ConstNeighborhoodIteratorType &it) const;
00213
00215 double m_DerivativeWeights[itk::GetImageDimension<TInputImage>::ImageDimension];
00216
00217 private:
00218 WarpJacobianDeterminantFilter(const Self&);
00219 void operator=(const Self&);
00220
00221 RadiusType m_NeighborhoodRadius;
00222 bool m_UseImageSpacing;
00223 int m_RequestedNumberOfThreads;
00224
00225 };
00226
00227 }
00228
00229 #ifndef ITK_MANUAL_INSTANTIATION
00230 #include "itkWarpJacobianDeterminantFilter.txx"
00231 #endif
00232
00233 #endif
00234