36 : m_ReferenceBValue(0)
38 , m_ReferenceGradientDirectionContainer(nullptr)
39 , m_OutputGradientDirectionContainer(nullptr)
50 if(m_ReferenceBValue == 0 || m_RoundingValue == 0 || m_ReferenceGradientDirectionContainer.IsNull())
51 itkExceptionMacro(
"Wrong initialization");
56 GradientDirectionContainerType::ConstIterator it = m_ReferenceGradientDirectionContainer->Begin();
57 for(; it != m_ReferenceGradientDirectionContainer->End(); ++it)
59 const double twonorm = it.Value().two_norm();
60 const double currentBValue = m_ReferenceBValue*twonorm*twonorm ;
61 const double roundedBValue = int((currentBValue + 0.5 * m_RoundingValue)/m_RoundingValue)*m_RoundingValue;
63 if (roundedBValue<m_NewBValue && roundedBValue>1)
64 m_NewBValue = roundedBValue;
67 it = m_ReferenceGradientDirectionContainer->Begin();
68 for(; it != m_ReferenceGradientDirectionContainer->End(); ++it)
70 const double twonorm = it.Value().two_norm();
71 const double currentBValue = m_ReferenceBValue*twonorm*twonorm ;
72 const double roundedBValue = int((currentBValue + 0.5 * m_RoundingValue)/m_RoundingValue)*m_RoundingValue;
76 const double f = std::sqrt(roundedBValue/m_NewBValue);
78 m_OutputGradientDirectionContainer->push_back( grad.normalize() * f );
83 m_OutputGradientDirectionContainer->push_back( grad );
void GenerateData() override
~DwiGradientLengthCorrectionFilter()
DwiGradientLengthCorrectionFilter()
vnl_vector_fixed< double, 3 > GradientDirectionType
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.