17 #ifndef __itkDiffusionQballReconstructionImageFilter_h_
18 #define __itkDiffusionQballReconstructionImageFilter_h_
20 #include "itkImageToImageFilter.h"
22 #include "vnl/vnl_vector_fixed.h"
23 #include "vnl/vnl_matrix.h"
24 #include "vnl/algo/vnl_svd.h"
25 #include "itkVectorContainer.h"
26 #include "itkVectorImage.h"
95 template<
class TReferenceImagePixelType,
96 class TGradientImagePixelType,
99 int NrBasisFunctionCenters = NrOdfDirections>
101 public ImageToImageFilter< Image< TReferenceImagePixelType, 3 >,
102 Image< Vector< TOdfPixelType, NrOdfDirections >, 3 > >
128 typedef ImageToImageFilter< Image< TReferenceImagePixelType, 3>,
129 Image< Vector< TOdfPixelType, NrOdfDirections >, 3 > >
133 itkFactorylessNewMacro(Self)
144 typedef Vector< TOdfPixelType, NrOdfDirections >
172 typedef vnl_matrix< TOdfPixelType >*
179 typedef VectorContainer<
unsigned int,
186 void AddGradientImage( const GradientDirectionType &, const GradientImageType *image);
195 const GradientImagesType *image);
202 itkExceptionMacro( <<
"Cannot call both methods:"
203 <<
"AddGradientImage and SetGradientImage. Please call only one of them.");
206 this->ProcessObject::SetNthInput( 0, referenceImage );
213 {
return ( static_cast< ReferenceImageType *>(this->ProcessObject::GetInput(0)) ); }
218 if( idx >= m_NumberOfGradientDirections )
220 itkExceptionMacro( <<
"Gradient direction " << idx <<
"does not exist" );
222 return m_GradientDirectionContainer->ElementAt( idx+1 );
233 vnl_vector<TOdfPixelType>
PreNormalize( vnl_vector<TOdfPixelType> vec );
249 itkSetMacro( BValue, TOdfPixelType);
253 itkGetConstReferenceMacro( BValue, TOdfPixelType);
255 #ifdef ITK_USE_CONCEPT_CHECKING
257 itkConceptMacro(ReferenceEqualityComparableCheck,
258 (Concept::EqualityComparable<ReferencePixelType>));
259 itkConceptMacro(TensorEqualityComparableCheck,
260 (Concept::EqualityComparable<OdfPixelType>));
261 itkConceptMacro(GradientConvertibleToDoubleCheck,
262 (Concept::Convertible<GradientPixelType, double>));
263 itkConceptMacro(DoubleConvertibleToTensorCheck,
264 (Concept::Convertible<double, OdfPixelType>));
265 itkConceptMacro(GradientReferenceAdditiveOperatorsCheck,
268 itkConceptMacro(ReferenceOStreamWritableCheck,
269 (Concept::OStreamWritable<ReferencePixelType>));
270 itkConceptMacro(TensorOStreamWritableCheck,
271 (Concept::OStreamWritable<OdfPixelType>));
278 void PrintSelf(std::ostream& os, Indent indent)
const;
305 unsigned int m_NumberOfGradientDirections;
308 unsigned int m_NumberOfEquatorSamplingPoints;
311 unsigned int m_NumberOfBaselineImages;
317 TOdfPixelType m_BValue;
328 bool m_DirectionsDuplicated;
336 #ifndef ITK_MANUAL_INSTANTIATION
340 #endif //__itkDiffusionQballReconstructionImageFilter_h_
Superclass::InputImageType ReferenceImageType
Vector< TOdfPixelType, NrOdfDirections > OdfPixelType
itk::SmartPointer< Self > Pointer
DiffusionQballReconstructionImageFilter Self
TOdfPixelType BZeroPixelType
virtual GradientDirectionType GetGradientDirection(unsigned int idx) const
Image< GradientPixelType, 3 > GradientImageType
This class takes as input one or more reference images (acquired in the absence of diffusion sensitiz...
TReferenceImagePixelType ReferencePixelType
void ComputeReconstructionMatrix()
vnl_matrix< TOdfPixelType > * OdfReconstructionMatrixType
VectorImage< GradientPixelType, 3 > GradientImagesType
OdfPixelType Normalize(OdfPixelType odf, typename NumericTraits< ReferencePixelType >::AccumulateType b0)
void AddGradientImage(const GradientDirectionType &, const GradientImageType *image)
Superclass::OutputImageRegionType OutputImageRegionType
virtual ReferenceImageType * GetReferenceImage()
SmartPointer< Self > Pointer
Image< BZeroPixelType, 3 > BZeroImageType
void SetGradientImage(const GradientDirectionContainerType *, const GradientImagesType *image)
~DiffusionQballReconstructionImageFilter()
itk::Image< double, 3 > InputImageType
GradientImageTypeEnumeration
DiffusionQballReconstructionImageFilter()
Image< OdfPixelType, 3 > OdfImageType
SmartPointer< const Self > ConstPointer
void BeforeThreadedGenerateData()
void PrintSelf(std::ostream &os, Indent indent) const
ImageToImageFilter< Image< TReferenceImagePixelType, 3 >, Image< Vector< TOdfPixelType, NrOdfDirections >, 3 > > Superclass
OdfImageType OutputImageType
TGradientImagePixelType GradientPixelType
vnl_vector_fixed< double, 3 > GradientDirectionType
void SetReferenceImage(ReferenceImageType *referenceImage)
vnl_vector< TOdfPixelType > PreNormalize(vnl_vector< TOdfPixelType > vec)
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType)
itkStaticConstMacro(NOdfDirections, int, NrOdfDirections)
VectorContainer< unsigned int, GradientDirectionType > GradientDirectionContainerType