CustusX  15.4.0-beta
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cxProbeData.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 class QDomNode;
41 #include "cxVector3D.h"
42 #include "cxBoundingBox3D.h"
43 
44 namespace cx
45 {
46 
118 class cxResource_EXPORT ProbeDefinition
119 {
120 public:
121  enum TYPE { tNONE=0,
122  tSECTOR=1,
123  tLINEAR=2
124  };
125 
126 public:
127  ProbeDefinition(TYPE type = tNONE);
128  void addXml(QDomNode dataNode) const;
129  void parseXml(QDomNode dataNode);
130 
131  TYPE getType() const;
132  double getDepthStart() const;
133  double getDepthEnd() const;
134  double getWidth() const;
135  double getTemporalCalibration() const;
136  double getCenterOffset() const;
137  void resample(QSize mSize);
138  QString getUid() const;
139 
140  void setTemporalCalibration(double value);
141  void setType(TYPE type);
142  void setSector(double depthStart, double depthEnd, double width, double centerOffset = 0);
143  void setUid(QString uid);
144 
145  void updateClipRectFromSector();
146  void updateSectorFromClipRect();
147  void applySoundSpeedCompensationFactor(double factor);
148 
149  Vector3D getOrigin_u() const;
150  DoubleBoundingBox3D getClipRect_u() const;
151 
152  Vector3D getOrigin_p() const;
153  Vector3D getSpacing() const;
154  DoubleBoundingBox3D getClipRect_p() const;
155  QSize getSize() const;
156 
157  void setOrigin_p(Vector3D origin_p);
158  void setSpacing(Vector3D spacing);
159  void setClipRect_p(DoubleBoundingBox3D clipRect_p);
160  void setSize(QSize size);
161 
162  void setUseDigitalVideo(bool val);
163  bool getUseDigitalVideo() const;
164 
165 private:
166  TYPE mType;
167  double mDepthStart;
168  double mDepthEnd;
169  double mWidth;
170  double mTemporalCalibration;
171  double mCenterOffset;
172  double mSoundSpeedCompensationFactor;
173  QString mUid;
174 
175  //ProbeImageData variables
176  Vector3D mOrigin_p;
177  Vector3D mSpacing;//(_p)
178  DoubleBoundingBox3D mClipRect_p;
179  QSize mSize;//_p
180  bool mDigital;
181 
182  //ProbeImageData
183  Vector3D transform_p_to_u(const Vector3D& q_p) const;
184  void addImageXml(QDomNode dataNode) const;
185  void parseImageXml(QDomNode dataNode);
186 };
187 
188 typedef boost::shared_ptr<ProbeDefinition> ProbeDefinitionPtr;
189 
190 } // namespace cx
191 
192 #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.
Definition: cxProbeData.h:118
boost::shared_ptr< class ProbeDefinition > ProbeDefinitionPtr