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