18 #ifndef MITKDIFFUSIONIMAGECORRECTIONFILTER_CPP
19 #define MITKDIFFUSIONIMAGECORRECTIONFILTER_CPP
24 #include <vnl/algo/vnl_symmetric_eigensystem.h>
25 #include <vnl/vnl_inverse.h>
40 B = A * A.transpose();
44 vnl_vector< MType > eigvals;
45 vnl_matrix< MType > eigvecs;
46 vnl_symmetric_eigensystem_compute< MType > ( B, eigvecs, eigvals );
48 vnl_matrix_fixed< MType, 3, 3 > eigvecs_fixed;
49 eigvecs_fixed.set_columns(0, eigvecs );
54 vnl_vector_fixed< MType, 3 > eigvals_sqrt;
55 for(
unsigned int i=0; i<3; i++)
57 C(i,i) = std::sqrt( eigvals[i] );
69 if( m_SourceImage.IsNull() )
71 mitkThrow() <<
" No diffusion image given! ";
78 unsigned int transformed = 0;
79 for(
size_t i=0; i< directions->Size(); i++ )
83 if( directions->ElementAt(i).one_norm() <= 0.0 )
85 corrected_directions->push_back( directions->ElementAt(i) );
90 transformations.at(transformed))
91 * directions->ElementAt(i);
93 corrected_directions->push_back( corrected );
105 if( m_SourceImage.IsNull() )
107 mitkThrow() <<
" No diffusion image given! ";
112 transfVec.push_back(transformation);
114 this->CorrectDirections(transfVec);
vnl_vector_fixed< double, 3 > GradientDirectionType
std::vector< TransformMatrixType > TransformsVectorType
vnl_matrix_fixed< double, 3, 3 > TransformMatrixType
TransformMatrixType GetRotationComponent(const TransformMatrixType &)
Get the rotation component following the Finite Strain.
GradientDirectionContainerType::Pointer GradientDirectionContainerPointerType
DiffusionImageCorrectionFilter()
void CorrectDirections(const TransformsVectorType &)
Correct each gradient direction according to the given transform.
static const std::string GRADIENTCONTAINERPROPERTYNAME
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.