5 #include <itkVectorImage.h> 6 #include <itkInterpolateImageFunction.h> 8 #include <itkMatrixOffsetTransformBase.h> 13 template <
typename TImageType,
typename TInterpolatorPrecisionType=
double>
22 itkStaticConstMacro(
ImageDimension,
unsigned int,InputImageType::ImageDimension);
24 typedef itk::Image <unsigned char, itkGetStaticConstMacro(ImageDimension)>
GeometryImageType;
31 typedef itk::InterpolateImageFunction<InputImageType, TInterpolatorPrecisionType>
InterpolatorType;
35 typedef typename InterpolatorType::PointType
PointType;
49 typedef itk::
Transform <TInterpolatorPrecisionType,
55 itkSetObjectMacro(
Transform,TransformType)
58 itkSetMacro(Interpolator,InterpolatorPointer)
59 itkGetMacro(Interpolator,InterpolatorType *)
61 itkGetMacro(FiniteStrainReorientation,
bool)
62 itkSetMacro(FiniteStrainReorientation,
bool)
69 itkSetMacro(OutputSpacing, SpacingType)
70 itkGetConstReferenceMacro(OutputSpacing, SpacingType)
72 itkSetMacro(OutputOrigin, OriginPointType)
73 itkGetConstReferenceMacro(OutputOrigin, OriginPointType)
75 itkSetMacro(OutputDirection, DirectionType)
76 itkGetConstReferenceMacro(OutputDirection, DirectionType)
78 itkSetMacro(OutputLargestPossibleRegion, RegionType)
79 itkGetConstReferenceMacro(OutputLargestPossibleRegion, RegionType)
87 m_FiniteStrainReorientation =
true;
101 inline bool isZero(itk::VariableLengthVector <T> &dataVec)
103 unsigned int vectorSize = dataVec.GetNumberOfElements();
105 for (
unsigned int i = 0;i < vectorSize;++i)
115 template <
class T>
inline bool isZero(T &data)
117 itkExceptionMacro(
"Access to unauthorized method");
130 zeroPixel = itk::NumericTraits <T>::ZeroValue();
156 vnl_matrix <double> &modelOrientationMatrix);
166 bool m_FiniteStrainReorientation;
167 InterpolatorPointer m_Interpolator;
OrientedModelBaseResampleImageFilter Self
TransformType::Pointer TransformPointer
virtual unsigned int GetOutputVectorLength()
virtual void GenerateOutputInformation() ITK_OVERRIDE
virtual void GenerateInputRequestedRegion() ITK_OVERRIDE
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) ITK_OVERRIDE
InterpolatorType::PointType PointType
virtual void ReorientInterpolatedModel(const InputPixelType &interpolatedModel, vnl_matrix< double > &modelOrientationMatrix, InputPixelType &orientedModel, itk::ThreadIdType threadId)=0
Needs to be implemented in sub-classes, does the actual re-orientation of the model.
void ComputeLocalJacobianMatrix(InputIndexType &index, vnl_matrix< double > &reorientationMatrix)
virtual ~OrientedModelBaseResampleImageFilter()
void InitializeZeroPixel(itk::VariableLengthVector< T > &zeroPixel)
Utility function to initialize output images pixel to zero for vector images.
TOutputImage::RegionType RegionType
virtual void InitializeInterpolator()
Initializes the default interpolator, might change in derived classes.
itk::SmartPointer< Self > Pointer
virtual void BeforeThreadedGenerateData() ITK_OVERRIDE
void LinearThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, unsigned int threadId)
vnl_matrix< double > ComputeLinearJacobianMatrix()
TOutputImage::DirectionType DirectionType
anima::MaskedImageToImageFilter< TImageType, TImageType > Superclass
itk::InterpolateImageFunction< InputImageType, TInterpolatorPrecisionType > InterpolatorType
static const unsigned int ImageDimension
TOutputImage::Pointer OutputImagePointer
InputImageType::PixelType InputPixelType
InterpolatorType::ContinuousIndexType ContinuousIndexType
InterpolatorType::Pointer InterpolatorPointer
itkGetObjectMacro(Transform, TransformType) virtual void SetInterpolator(InterpolatorPointer _arg)
InputImageType::Pointer InputImagePointer
void NonLinearThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, unsigned int threadId)
TOutputImage::RegionType OutputImageRegionType
GeometryImageType::Pointer GeometryImagePointer
InputImageType::IndexType InputIndexType
TOutputImage::PointType OriginPointType
itk::Image< unsigned char, itkGetStaticConstMacro(ImageDimension)> GeometryImageType
InputImageType::PointType InputPointType
TOutputImage::SpacingType SpacingType
itk::SmartPointer< const Self > ConstPointer
TImageType InputImageType
virtual void ComputeRotationParametersFromReorientationMatrix(vnl_matrix< double > &reorientationMatrix, vnl_matrix< double > &modelOrientationMatrix)
void InitializeZeroPixel(T &zeroPixel)
Utility function to initialize output images pixel to zero for all images except vector images...
bool isZero(itk::VariableLengthVector< T > &dataVec)
itk::Transform< TInterpolatorPrecisionType, itkGetStaticConstMacro(ImageDimension), itkGetStaticConstMacro(ImageDimension)> TransformType