Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __mitkDiffusionImage__h
00020 #define __mitkDiffusionImage__h
00021
00022 #include "mitkImage.h"
00023 #include "itkVectorImage.h"
00024 #include "itkVectorImageToImageAdaptor.h"
00025
00026 namespace mitk
00027 {
00028
00033 template<class TPixelType>
00034 class DiffusionImage : public Image
00035 {
00036
00037 public:
00038 typedef TPixelType PixelType;
00039 typedef typename itk::VectorImage<TPixelType, 3>
00040 ImageType;
00041 typedef vnl_vector_fixed< double, 3 > GradientDirectionType;
00042 typedef itk::VectorContainer< unsigned int,
00043 GradientDirectionType > GradientDirectionContainerType;
00044 typedef itk::VectorImageToImageAdaptor< TPixelType, 3 >
00045 AdaptorType;
00046
00047 mitkClassMacro( DiffusionImage, Image );
00048 itkNewMacro(Self);
00049
00050
00051
00052
00053
00054
00055 void AverageRedundantGradients(double precision);
00056
00057 GradientDirectionContainerType::Pointer CalcAveragedDirectionSet(double precision);
00058
00059 void CorrectDKFZBrokenGradientScheme(double precision);
00060
00061 typename ImageType::Pointer GetVectorImage()
00062 { return m_VectorImage; }
00063 void SetVectorImage(typename ImageType::Pointer image )
00064 { this->m_VectorImage = image; }
00065
00066 void InitializeFromVectorImage();
00067 void SetDisplayIndexForRendering(int displayIndex);
00068
00069 GradientDirectionContainerType::Pointer GetDirections()
00070 { return m_Directions; }
00071 void SetDirections( GradientDirectionContainerType::Pointer directions )
00072 { this->m_Directions = directions; }
00073 void SetDirections(const std::vector<itk::Vector<double,3> > directions)
00074 {
00075 m_Directions = GradientDirectionContainerType::New();
00076 for(unsigned int i=0; i<directions.size(); i++)
00077 {
00078 m_Directions->InsertElement( i, directions[i].Get_vnl_vector() );
00079 }
00080 }
00081 itkGetMacro(B_Value, float);
00082 itkSetMacro(B_Value, float);
00083
00084 bool AreAlike(GradientDirectionType g1, GradientDirectionType g2, double precision);
00085
00086 protected:
00087 DiffusionImage();
00088 virtual ~DiffusionImage();
00089
00090 typename ImageType::Pointer m_VectorImage;
00091 GradientDirectionContainerType::Pointer m_Directions;
00092 float m_B_Value;
00093 typename AdaptorType::Pointer m_VectorImageAdaptor;
00094 int m_DisplayIndex;
00095
00096 };
00097
00098 }
00099
00100 #include "mitkDiffusionImage.txx"
00101
00102 #endif