14 #include <vtkXMLDataElement.h> 15 #include <vtkXMLUtilities.h> 16 #include <vtkImageData.h> 22 #define KEY_PROBE_TYPE "ProbeType" 23 #define KEY_ORIGIN "Origin" 24 #define KEY_ANGLES "Angles" 25 #define KEY_BOUNDING_BOX "BouningBox" 26 #define KEY_DEPTHS "Depths" 27 #define KEY_LINEAR_WIDTH "LinearWidth" 28 #define KEY_SPACING_X "SpacingX" 29 #define KEY_SPACING_Y "SpacingY" 88 retval = retval && (mOrigin.size() == 3);
89 retval = retval && ((mAngles.size() == 2) || (mAngles.size() == 4));
90 retval = retval && ((mBouningBox.size() == 4) || (mBouningBox.size() == 6));
91 retval = retval && (mDepths.size() == 2);
93 retval = retval && (mLinearWidth <
tooLarge);
96 retval = retval && (mSpacingX <
tooLarge);
97 retval = retval && (mSpacingY <
tooLarge);
98 retval = retval && !
similar(mSpacingX, 0);
99 retval = retval && !
similar(mSpacingY, 0);
123 QString name = QString(header.deviceName.c_str());
124 QString value = message;
138 std::vector<double> ProbeDefinitionFromStringMessages::toDoubleVector(QString
values, QString separator)
const 140 std::vector<double> retval;
141 QStringList valueList = values.split(separator);
142 for (
int i = 0; i < valueList.size(); ++i)
144 double doublevalue = valueList[i].toDouble();
145 retval.push_back(doublevalue);
152 int intValue = value.toInt();
153 double doubleValue = value.toDouble();
154 std::vector<double> doubleVector = toDoubleVector(value);
246 probeDefinition->setUid(uid);
247 probeDefinition->setOrigin_p(origin_p);
248 probeDefinition->setSpacing(spacing);
249 probeDefinition->setClipRect_p(this->getBoundinBox());
251 probeDefinition->setSize(this->getSize());
252 probeDefinition->setUseDigitalVideo(
true);
254 return probeDefinition;
264 CX_LOG_ERROR() <<
"ProbeDefinitionFromStringMessages::initProbeDefinition: Incorrect probe type: " <<
mSectorInfo->mProbeType;
266 return probeDefinition;
269 double ProbeDefinitionFromStringMessages::getWidth()
283 QSize ProbeDefinitionFromStringMessages::getSize()
285 Eigen::Array3i dimensions(
mSectorInfo->mImage->getBaseVtkImageData()->GetDimensions());
286 QSize size(dimensions[0], dimensions[1]);
294 this->getBoundingBoxThirdDimensionStart(),
295 this->getBoundingBoxThirdDimensionEnd());
299 double ProbeDefinitionFromStringMessages::getBoundingBoxThirdDimensionStart()
const 307 double ProbeDefinitionFromStringMessages::getBoundingBoxThirdDimensionEnd()
const
ProbeDefinitionFromStringMessages()
US beam is emitted straight forward.
boost::shared_ptr< class Image > ImagePtr
void parseValue(QString name, QString value)
std::vector< double > mBouningBox
ProbeDefinitionPtr createProbeDefintion(QString uid)
void setImage(ImagePtr image)
US beam is emitted radially in a flat cone.
std::vector< double > mDepths
SectorInfoPtr mSectorInfo
void parseStringMessage(igtlio::BaseConverter::HeaderData header, QString message)
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.
std::vector< double > mAngles
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition of characteristics for an Ultrasound Probe Sector.
CompositeGenerator< T > values(T val1, T val2)
bool similar(const CameraInfo &lhs, const CameraInfo &rhs, double tol)
boost::shared_ptr< class ProbeDefinition > ProbeDefinitionPtr
std::vector< double > mOrigin
ProbeDefinition::TYPE mProbeType
Namespace for all CustusX production code.