NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkIntegrateStreamlinesFilter.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef itkIntegrateStreamlinesFilter_h
16 #define itkIntegrateStreamlinesFilter_h
17 
18 #include <itkImage.h>
19 #include <itkVector.h>
21 #include <itkLinearInterpolateImageFunction.h>
22 #include <itkVectorLinearInterpolateImageFunction.h>
23 
24 namespace itk {
48 template < class TImageType, typename TScalarType=double, unsigned int NDimensions=3 >
49 class ITK_EXPORT IntegrateStreamlinesFilter :
50  public BaseCTEStreamlinesFilter<TImageType, TScalarType, NDimensions>
51 {
52 public:
53 
57  typedef SmartPointer<Self> Pointer;
58  typedef SmartPointer<const Self> ConstPointer;
59 
61  itkNewMacro(Self);
62 
65 
67  itkStaticConstMacro(Dimension, unsigned int, NDimensions);
68 
70  typedef Vector< TScalarType, NDimensions > InputVectorImagePixelType;
72  typedef typename InputVectorImageType::Pointer InputVectorImagePointer;
73  typedef typename InputVectorImageType::ConstPointer InputVectorImageConstPointer;
74  typedef TScalarType InputScalarImagePixelType;
76  typedef typename InputScalarImageType::PointType InputScalarImagePointType;
77  typedef typename InputScalarImageType::Pointer InputScalarImagePointer;
79  typedef typename InputScalarImageType::ConstPointer InputScalarImageConstPointer;
81  typedef InputScalarImageType OutputImageType;
83  typedef typename OutputImageType::Pointer OutputImagePointer;
84  typedef typename OutputImageType::ConstPointer OutputImageConstPointer;
85  typedef VectorLinearInterpolateImageFunction<
86  InputVectorImageType
87  ,TScalarType
89  typedef typename VectorInterpolatorType::Pointer VectorInterpolatorPointer;
90  typedef typename VectorInterpolatorType::PointType VectorInterpolatorPointType;
91  typedef LinearInterpolateImageFunction<
92  InputScalarImageType
93  ,TScalarType
95  typedef typename ScalarInterpolatorType::Pointer ScalarInterpolatorPointer;
96  typedef typename ScalarInterpolatorType::PointType ScalarInterpolatorPointType;
97 
99  void SetScalarImage(const InputScalarImageType *image) {this->SetNthInput(0, const_cast<InputScalarImageType *>(image)); }
100 
102  void SetVectorImage(const InputVectorImageType* image) { this->SetNthInput(1, const_cast<InputVectorImageType *>(image)); }
103 
105  itkSetMacro(MinIterationVoltage, InputScalarImagePixelType);
106  itkGetMacro(MinIterationVoltage, InputScalarImagePixelType);
107 
109  itkSetMacro(MaxIterationVoltage, InputScalarImagePixelType);
110  itkGetMacro(MaxIterationVoltage, InputScalarImagePixelType);
111 
113  itkSetMacro(StepSize, TScalarType);
114  itkGetMacro(StepSize, TScalarType);
115 
117  itkSetMacro(MaxIterationLength, TScalarType);
118  itkGetMacro(MaxIterationLength, TScalarType);
119 
120 protected:
123  void PrintSelf(std::ostream& os, Indent indent) const;
124 
125  // The main method to implement in derived classes, note, its threaded.
126  virtual void ThreadedGenerateData( const InputScalarImageRegionType &outputRegionForThread, ThreadIdType threadId);
127 
128 private:
129 
133  IntegrateStreamlinesFilter(const Self&);
134  void operator=(const Self&);
135 
137  InputScalarImagePixelType m_MinIterationVoltage;
138 
140  InputScalarImagePixelType m_MaxIterationVoltage;
141 
143  TScalarType m_StepSize;
144 
146  TScalarType m_MaxIterationLength;
147 
149  double GetLengthToThreshold(
150  const InputScalarImagePointType &startingPoint,
151  const InputScalarImagePixelType &initialValue,
152  const InputScalarImagePixelType &threshold,
153  const InputVectorImagePointer &vectorImage,
154  const InputScalarImagePointer &scalarImage,
155  const VectorInterpolatorPointer &vectorInterpolator,
156  const ScalarInterpolatorPointer &scalarInterpolator,
157  const double &multiplier, // 1 or -1
158  const bool &debug,
159  bool &maxLengthExceeded
160  );
161 
162 
163 };
164 
165 } // end namespace
166 
167 #ifndef ITK_MANUAL_INSTANTIATION
168 #include "itkIntegrateStreamlinesFilter.txx"
169 #endif
170 
171 #endif
InputScalarImageType::RegionType InputScalarImageRegionType
Definition: itkIntegrateStreamlinesFilter.h:80
Vector< TScalarType, NDimensions > InputVectorImagePixelType
Definition: itkIntegrateStreamlinesFilter.h:70
~IntegrateStreamlinesFilter()
Definition: itkIntegrateStreamlinesFilter.h:122
Integrates streamlines using Eulers method (Lagrangian framework).
Definition: itkIntegrateStreamlinesFilter.h:49
VectorInterpolatorType::PointType VectorInterpolatorPointType
Definition: itkIntegrateStreamlinesFilter.h:90
LinearInterpolateImageFunction< InputScalarImageType,TScalarType > ScalarInterpolatorType
Definition: itkIntegrateStreamlinesFilter.h:94
InputVectorImageType::ConstPointer InputVectorImageConstPointer
Definition: itkIntegrateStreamlinesFilter.h:73
SmartPointer< const Self > ConstPointer
Definition: itkIntegrateStreamlinesFilter.h:58
void SetScalarImage(const InputScalarImageType *image)
Definition: itkIntegrateStreamlinesFilter.h:99
OutputImageType::PixelType OutputImagePixelType
Definition: itkIntegrateStreamlinesFilter.h:82
OutputImageType::Pointer OutputImagePointer
Definition: itkIntegrateStreamlinesFilter.h:83
OutputImageType::ConstPointer OutputImageConstPointer
Definition: itkIntegrateStreamlinesFilter.h:84
BaseCTEStreamlinesFilter< TImageType, TScalarType, NDimensions > Superclass
Definition: itkIntegrateStreamlinesFilter.h:56
GLenum GLsizei GLenum GLenum const GLvoid * image
Definition: glew.h:4052
InputScalarImageType::IndexType InputScalarImageIndexType
Definition: itkIntegrateStreamlinesFilter.h:78
Definition: niftkITKAffineResampleImage.cxx:74
Base class for filters that calculate thicknesses based on Laplacian streamlines. ...
Definition: itkBaseCTEStreamlinesFilter.h:36
ImageType::IndexType IndexType
Definition: niftkMakeLapUSProbeBasicModel.cxx:32
InputVectorImageType::Pointer InputVectorImagePointer
Definition: itkIntegrateStreamlinesFilter.h:72
ScalarInterpolatorType::Pointer ScalarInterpolatorPointer
Definition: itkIntegrateStreamlinesFilter.h:95
InputScalarImageType OutputImageType
Definition: itkIntegrateStreamlinesFilter.h:81
void SetVectorImage(const InputVectorImageType *image)
Definition: itkIntegrateStreamlinesFilter.h:102
TScalarType InputScalarImagePixelType
Definition: itkIntegrateStreamlinesFilter.h:74
InputScalarImageType::ConstPointer InputScalarImageConstPointer
Definition: itkIntegrateStreamlinesFilter.h:79
VectorLinearInterpolateImageFunction< InputVectorImageType,TScalarType > VectorInterpolatorType
Definition: itkIntegrateStreamlinesFilter.h:88
Image< InputScalarImagePixelType, NDimensions > InputScalarImageType
Definition: itkIntegrateStreamlinesFilter.h:75
float PixelType
Definition: niftkBreastDCEandADC.cxx:88
ImageType::RegionType RegionType
Definition: niftkMakeLapUSProbeBasicModel.cxx:30
SmartPointer< Self > Pointer
Definition: itkIntegrateStreamlinesFilter.h:57
ScalarInterpolatorType::PointType ScalarInterpolatorPointType
Definition: itkIntegrateStreamlinesFilter.h:96
Image< InputVectorImagePixelType, NDimensions > InputVectorImageType
Definition: itkIntegrateStreamlinesFilter.h:71
Simultaneous itk::Image and itk::Array (and hence vnl_vector) class.
const unsigned int Dimension
Definition: niftkBreastDCEandADC.cxx:89
InputScalarImageType::PointType InputScalarImagePointType
Definition: itkIntegrateStreamlinesFilter.h:76
IntegrateStreamlinesFilter Self
Definition: itkIntegrateStreamlinesFilter.h:55
InputScalarImageType::Pointer InputScalarImagePointer
Definition: itkIntegrateStreamlinesFilter.h:77
VectorInterpolatorType::Pointer VectorInterpolatorPointer
Definition: itkIntegrateStreamlinesFilter.h:89