26 #ifndef __vtkDiffusionTensorMathematics_h 27 #define __vtkDiffusionTensorMathematics_h 30 #include "vtkTeemConfigure.h" 33 #include <vtkThreadedImageAlgorithm.h> 42 void PrintSelf(ostream& os, vtkIndent indent)
override;
48 VTK_TENS_DETERMINANT = 1,
49 VTK_TENS_RELATIVE_ANISOTROPY = 2,
50 VTK_TENS_FRACTIONAL_ANISOTROPY = 3,
51 VTK_TENS_MAX_EIGENVALUE = 4,
52 VTK_TENS_MID_EIGENVALUE = 5,
53 VTK_TENS_MIN_EIGENVALUE = 6,
54 VTK_TENS_LINEAR_MEASURE = 7,
55 VTK_TENS_PLANAR_MEASURE = 8,
56 VTK_TENS_SPHERICAL_MEASURE = 9,
57 VTK_TENS_COLOR_ORIENTATION = 10,
62 VTK_TENS_COLOR_MODE =15,
63 VTK_TENS_MAX_EIGENVALUE_PROJX = 16,
64 VTK_TENS_MAX_EIGENVALUE_PROJY = 17,
65 VTK_TENS_MAX_EIGENVALUE_PROJZ = 18,
66 VTK_TENS_RAI_MAX_EIGENVEC_PROJX = 19,
67 VTK_TENS_RAI_MAX_EIGENVEC_PROJY = 20,
68 VTK_TENS_RAI_MAX_EIGENVEC_PROJZ = 21,
69 VTK_TENS_MAX_EIGENVEC_PROJX = 22,
70 VTK_TENS_MAX_EIGENVEC_PROJY = 23,
71 VTK_TENS_MAX_EIGENVEC_PROJZ = 24,
72 VTK_TENS_PARALLEL_DIFFUSIVITY = 25,
73 VTK_TENS_PERPENDICULAR_DIFFUSIVITY = 26,
74 VTK_TENS_COLOR_ORIENTATION_MIDDLE_EIGENVECTOR = 27,
75 VTK_TENS_COLOR_ORIENTATION_MIN_EIGENVECTOR = 28,
76 VTK_TENS_MEAN_DIFFUSIVITY = 29
80 vtkGetMacro(Operation,
int);
81 vtkSetClampMacro(Operation,
int, VTK_TENS_TRACE, VTK_TENS_MEAN_DIFFUSIVITY);
86 {this->SetOperation(VTK_TENS_TRACE);};
91 {this->SetOperation(VTK_TENS_DETERMINANT);};
96 {this->SetOperation(VTK_TENS_RELATIVE_ANISOTROPY);};
98 {this->SetOperation(VTK_TENS_FRACTIONAL_ANISOTROPY);};
100 {this->SetOperation(VTK_TENS_LINEAR_MEASURE);};
102 {this->SetOperation(VTK_TENS_PLANAR_MEASURE);};
104 {this->SetOperation(VTK_TENS_SPHERICAL_MEASURE);};
108 {this->SetOperation(VTK_TENS_MODE);};
110 {this->SetOperation(VTK_TENS_PARALLEL_DIFFUSIVITY);};
112 {this->SetOperation(VTK_TENS_PERPENDICULAR_DIFFUSIVITY);};
114 {this->SetOperation(VTK_TENS_MEAN_DIFFUSIVITY);};
119 {this->SetOperation(VTK_TENS_MAX_EIGENVALUE);};
121 {this->SetOperation(VTK_TENS_MID_EIGENVALUE);};
123 {this->SetOperation(VTK_TENS_MIN_EIGENVALUE);};
128 {this->SetOperation(VTK_TENS_MAX_EIGENVALUE_PROJX);};
130 {this->SetOperation(VTK_TENS_MAX_EIGENVALUE_PROJY);};
132 {this->SetOperation(VTK_TENS_MAX_EIGENVALUE_PROJZ);};
137 {this->SetOperation(VTK_TENS_RAI_MAX_EIGENVEC_PROJX);}
139 {this->SetOperation(VTK_TENS_RAI_MAX_EIGENVEC_PROJY);}
141 {this->SetOperation(VTK_TENS_RAI_MAX_EIGENVEC_PROJZ);}
146 {this->SetOperation(VTK_TENS_MAX_EIGENVEC_PROJX);}
148 {this->SetOperation(VTK_TENS_MAX_EIGENVEC_PROJY);}
150 {this->SetOperation(VTK_TENS_MAX_EIGENVEC_PROJZ);}
156 {this->SetOperation(VTK_TENS_D11);};
158 {this->SetOperation(VTK_TENS_D22);};
160 {this->SetOperation(VTK_TENS_D33);};
167 {this->SetOperation(VTK_TENS_COLOR_ORIENTATION);};
175 {this->SetOperation(VTK_TENS_COLOR_MODE);};
180 vtkSetMacro(ScaleFactor,
double);
181 vtkGetMacro(ScaleFactor,
double);
185 vtkSetMacro(ExtractEigenvalues,
int);
186 vtkBooleanMacro(ExtractEigenvalues,
int);
187 vtkGetMacro(ExtractEigenvalues,
int);
208 virtual void SetTensorRotationMatrix(vtkMatrix4x4*);
209 vtkGetObjectMacro(TensorRotationMatrix, vtkMatrix4x4);
214 vtkBooleanMacro(MaskWithScalars,
int);
215 vtkSetMacro(MaskWithScalars,
int);
216 vtkGetMacro(MaskWithScalars,
int);
218 vtkBooleanMacro(FixNegativeEigenvalues,
int);
219 vtkSetMacro(FixNegativeEigenvalues,
int);
220 vtkGetMacro(FixNegativeEigenvalues,
int);
224 virtual void SetScalarMask(vtkImageData*);
225 vtkGetObjectMacro(ScalarMask, vtkImageData);
229 vtkSetMacro(MaskLabelValue,
int);
230 vtkGetMacro(MaskLabelValue,
int);
233 static void ModeToRGB(
double Mode,
double FA,
234 double &R,
double &G,
double &B);
236 static void RGBToIndex(
double R,
double G,
237 double B,
double &index);
241 static int FixNegativeEigenvaluesMethod(
double w[3]);
242 static double Determinant(
double D[3][3]);
243 static double Trace(
double D[3][3]);
244 static double Trace(
double w[3]);
245 static double RelativeAnisotropy(
double w[3]);
246 static double FractionalAnisotropy(
double w[3]);
247 static double LinearMeasure(
double w[3]);
248 static double PlanarMeasure(
double w[3]);
249 static double SphericalMeasure(
double w[3]);
250 static double MaxEigenvalue(
double w[3]);
251 static double MiddleEigenvalue(
double w[3]);
252 static double ParallelDiffusivity(
double w[3]);
253 static double PerpendicularDiffusivity(
double w[3]);
254 static double MeanDiffusivity(
double w[3]);
255 static double MinEigenvalue(
double w[3]);
256 static double RAIMaxEigenvecX(
double **v,
double w[3]);
257 static double RAIMaxEigenvecY(
double **v,
double w[3]);
258 static double RAIMaxEigenvecZ(
double **v,
double w[3]);
259 static double MaxEigenvecX(
double **v,
double w[3]);
260 static double MaxEigenvecY(
double **v,
double w[3]);
261 static double MaxEigenvecZ(
double **v,
double w[3]);
262 static double MaxEigenvalueProjectionX(
double **v,
double w[3]);
263 static double MaxEigenvalueProjectionY(
double **v,
double w[3]);
264 static double MaxEigenvalueProjectionZ(
double **v,
double w[3]);
265 static double Mode(
double w[3]);
266 static void ColorByMode(
double w[3],
double &R,
double &G,
double &B);
270 static int TeemEigenSolver(
double **m,
double *w,
double **v);
271 void ComputeTensorIncrements(vtkImageData *imageData, vtkIdType incr[3]);
288 int RequestInformation (vtkInformation*,
289 vtkInformationVector**,
290 vtkInformationVector*)
override;
292 void ThreadedRequestData(vtkInformation *request,
293 vtkInformationVector **inputVector,
294 vtkInformationVector *outputVector,
295 vtkImageData ***inData,
296 vtkImageData **outData,
297 int extent[6],
int threadId)
override;
299 int FillInputPortInformation(
int port, vtkInformation* info)
override;
302 int RequestData(vtkInformation* request,
303 vtkInformationVector** inputVector,
304 vtkInformationVector* outputVector)
override;
void SetOperationToDeterminant()
Output the determinant
void SetOperationToSphericalMeasure()
void SetOperationToMaxEigenvalueProjectionX()
Output Maxeigenvalue*Maxeigenvec_projection also known as L1Z
int FixNegativeEigenvalues
void SetOperationToColorByOrientation()
vtkMatrix4x4 * TensorRotationMatrix
int MaskWithScalars
Boolean controls eigenfunction extraction.
void SetOperationToRAIMaxEigenvecY()
void SetOperationToRelativeAnisotropy()
Output various anisotropy and shape measures
void SetOperationToColorByMode()
void SetOperationToMaxEigenvecX()
Output Relative_anisotropy*Maxeigenvec_projection also known as L1z
vtkImageData * ScalarMask
void SetOperationToMaxEigenvalueProjectionZ()
void SetOperationToPerpendicularDiffusivity()
double ScaleFactor
math operation to perform
void SetOperationToFractionalAnisotropy()
void SetOperationToRAIMaxEigenvecX()
Output Relative_anisotropy*Maxeigenvec_projection also known as L1z
void SetOperationToMaxEigenvalueProjectionY()
void SetOperationToTrace()
Output the trace (sum of eigenvalues = sum along diagonal)
void SetOperationToMaxEigenvecZ()
void SetOperationToMode()
void SetOperationToRAIMaxEigenvecZ()
void SetOperationToMaxEigenvecY()
void SetOperationToMinEigenvalue()
int ExtractEigenvalues
Scale factor for output scalars.
void SetOperationToMaxEigenvalue()
Output a selected eigenvalue
void SetOperationToMeanDiffusivity()
void SetOperationToPlanarMeasure()
void SetOperationToLinearMeasure()
void SetOperationToD11()
Output a matrix (tensor) component
void SetOperationToParallelDiffusivity()
void SetOperationToMiddleEigenvalue()