Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
itkTensorImageToDiffusionImageFilter.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 Program: Tensor ToolKit - TTK
19 Module: $URL: svn://scm.gforge.inria.fr/svn/ttk/trunk/Algorithms/itkTensorImageToDiffusionImageFilter.h $
20 Language: C++
21 Date: $Date: 2010-06-07 13:39:13 +0200 (Mo, 07 Jun 2010) $
22 Version: $Revision: 68 $
23 
24 Copyright (c) INRIA 2010. All rights reserved.
25 See LICENSE.txt for details.
26 
27 This software is distributed WITHOUT ANY WARRANTY; without even
28 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
29 PURPOSE. See the above copyright notices for more information.
30 
31 =========================================================================*/
32 #ifndef _itk_TensorImageToDiffusionImageFilter_h_
33 #define _itk_TensorImageToDiffusionImageFilter_h_
34 
35 #include "itkImageToImageFilter.h"
36 
37 #include <itkDiffusionTensor3D.h>
38 #include <itkVectorContainer.h>
39 
40 namespace itk
41 {
42 
43  template <class TInputScalarType, class TOutputScalarType>
45  : public ImageToImageFilter<itk::Image<itk::DiffusionTensor3D<TInputScalarType>,3>, itk::VectorImage<TOutputScalarType,3> >
46  {
47 
48  public:
49 
50  typedef TInputScalarType InputScalarType;
51  typedef itk::DiffusionTensor3D<InputScalarType> InputPixelType;
52  typedef itk::Image<InputPixelType,3> InputImageType;
53  typedef typename InputImageType::RegionType InputImageRegionType;
54 
55  typedef TOutputScalarType OutputScalarType;
56  typedef itk::VectorImage<OutputScalarType,3> OutputImageType;
58  typedef typename OutputImageType::RegionType OutputImageRegionType;
59 
60  typedef OutputScalarType BaselineScalarType;
61  typedef BaselineScalarType BaselinePixelType;
62  typedef typename itk::Image<BaselinePixelType,3> BaselineImageType;
63  typedef typename BaselineImageType::RegionType BaselineImageRegionType;
64 
65  typedef itk::Image< short, 3> MaskImageType;
66  typedef MaskImageType::RegionType MaskImageRegionType;
67 
69  typedef ImageToImageFilter<InputImageType, OutputImageType> Superclass;
70 
73 
74  itkTypeMacro (TensorImageToDiffusionImageFilter, ImageToImageFilter);
75 
76  itkStaticConstMacro (ImageDimension, unsigned int,
77  OutputImageType::ImageDimension);
78 
79  itkFactorylessNewMacro(Self)
80  itkCloneMacro(Self)
81 
82  typedef vnl_vector_fixed<double,3> GradientType;
83  typedef VectorContainer<unsigned int, GradientType> GradientListType;
84  typedef GradientListType::Pointer GradientListPointerType;
85 
87  void SetGradientList(const GradientListPointerType list)
88  {
89  m_GradientList = list;
90  this->Modified();
91  }
93  {return m_GradientList;}
94 
95 
96  void SetBValue( const double& bval)
97  { m_BValue = bval; }
98 
100  {
101  m_MaskImage = maskimage;
102  }
103 
104 
112  {
113  m_BaselineImage = bimage;
114  }
115 
116  itkSetMacro(Min, OutputScalarType);
117  itkSetMacro(Max, OutputScalarType);
118 
119 
120  protected:
122  {
123  m_BValue = 1.0;
124  m_BaselineImage = 0;
125  m_Min = 0.0;
126  m_Max = 10000.0;
127  }
128 
130 
131  void PrintSelf (std::ostream& os, Indent indent) const
132  {
133  Superclass::PrintSelf (os, indent);
134  }
135 
136  virtual void BeforeThreadedGenerateData( void );
137 
138  virtual void ThreadedGenerateData( const
139  OutputImageRegionType &outputRegionForThread, ThreadIdType);
140 
141  //void GenerateData();
142 
143  virtual void UpdateOutputInformation();
144 
145 
146  private:
147 
148  TensorImageToDiffusionImageFilter (const Self&);
149  void operator=(const Self&);
150 
151  GradientListType::Pointer m_GradientList;
152  double m_BValue;
153  typename BaselineImageType::Pointer m_BaselineImage;
154 
155  OutputScalarType m_Min;
156  OutputScalarType m_Max;
157 
158  MaskImageType::Pointer m_MaskImage;
159 
160  };
161 
162 
163 } // end of namespace
164 
165 
166 #ifndef ITK_MANUAL_INSTANTIATION
168 #endif
169 
170 
171 #endif
itk::SmartPointer< Self > Pointer
#define Max(x, y)
Definition: AnnotationP.h:41
virtual void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType)
void PrintSelf(std::ostream &os, Indent indent) const
virtual void BeforeThreadedGenerateData(void)
GradientListPointerType GetGradientList(void) const
void SetExternalBaselineImage(typename BaselineImageType::Pointer bimage)
Set an external baseline image for signal generation (optional)
itk::DiffusionTensor3D< InputScalarType > InputPixelType
void SetGradientList(const GradientListPointerType list)
ImageToImageFilter< InputImageType, OutputImageType > Superclass
itkStaticConstMacro(ImageDimension, unsigned int, OutputImageType::ImageDimension)
unsigned short PixelType
void SetMaskImage(MaskImageType::Pointer maskimage)
#define Min(x, y)
Definition: AnnotationP.h:38
VectorContainer< unsigned int, GradientType > GradientListType
itk::VectorImage< OutputScalarType, 3 > OutputImageType