Fraxinus  16.5.0-fx-rc8
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cxProbeDefinition.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) 2008-2014, SINTEF Department of Medical Technology
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
9 
10 1. Redistributions of source code must retain the above copyright notice,
11  this list of conditions and the following disclaimer.
12 
13 2. Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16 
17 3. Neither the name of the copyright holder nor the names of its contributors
18  may be used to endorse or promote products derived from this software
19  without specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 =========================================================================*/
32 
33 
34 #ifndef CXPROBEDATA_H_
35 #define CXPROBEDATA_H_
36 
37 #include "cxResourceExport.h"
38 
39 #include <QSize>
40 #include <QMap>
41 #include <QVariant>
42 class QDomNode;
43 #include "cxVector3D.h"
44 #include "cxBoundingBox3D.h"
45 
46 namespace cx
47 {
48 
122 class cxResource_EXPORT ProbeDefinition
123 {
124 public:
125  enum TYPE { tNONE=0,
126  tSECTOR=1,
127  tLINEAR=2
128  };
129 
130 public:
131  ProbeDefinition(TYPE type = tNONE);
132  void addXml(QDomNode dataNode) const;
133  void parseXml(QDomNode dataNode);
134 
135  TYPE getType() const;
136  double getDepthStart() const;
137  double getDepthEnd() const;
138  double getWidth() const;
139  double getTemporalCalibration() const;
140  double getCenterOffset() const;
141  void resample(QSize mSize);
142  QString getUid() const;
143 
144  void setTemporalCalibration(double value);
145  void setType(TYPE type);
146  void setSector(double depthStart, double depthEnd, double width, double centerOffset = 0);
147  void setUid(QString uid);
148 
149  void updateClipRectFromSector();
150  void updateSectorFromClipRect();
151  void applySoundSpeedCompensationFactor(double factor);
152  double getSoundSpeedCompensationFactor() const;
153 
154  Vector3D getOrigin_u() const;
155  DoubleBoundingBox3D getClipRect_u() const;
156 
157  Vector3D getOrigin_p() const;
158  Vector3D getSpacing() const;
159  DoubleBoundingBox3D getClipRect_p() const;
160  QSize getSize() const;
161 
162  void setOrigin_p(Vector3D origin_p);
163  void setSpacing(Vector3D spacing);
164  void setClipRect_p(DoubleBoundingBox3D clipRect_p);
165  void setSize(QSize size);
166 
167  void setUseDigitalVideo(bool val);
168  bool getUseDigitalVideo() const;
169 
170  void setVariable(QString variableName, QVariant value);
171  QVariant getVariable(QString variableName);
172 
173 private:
174  TYPE mType;
175  double mDepthStart;
176  double mDepthEnd;
177  double mWidth;
178  double mTemporalCalibration;
179  double mCenterOffset;
180  double mSoundSpeedCompensationFactor;
181  QString mUid;
182 
183  //ProbeImageData variables
184  Vector3D mOrigin_p;
185  Vector3D mSpacing;//(_p)
186  DoubleBoundingBox3D mClipRect_p;
187  QSize mSize;//_p
188  bool mDigital;
189 
190  //ProbeImageData
191  Vector3D transform_p_to_u(const Vector3D& q_p) const;
192  void addImageXml(QDomNode dataNode) const;
193  void parseImageXml(QDomNode dataNode);
194 
195  QMap<QString, QVariant> mAdditionalVariables;
196 };
197 
198 typedef boost::shared_ptr<ProbeDefinition> ProbeDefinitionPtr;
199 
200 } // namespace cx
201 
202 #endif /*CXPROBEDATA_H_*/
Representation of a floating-point bounding box in 3D. The data are stored as {xmin,xmax,ymin,ymax,zmin,zmax}, in order to simplify communication with vtk.
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:63
Definition of characteristics for an Ultrasound Probe Sector.
boost::shared_ptr< class ProbeDefinition > ProbeDefinitionPtr