00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
#ifndef __itkInterpolateImageFilter_h
00018
#define __itkInterpolateImageFilter_h
00019
00020
#include "itkImageToImageFilter.h"
00021
#include "itkImage.h"
00022
#include "itkInterpolateImageFunction.h"
00023
#include "itkLinearInterpolateImageFunction.h"
00024
00025
namespace itk
00026 {
00027
00044
template <
class TInputImage,
class TOutputImage >
00045 class ITK_EXPORT InterpolateImageFilter:
00046
public ImageToImageFilter<TInputImage, TOutputImage>
00047 {
00048
public:
00050 typedef InterpolateImageFilter
Self;
00051 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00052 typedef SmartPointer<Self> Pointer;
00053 typedef SmartPointer<const Self> ConstPointer;
00054
00056
itkNewMacro(
Self);
00057
00059
itkTypeMacro(InterpolateImageFilter,
ImageToImageFilter);
00060
00062 typedef typename Superclass::InputImageType
InputImageType;
00063 typedef typename Superclass::InputImagePointer
InputImagePointer;
00064 typedef typename Superclass::OutputImageType
OutputImageType;
00065 typedef typename Superclass::OutputImagePointer
OutputImagePointer;
00066 typedef typename Superclass::OutputImageRegionType
OutputImageRegionType;
00067
00069
itkStaticConstMacro(ImageDimension,
unsigned int,
00070 TOutputImage::ImageDimension);
00071
itkStaticConstMacro(IntermediateImageDimension,
unsigned int,
00072 TOutputImage::ImageDimension + 1);
00073
00075
typedef typename TInputImage::PixelType
InputPixelType;
00076 typedef Image<InputPixelType,itkGetStaticConstMacro(IntermediateImageDimension)> IntermediateImageType;
00077 typedef InterpolateImageFunction<IntermediateImageType> InterpolatorType;
00078
00080
void SetInput1(
const InputImageType * image)
00081 { this->SetInput( image ); }
00082
const InputImageType * GetInput1()
00083 {
return this->GetInput(); }
00084
00086
void SetInput2(
const InputImageType * image);
00087
const InputImageType * GetInput2();
00088
00091
itkSetClampMacro( Distance,
double, 0.0, 1.0 );
00092
itkGetMacro( Distance,
double );
00093
00095
itkSetObjectMacro( Interpolator, InterpolatorType )
00096
00097
00098 itkGetObjectMacro( Interpolator, InterpolatorType );
00099
00102
void BeforeThreadedGenerateData();
00103
00105
void AfterThreadedGenerateData();
00106
00107 protected:
00108 InterpolateImageFilter();
00109 ~InterpolateImageFilter() {};
00110
void PrintSelf(std::ostream& os, Indent indent)
const;
00111
00113 void ThreadedGenerateData(
const OutputImageRegionType& outputRegionForThread,
00114
int threadId );
00115
00116
private:
00117 InterpolateImageFilter(
const Self&);
00118
void operator=(
const Self&);
00119
00120
typename InterpolatorType::Pointer m_Interpolator;
00121
typename IntermediateImageType::Pointer m_IntermediateImage;
00122
double m_Distance;
00123
00124 };
00125
00126
00127 }
00128
00129
#ifndef ITK_MANUAL_INSTANTIATION
00130
#include "itkInterpolateImageFilter.txx"
00131
#endif
00132
00133
#endif