PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
PlusSpatialModel.h
Go to the documentation of this file.
1 /*=Plus=header=begin======================================================
2  Program: Plus
3  Copyright (c) Laboratory for Percutaneous Surgery. All rights reserved.
4  See License.txt for details.
5 =========================================================Plus=header=end*/
6 #ifndef __SpatialModel_h
7 #define __SpatialModel_h
8 
9 #include <deque>
10 #include <string>
11 
12 #include "vtkPlusUsSimulatorExport.h"
13 
14 class vtkMatrix4x4;
15 class vtkModifiedBSPTree;
16 class vtkPolyData;
17 
23 class vtkPlusUsSimulatorExport PlusSpatialModel
24 {
25 public:
27  {
29  {
30  Model = NULL;
31  IntersectionDistanceFromStartPointMm = 0;
32  IntersectionIncidenceAngleRad = 0;
33  }
35  // Distance between the line starting point and the intersection point, in mm
37  // Angle between the intersecting line and the surface normal (0 if the line is parallel to the surface normal)
39  };
40 
42  virtual ~PlusSpatialModel();
43 
45  PlusSpatialModel(const PlusSpatialModel& model);
47  void operator=(const PlusSpatialModel& model);
48 
49  virtual PlusStatus ReadConfiguration(vtkXMLDataElement* spatialModelElement);
50 
52  void SetModelFile(const std::string& modelFile);
53 
55  SetMacro(ImagingFrequencyMhz, double);
56 
57  GetStdStringMacro(Name);
58  SetStdStringMacro(Name);
59 
60  GetStdStringMacro(ObjectCoordinateFrame);
61  SetStdStringMacro(ObjectCoordinateFrame);
62 
63  vtkMatrix4x4* GetModelToObjectTransform();
64 
65  void SetReferenceToObjectTransform(vtkMatrix4x4* referenceToObjectTransform);
66 
73  void GetLineIntersections(std::deque<LineIntersectionInfo>& lineIntersections, double* scanLineStartPoint_Reference, double* scanLineEndPoint_Reference);
74 
75  double GetAcousticImpedanceMegarayls();
76 
83  void CalculateIntensity(std::vector<double>& reflectedIntensity, unsigned int numberOfFilledPixels, double distanceBetweenScanlineSamplePointsMm,
84  double previousModelAcousticImpedanceMegarayls, double incidentIntensity, double& transmittedIntensity, double incidenceAngleRad);
85 
86  SetMacro(DensityKgPerM3, double);
87  SetMacro(SoundVelocityMPerSec, double);
88  SetMacro(AttenuationCoefficientDbPerCmMhz, double);
89  SetMacro(SurfaceReflectionIntensityDecayDbPerMm, double);
90  SetMacro(BackscatterDiffuseReflectionCoefficient, double);
91  SetMacro(SurfaceDiffuseReflectionCoefficient, double);
92  SetMacro(SurfaceSpecularReflectionCoefficient, double);
93  SetMacro(TransducerSpatialModelMaxOverlapMm, double);
94 
95 protected:
96  void SetPolyData(vtkPolyData* polyData);
97  void SetModelLocalizer(vtkModifiedBSPTree* modelLocalizer);
98  void SetModelToObjectTransform(vtkMatrix4x4* modelToObjectTransform);
99  void SetModelToObjectTransform(double* matrixElements);
100 
101  PlusStatus UpdateModelFile();
102  void UpdatePrecomputedAttenuations(double intensityTransmittedFractionPerPixelTwoWay, int numberOfElements);
103 
104 protected:
105  //PlusStatus LoadModel(const std::string& absoluteImagePath);
106 
108  std::string Name;
109 
111  std::string ModelFile;
112 
115 
120  vtkMatrix4x4* ModelToObjectTransform;
121 
128 
131 
132  //TODO: /*! ModelToReferenceTransform */ ... is not read in previously, probably not needed, keep an eye on it
133 
136 
139 
142 
145 
152 
159 
173 
181 
186 
187  vtkModifiedBSPTree* ModelLocalizer;
188 
190  vtkPolyData* PolyData;
191 
193  std::vector<double> PrecomputedAttenuations;
194 };
195 
196 #endif
vtkMatrix4x4 * ReferenceToObjectTransform
std::string ModelFile
igsioStatus PlusStatus
Definition: PlusCommon.h:40
vtkMatrix4x4 * ModelToObjectTransform
double SurfaceReflectionIntensityDecayDbPerMm
double BackscatterDiffuseReflectionCoefficient
double AttenuationCoefficientDbPerCmMhz
double SurfaceSpecularReflectionCoefficient
std::string ObjectCoordinateFrame
vtkPolyData * PolyData
double SurfaceDiffuseReflectionCoefficient
double TransducerSpatialModelMaxOverlapMm
vtkModifiedBSPTree * ModelLocalizer
std::vector< double > PrecomputedAttenuations