14 #include <vtkXMLDataElement.h> 15 #include <vtkXMLUtilities.h> 16 #include <vtkImageData.h> 17 #include <igtlioUsSectorDefinitions.h> 93 retval = retval && (mOrigin.size() == 3);
94 retval = retval && ((mAngles.size() == 2) || (mAngles.size() == 4));
95 retval = retval && ((mBoundingBox.size() == 4) || (mBoundingBox.size() == 6));
96 retval = retval && (mDepths.size() == 2);
98 retval = retval && (mLinearWidth <
tooLarge);
100 Vector3D spacing = mImage->getSpacing();
103 retval = retval && (mSpacingX <
tooLarge);
104 retval = retval && (mSpacingY <
tooLarge);
105 retval = retval && !
similar(mSpacingX, 0);
106 retval = retval && !
similar(mSpacingY, 0);
107 retval = retval && !
similar(mSpacingZ, 0);
132 QString name = QString(header.deviceName.c_str());
133 QString value = message;
147 std::vector<double> ProbeDefinitionFromStringMessages::toDoubleVector(QString
values, QString separator)
const 149 std::vector<double> retval;
150 QStringList valueList = values.split(separator);
151 for (
int i = 0; i < valueList.size(); ++i)
153 double doublevalue = valueList[i].toDouble();
154 retval.push_back(doublevalue);
161 int intValue = value.toInt();
162 double doubleValue = value.toDouble();
163 std::vector<double> doubleVector = toDoubleVector(value);
173 if (name == IGTLIO_KEY_PROBE_TYPE)
181 else if (name == IGTLIO_KEY_ORIGIN)
189 else if (name == IGTLIO_KEY_ANGLES)
197 else if (name == IGTLIO_KEY_BOUNDING_BOX)
205 else if (name == IGTLIO_KEY_DEPTHS)
213 else if (name == IGTLIO_KEY_LINEAR_WIDTH)
221 else if (name == IGTLIO_KEY_SPACING_X)
230 else if (name == IGTLIO_KEY_SPACING_Y)
238 else if (name ==
"SpacingZ")
292 probeDefinition->setUid(uid);
293 probeDefinition->setOrigin_p(origin_p);
294 probeDefinition->setSpacing(spacing);
295 probeDefinition->setClipRect_p(this->getBoundinBox());
297 probeDefinition->setSize(this->getSize());
298 probeDefinition->setUseDigitalVideo(
true);
300 return probeDefinition;
310 CX_LOG_ERROR() <<
"ProbeDefinitionFromStringMessages::initProbeDefinition: Incorrect probe type: " <<
mSectorInfo->mProbeType;
312 return probeDefinition;
315 double ProbeDefinitionFromStringMessages::getWidth()
329 QSize ProbeDefinitionFromStringMessages::getSize()
331 Eigen::Array3i dimensions(
mSectorInfo->mImage->getBaseVtkImageData()->GetDimensions());
332 QSize size(dimensions[0], dimensions[1]);
340 this->getBoundingBoxThirdDimensionStart(),
341 this->getBoundingBoxThirdDimensionEnd());
345 double ProbeDefinitionFromStringMessages::getBoundingBoxThirdDimensionStart()
const 353 double ProbeDefinitionFromStringMessages::getBoundingBoxThirdDimensionEnd()
const std::vector< double > mBoundingBox
ProbeDefinitionFromStringMessages()
US beam is emitted straight forward.
boost::shared_ptr< class Image > ImagePtr
void parseValue(QString name, QString value)
ProbeDefinitionPtr createProbeDefintion(QString uid)
void setImage(ImagePtr image)
bool validSpacing(Vector3D spacing)
US beam is emitted radially in a flat cone.
std::vector< double > mDepths
SectorInfoPtr mSectorInfo
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.
void parseStringMessage(igtlioBaseConverter::HeaderData header, QString message)
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.