Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
itkDiffusionTensorPrincipalDirectionImageFilter.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 /*===================================================================
18 
19 This file is based heavily on a corresponding ITK filter.
20 
21 ===================================================================*/
22 #ifndef __itkDiffusionTensorPrincipalDirectionImageFilter_h_
23 #define __itkDiffusionTensorPrincipalDirectionImageFilter_h_
24 
26 #include <itkImageToImageFilter.h>
27 #include <vnl/vnl_vector_fixed.h>
28 #include <vnl/vnl_matrix.h>
29 #include <vnl/algo/vnl_svd.h>
30 #include <itkVectorContainer.h>
31 #include <itkVectorImage.h>
32 #include <itkDiffusionTensor3D.h>
33 #include <mitkFiberBundle.h>
34 
35 namespace itk{
39 template< class TTensorPixelType, class TPDPixelType=float>
41  public ImageToImageFilter< Image< DiffusionTensor3D<TTensorPixelType>, 3 >, Image< Vector< TPDPixelType, 3 >, 3 > >
42 {
43 
44 public:
45 
49  typedef ImageToImageFilter< Image< DiffusionTensor3D<TTensorPixelType>, 3 >, Image< Vector< TPDPixelType, 3 >, 3 > >
51 
53  itkFactorylessNewMacro(Self)
54  itkCloneMacro(Self)
55 
57  itkTypeMacro(DiffusionTensorPrincipalDirectionImageFilter, ImageToImageFilter)
58 
60  typedef TPDPixelType DirectionPixelType;
64  typedef itk::Image<unsigned char, 3> ItkUcharImgType;
65  typedef vnl_vector_fixed< double, 3 > DirectionType;
66 
67  void SetImage( const InputImageType *image );
68 
69  // input
70  itkSetMacro( MaskImage, ItkUcharImgType::Pointer)
71  itkSetMacro( NormalizeVectors, bool)
72 
73  // output
74  itkGetMacro( OutputFiberBundle, mitk::FiberBundle::Pointer)
75  itkGetMacro( NumDirectionsImage, ItkUcharImgType::Pointer)
76 
77  protected:
78  DiffusionTensorPrincipalDirectionImageFilter();
79  ~DiffusionTensorPrincipalDirectionImageFilter() {}
80  void PrintSelf(std::ostream& os, Indent indent) const;
81 
83  void ThreadedGenerateData( const OutputImageRegionType &outputRegionForThread, ThreadIdType );
85 
86 private:
87 
88  bool m_NormalizeVectors;
89  mitk::FiberBundle::Pointer m_OutputFiberBundle;
90  ItkUcharImgType::Pointer m_NumDirectionsImage;
91  ItkUcharImgType::Pointer m_MaskImage;
92  float m_MaxEigenvalue;
93 };
94 
95 }
96 
97 #ifndef ITK_MANUAL_INSTANTIATION
99 #endif
100 
101 #endif //__itkDiffusionTensorPrincipalDirectionImageFilter_h_
102 
itk::SmartPointer< Self > Pointer
DataCollection - Class to facilitate loading/accessing structured data.
void PrintSelf(std::ostream &os, Indent indent) const
ImageToImageFilter< Image< DiffusionTensor3D< TTensorPixelType >, 3 >, Image< Vector< TPDPixelType, 3 >, 3 > > Superclass
class ITK_EXPORT Image
double TTensorPixelType
void SetImage(const InputImageType *image)
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType)