Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkDiffusionTensorMathematics.h
Go to the documentation of this file.
1/*=auto=========================================================================
2
3 Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
4
5 See COPYRIGHT.txt
6 or http://www.slicer.org/copyright/copyright.txt for details.
7
8 Program: 3D Slicer
9 Module: $RCSfile: vtkDiffusionTensorMathematics.h,v $
10 Date: $Date: 2006/12/19 17:14:44 $
11 Version: $Revision: 1.20 $
12
13=========================================================================auto=*/
18//
23//
24
25#ifndef __vtkDiffusionTensorMathematics_h
26#define __vtkDiffusionTensorMathematics_h
27
28// vtkTeem includes
29#include "vtkTeemConfigure.h"
30
31// VTK includes
32#include <vtkThreadedImageAlgorithm.h>
33
34class vtkMatrix4x4;
35class vtkImageData;
36class VTK_Teem_EXPORT vtkDiffusionTensorMathematics : public vtkThreadedImageAlgorithm
37{
38public:
40 vtkTypeMacro(vtkDiffusionTensorMathematics, vtkThreadedImageAlgorithm);
41 void PrintSelf(ostream& os, vtkIndent indent) override;
42
44 enum
45 {
76 };
79 vtkGetMacro(Operation, int);
81
85
89
103
109
115
121
127
133
139
146
150 vtkSetMacro(ScaleFactor, double);
151 vtkGetMacro(ScaleFactor, double);
152
155 vtkSetMacro(ExtractEigenvalues, int);
156 vtkBooleanMacro(ExtractEigenvalues, int);
157 vtkGetMacro(ExtractEigenvalues, int);
158
163 //
166 //
177 //
178 virtual void SetTensorRotationMatrix(vtkMatrix4x4*);
179 vtkGetObjectMacro(TensorRotationMatrix, vtkMatrix4x4);
180
184 vtkBooleanMacro(MaskWithScalars, int);
185 vtkSetMacro(MaskWithScalars, int);
186 vtkGetMacro(MaskWithScalars, int);
187
188 vtkBooleanMacro(FixNegativeEigenvalues, int);
189 vtkSetMacro(FixNegativeEigenvalues, int);
190 vtkGetMacro(FixNegativeEigenvalues, int);
191
194 virtual void SetScalarMask(vtkImageData*);
195 vtkGetObjectMacro(ScalarMask, vtkImageData);
196
199 vtkSetMacro(MaskLabelValue, int);
200 vtkGetMacro(MaskLabelValue, int);
201
203 static void ModeToRGB(double Mode, double FA, double& R, double& G, double& B);
204
205 static void RGBToIndex(double R, double G, double B, double& index);
206
209 static int FixNegativeEigenvaluesMethod(double w[3]);
210 static double Determinant(double D[3][3]);
211 static double Trace(double D[3][3]);
212 static double Trace(double w[3]);
213 static double RelativeAnisotropy(double w[3]);
214 static double FractionalAnisotropy(double w[3]);
215 static double LinearMeasure(double w[3]);
216 static double PlanarMeasure(double w[3]);
217 static double SphericalMeasure(double w[3]);
218 static double MaxEigenvalue(double w[3]);
219 static double MiddleEigenvalue(double w[3]);
220 static double ParallelDiffusivity(double w[3]);
221 static double PerpendicularDiffusivity(double w[3]);
222 static double MeanDiffusivity(double w[3]);
223 static double MinEigenvalue(double w[3]);
224 static double RAIMaxEigenvecX(double** v, double w[3]);
225 static double RAIMaxEigenvecY(double** v, double w[3]);
226 static double RAIMaxEigenvecZ(double** v, double w[3]);
227 static double MaxEigenvecX(double** v, double w[3]);
228 static double MaxEigenvecY(double** v, double w[3]);
229 static double MaxEigenvecZ(double** v, double w[3]);
230 static double MaxEigenvalueProjectionX(double** v, double w[3]);
231 static double MaxEigenvalueProjectionY(double** v, double w[3]);
232 static double MaxEigenvalueProjectionZ(double** v, double w[3]);
233 static double Mode(double w[3]);
234 static void ColorByMode(double w[3], double& R, double& G, double& B);
235
236 // Description
237 // Wrap function to teem eigen solver
238 static int TeemEigenSolver(double** m, double* w, double** v);
239 void ComputeTensorIncrements(vtkImageData* imageData, vtkIdType incr[3]);
240
241protected:
244
246 double ScaleFactor;
248
250 vtkImageData* ScalarMask;
252
253 vtkMatrix4x4* TensorRotationMatrix;
255
256 int RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
257
258 void ThreadedRequestData(vtkInformation* request,
259 vtkInformationVector** inputVector,
260 vtkInformationVector* outputVector,
261 vtkImageData*** inData,
262 vtkImageData** outData,
263 int extent[6],
264 int threadId) override;
265
266 int FillInputPortInformation(int port, vtkInformation* info) override;
267
268 // Reimplemented to delete the tensor array of the output.
269 int RequestData(vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector) override;
270
271private:
273 void operator=(const vtkDiffusionTensorMathematics&) = delete;
274};
275
276#endif
int FillInputPortInformation(int port, vtkInformation *info) override
void PrintSelf(ostream &os, vtkIndent indent) override
static void ModeToRGB(double Mode, double FA, double &R, double &G, double &B)
Public for access from threads.
~vtkDiffusionTensorMathematics() override
static double ParallelDiffusivity(double w[3])
static void RGBToIndex(double R, double G, double B, double &index)
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
static double FractionalAnisotropy(double w[3])
static double PlanarMeasure(double w[3])
static double MaxEigenvalueProjectionX(double **v, double w[3])
static double MaxEigenvalue(double w[3])
virtual void SetTensorRotationMatrix(vtkMatrix4x4 *)
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
void SetOperationToDeterminant()
Output the determinant.
static double Mode(double w[3])
static double RelativeAnisotropy(double w[3])
static double MinEigenvalue(double w[3])
static double MeanDiffusivity(double w[3])
void SetOperationToD11()
Output a matrix (tensor) component.
int MaskWithScalars
Boolean controls eigenfunction extraction.
static double RAIMaxEigenvecZ(double **v, double w[3])
static vtkDiffusionTensorMathematics * New()
static double Trace(double w[3])
static double MaxEigenvalueProjectionY(double **v, double w[3])
static double MiddleEigenvalue(double w[3])
void SetOperationToMaxEigenvalueProjectionX()
Output Maxeigenvalue*Maxeigenvec_projection also known as L1Z.
static double MaxEigenvecZ(double **v, double w[3])
static double MaxEigenvecY(double **v, double w[3])
static double RAIMaxEigenvecY(double **v, double w[3])
void SetOperationToMaxEigenvecX()
Output Relative_anisotropy*Maxeigenvec_projection also known as L1z.
static int TeemEigenSolver(double **m, double *w, double **v)
static int FixNegativeEigenvaluesMethod(double w[3])
Helper functions to perform operations pixel-wise.
void SetOperationToMaxEigenvalue()
Output a selected eigenvalue.
static double SphericalMeasure(double w[3])
double ScaleFactor
math operation to perform
int ExtractEigenvalues
Scale factor for output scalars.
void SetOperationToRelativeAnisotropy()
Output various anisotropy and shape measures.
void SetOperationToRAIMaxEigenvecX()
Output Relative_anisotropy*Maxeigenvec_projection also known as L1z.
static double Trace(double D[3][3])
static double PerpendicularDiffusivity(double w[3])
void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int extent[6], int threadId) override
static double RAIMaxEigenvecX(double **v, double w[3])
static double LinearMeasure(double w[3])
virtual void SetOperation(int)
virtual void SetScalarMask(vtkImageData *)
Scalar mask.
static void ColorByMode(double w[3], double &R, double &G, double &B)
static double MaxEigenvalueProjectionZ(double **v, double w[3])
static double MaxEigenvecX(double **v, double w[3])
void ComputeTensorIncrements(vtkImageData *imageData, vtkIdType incr[3])
void SetOperationToTrace()
Output the trace (sum of eigenvalues = sum along diagonal)
static double Determinant(double D[3][3])