14 #ifndef itkDiffusionTensor3DAbsCorrection_h 15 #define itkDiffusionTensor3DAbsCorrection_h 17 #include "itkUnaryFunctorImageFilter.h" 18 #include "vnl/vnl_math.h" 19 #include <itkMatrix.h> 47 template <
class TInput,
class TOutput>
59 return *
this != other;
64 return !( *
this != other );
67 inline DiffusionTensor3D<TOutput> operator()
68 (
const DiffusionTensor3D<TInput> & A )
70 DiffusionTensor3D<TOutput> tensor;
71 Matrix<double, 3, 3> mat;
72 Matrix<double, 3, 3> matcorrect;
76 tensorDouble.ComputeEigenAnalysis( eigenValues, eigenVectors );
77 for(
int i = 0; i < 3; i++ )
79 mat[i][i] = ( eigenValues[i] < 0 ? -eigenValues[i] : eigenValues[i] );
81 eigenVectors = eigenVectors.GetTranspose();
82 matcorrect = eigenVectors * mat * eigenVectors.GetInverse();
84 for(
int i = 0; i < 6; i++ )
86 tensor[i] = ( TOutput ) tensorDouble[i];
94 template <
class TInputImage,
class TOutputImage>
97 UnaryFunctorImageFilter<TInputImage, TOutputImage,
98 Functor::DiffusionTensor3DAbs<
99 typename TInputImage::PixelType::ComponentType,
100 typename TOutputImage::PixelType::ComponentType> >
105 typedef UnaryFunctorImageFilter<TInputImage, TOutputImage,
117 #ifdef ITK_USE_CONCEPT_CHECKING 120 ( Concept::SameType<DiffusionTensor3D<typename TInputImage::PixelType::ComponentType>,
121 typename TInputImage::PixelType> ) );
123 ( Concept::SameType<DiffusionTensor3D<typename TOutputImage::PixelType::ComponentType>,
124 typename TOutputImage::PixelType> ) );
137 void operator=(
const Self & );
SmartPointer< Self > Pointer
SmartPointer< const Self > ConstPointer
void SetTensorFromMatrix(Matrix< C, 3, 3 > matrix)
Computes pixel-wise the absolute value of the diffusion tensor eigenvalues.
Simplified inverse ITK transforms.
* itkConceptMacro(OutputEqualityComparableCheck, *(Concept::EqualityComparable< OutputImagePixelType >))
DiffusionTensor3DAbsCorrectionFilter Self
DiffusionTensor3DAbsCorrectionFilter()
itkTypeMacro(DiffusionTensor3DAbsCorrectionFilter, UnaryFunctorImageFilter)
virtual ~DiffusionTensor3DAbsCorrectionFilter()
UnaryFunctorImageFilter< TInputImage, TOutputImage, Functor::DiffusionTensor3DAbs< typename TInputImage::PixelType, typename TOutputImage::PixelType > > Superclass
bool operator!=(const DiffusionTensor3DAbs &other) const
bool operator==(const DiffusionTensor3DAbs &other) const