Slicer  5.2
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
itkDiffusionTensor3DResample.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Diffusion Applications
4  Module: $HeadURL$
5  Language: C++
6  Date: $Date$
7  Version: $Revision$
8 
9  Copyright (c) Brigham and Women's Hospital (BWH) All Rights Reserved.
10 
11  See License.txt or http://www.slicer.org/copyright/copyright.txt for details.
12 
13 ==========================================================================*/
14 #ifndef itkDiffusionTensor3DResample_h
15 #define itkDiffusionTensor3DResample_h
16 
17 #include <itkObject.h>
18 #include <itkImageToImageFilter.h>
21 #include <itkImage.h>
22 #include <itkDiffusionTensor3D.h>
23 #include <itkCastImageFilter.h>
24 #include <itkImageRegionIterator.h>
25 #include <itkPoint.h>
26 
28 
29 namespace itk
30 {
36 template <class TInput, class TOutput>
38  : public ImageToImageFilter
39  <Image<DiffusionTensor3D<TInput>, 3>,
40  Image<DiffusionTensor3D<TOutput>, 3> >
41 {
42 public:
43  typedef TInput InputDataType;
44  typedef TOutput OutputDataType;
45 
46  typedef ImageToImageFilter
47  <Image<DiffusionTensor3D<TInput>, 3>,
48  Image<DiffusionTensor3D<TOutput>, 3> > Superclass;
49 
50  typedef DiffusionTensor3D<InputDataType> InputTensorDataType;
51  typedef Image<InputTensorDataType, 3> InputImageType;
52  typedef DiffusionTensor3D<OutputDataType> OutputTensorDataType;
53  typedef Image<OutputTensorDataType, 3> OutputImageType;
55  typedef SmartPointer<Self> Pointer;
56  typedef SmartPointer<const Self> ConstPointer;
59  typedef typename InputImageType::Pointer InputImagePointerType;
60  typedef typename OutputImageType::Pointer OutputImagePointerType;
61  typedef itk::ImageRegionIterator<OutputImageType> IteratorType;
62  typedef typename OutputImageType::RegionType OutputImageRegionType;
63 // typedef typename OutputTensorDataType::RealValueType TensorRealType ;
64 
66  itkTypeMacro(DiffusionTensor3DResample, ImageToImageFilter);
67 
68  itkNewMacro( Self );
69 // /Set the transform
70  itkSetObjectMacro( Transform, TransformType );
71 // /Set the interpolation
72  itkSetObjectMacro( Interpolator, InterpolatorType );
73 
74 // /Set the output parameters (size, spacing, origin, orientation) from a reference image
76 
77 // /Get the time of the last modification of the object
78  ModifiedTimeType GetMTime() const override;
79 
80  itkSetMacro( DefaultPixelValue, OutputDataType );
81  itkGetMacro( DefaultPixelValue, OutputDataType );
82 
83  itkSetMacro( OutputOrigin, typename OutputImageType::PointType );
84  itkSetMacro( OutputSpacing, typename OutputImageType::SpacingType );
85  itkSetMacro( OutputSize, typename OutputImageType::SizeType );
86  itkSetMacro( OutputDirection, typename OutputImageType::DirectionType );
87  Matrix<double, 3, 3> GetOutputMeasurementFrame();
88 
89  itkGetMacro( OutputOrigin, typename OutputImageType::PointType );
90  itkGetMacro( OutputSpacing, typename OutputImageType::SpacingType );
91  itkGetMacro( OutputSize, typename OutputImageType::SizeType );
92  itkGetMacro( OutputDirection, typename OutputImageType::DirectionType );
93 protected:
95 
96  void DynamicThreadedGenerateData( const OutputImageRegionType & outputRegionForThread) override;
97 
98  void BeforeThreadedGenerateData() override;
99 
100  void GenerateOutputInformation() override;
101 
102  void AfterThreadedGenerateData() override;
103 
104  void GenerateInputRequestedRegion() override;
105 
106 private:
107  typename InterpolatorType::Pointer m_Interpolator;
108  typename TransformType::Pointer m_Transform;
109  typename OutputImageType::PointType m_OutputOrigin;
110  typename OutputImageType::SpacingType m_OutputSpacing;
111  typename OutputImageType::SizeType m_OutputSize;
112  typename OutputImageType::DirectionType m_OutputDirection;
113  OutputDataType m_DefaultPixelValue;
114  OutputTensorDataType m_DefaultTensor;
115 };
116 
117 } // end namespace itk
118 
119 #ifndef ITK_MANUAL_INSTANTIATION
120 #include "itkDiffusionTensor3DResample.txx"
121 #endif
122 
123 #endif
OutputImageType::RegionType OutputImageRegionType
Image< OutputTensorDataType, 3 > OutputImageType
DiffusionTensor3DInterpolateImageFunction< InputDataType > InterpolatorType
itkTypeMacro(DiffusionTensor3DResample, ImageToImageFilter)
ImageToImageFilter< Image< DiffusionTensor3D< TInput >, 3 >, Image< DiffusionTensor3D< TOutput >, 3 > > Superclass
DiffusionTensor3D< OutputDataType > OutputTensorDataType
Simplified inverse ITK transforms.
DiffusionTensor3D< InputDataType > InputTensorDataType
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) override
DiffusionTensor3DTransform< InputDataType > TransformType
void BeforeThreadedGenerateData() override
itkGetMacro(DefaultPixelValue, OutputDataType)
itkSetObjectMacro(Transform, TransformType)
void GenerateOutputInformation() override
Image< InputTensorDataType, 3 > InputImageType
itk::ImageRegionIterator< OutputImageType > IteratorType
void SetOutputParametersFromImage(InputImagePointerType Image)
ModifiedTimeType GetMTime() const override
OutputImageType::Pointer OutputImagePointerType
itkSetMacro(DefaultPixelValue, OutputDataType)
Matrix< double, 3, 3 > GetOutputMeasurementFrame()
void AfterThreadedGenerateData() override
void GenerateInputRequestedRegion() override