14 #ifndef itkDiffusionTensor3DAbsCorrection_h 15 #define itkDiffusionTensor3DAbsCorrection_h 17 #include "itkUnaryFunctorImageFilter.h" 19 #include <itkMatrix.h> 47 template <
class TInput,
class TOutput>
55 return *
this != other;
60 return !( *
this != other );
63 inline DiffusionTensor3D<TOutput> operator()
64 (
const DiffusionTensor3D<TInput> & A )
66 DiffusionTensor3D<TOutput> tensor;
67 Matrix<double, 3, 3> mat;
68 Matrix<double, 3, 3> matcorrect;
72 tensorDouble.ComputeEigenAnalysis( eigenValues, eigenVectors );
73 for(
int i = 0; i < 3; i++ )
75 mat[i][i] = ( eigenValues[i] < 0 ? -eigenValues[i] : eigenValues[i] );
77 eigenVectors = eigenVectors.GetTranspose();
78 matcorrect = eigenVectors * mat * eigenVectors.GetInverse();
80 for(
int i = 0; i < 6; i++ )
82 tensor[i] = ( TOutput ) tensorDouble[i];
90 template <
class TInputImage,
class TOutputImage>
93 UnaryFunctorImageFilter<TInputImage, TOutputImage,
94 Functor::DiffusionTensor3DAbs<
95 typename TInputImage::PixelType::ComponentType,
96 typename TOutputImage::PixelType::ComponentType> >
101 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> ) );
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()=default
itkTypeMacro(DiffusionTensor3DAbsCorrectionFilter, UnaryFunctorImageFilter)
void operator=(const Self &)=delete
DiffusionTensor3DAbs()=default
UnaryFunctorImageFilter< TInputImage, TOutputImage, Functor::DiffusionTensor3DAbs< typename TInputImage::PixelType, typename TOutputImage::PixelType > > Superclass
bool operator!=(const DiffusionTensor3DAbs &other) const
~DiffusionTensor3DAbsCorrectionFilter() override=default
~DiffusionTensor3DAbs()=default
bool operator==(const DiffusionTensor3DAbs &other) const