00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
#ifndef __itkWarpImageFilter_h
00018
#define __itkWarpImageFilter_h
00019
00020
#include "itkImageToImageFilter.h"
00021
#include "itkInterpolateImageFunction.h"
00022
#include "itkLinearInterpolateImageFunction.h"
00023
#include "itkPoint.h"
00024
#include "itkFixedArray.h"
00025
00026
namespace itk
00027 {
00028
00079
template <
00080
class TInputImage,
00081
class TOutputImage,
00082
class TDeformationField
00083 >
00084 class ITK_EXPORT WarpImageFilter :
00085
public ImageToImageFilter<TInputImage, TOutputImage>
00086 {
00087
public:
00089 typedef WarpImageFilter
Self;
00090 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00091 typedef SmartPointer<Self> Pointer;
00092 typedef SmartPointer<const Self> ConstPointer;
00093
00095
itkNewMacro(
Self);
00096
00098
itkTypeMacro( WarpImageFilter,
ImageToImageFilter );
00099
00101 typedef typename TOutputImage::RegionType
OutputImageRegionType;
00102
00104 typedef typename Superclass::InputImageType
InputImageType;
00105 typedef typename Superclass::InputImagePointer
InputImagePointer;
00106 typedef typename Superclass::OutputImageType
OutputImageType;
00107 typedef typename Superclass::OutputImagePointer
OutputImagePointer;
00108 typedef typename Superclass::InputImageConstPointer
InputImageConstPointer;
00109 typedef typename OutputImageType::IndexType
IndexType;
00110 typedef typename OutputImageType::SizeType
SizeType;
00111 typedef typename OutputImageType::PixelType
PixelType;
00112 typedef typename OutputImageType::SpacingType
SpacingType;
00113
00115
itkStaticConstMacro(ImageDimension,
unsigned int,
00116 TOutputImage::ImageDimension );
00117
00119 typedef TDeformationField
DeformationFieldType;
00120 typedef typename DeformationFieldType::Pointer
DeformationFieldPointer;
00121 typedef typename DeformationFieldType::PixelType
DisplacementType;
00122
00124 typedef double CoordRepType;
00125 typedef InterpolateImageFunction<InputImageType,CoordRepType> InterpolatorType;
00126 typedef typename InterpolatorType::Pointer
InterpolatorPointer;
00127
typedef LinearInterpolateImageFunction<InputImageType,CoordRepType>
00128 DefaultInterpolatorType;
00129
00131 typedef Point<CoordRepType,itkGetStaticConstMacro(ImageDimension)> PointType;
00132
00134
void SetDeformationField(
DeformationFieldType * field );
00135
00137
DeformationFieldType * GetDeformationField(
void);
00138
00140
itkSetObjectMacro( Interpolator,
InterpolatorType );
00141
00143
itkGetObjectMacro( Interpolator,
InterpolatorType );
00144
00146
itkSetMacro(OutputSpacing,
SpacingType);
00147
virtual void SetOutputSpacing(
const double values[ImageDimension] );
00148
00150
itkGetConstReferenceMacro(OutputSpacing,
SpacingType);
00151
00153
itkSetMacro(OutputOrigin,
PointType);
00154
virtual void SetOutputOrigin(
const double values[ImageDimension] );
00155
00157
itkGetConstReferenceMacro(OutputOrigin,
PointType);
00158
00160
itkSetMacro( EdgePaddingValue,
PixelType );
00161
00163
itkGetMacro( EdgePaddingValue,
PixelType );
00164
00170
virtual void GenerateOutputInformation();
00171
00178
virtual void GenerateInputRequestedRegion();
00179
00182
virtual void BeforeThreadedGenerateData();
00183
00184
protected:
00185 WarpImageFilter();
00186 ~WarpImageFilter() {};
00187
void PrintSelf(std::ostream& os,
Indent indent)
const;
00188
00192
void ThreadedGenerateData(
const OutputImageRegionType& outputRegionForThread,
00193
int threadId );
00194
00195
private:
00196 WarpImageFilter(
const Self&);
00197
void operator=(
const Self&);
00198
00199
PixelType m_EdgePaddingValue;
00200
SpacingType m_OutputSpacing;
00201
PointType m_OutputOrigin;
00202
00203
InterpolatorPointer m_Interpolator;
00204
00205 };
00206
00207 }
00208
00209
#ifndef ITK_MANUAL_INSTANTIATION
00210
#include "itkWarpImageFilter.txx"
00211
#endif
00212
00213
#endif