14 #include <vtkXMLDataElement.h> 15 #include <vtkXMLUtilities.h> 16 #include <vtkImageData.h> 17 #include <igtlioUsSectorDefinitions.h> 78 retval = retval && (mOrigin.size() == 3);
79 retval = retval && ((mAngles.size() == 2) || (mAngles.size() == 4));
80 retval = retval && ((mBoundingBox.size() == 4) || (mBoundingBox.size() == 6));
81 retval = retval && (mDepths.size() == 2);
83 retval = retval && (mLinearWidth <
tooLarge);
86 retval = retval && (mSpacingX <
tooLarge);
87 retval = retval && (mSpacingY <
tooLarge);
88 retval = retval && !
similar(mSpacingX, 0);
89 retval = retval && !
similar(mSpacingY, 0);
113 QString name = QString(header.deviceName.c_str());
114 QString value = message;
128 std::vector<double> ProbeDefinitionFromStringMessages::toDoubleVector(QString
values, QString separator)
const 130 std::vector<double> retval;
131 QStringList valueList = values.split(separator);
132 for (
int i = 0; i < valueList.size(); ++i)
134 double doublevalue = valueList[i].toDouble();
135 retval.push_back(doublevalue);
142 int intValue = value.toInt();
143 double doubleValue = value.toDouble();
144 std::vector<double> doubleVector = toDoubleVector(value);
150 if (name == IGTLIO_KEY_PROBE_TYPE)
158 else if (name == IGTLIO_KEY_ORIGIN)
166 else if (name == IGTLIO_KEY_ANGLES)
174 else if (name == IGTLIO_KEY_BOUNDING_BOX)
182 else if (name == IGTLIO_KEY_DEPTHS)
190 else if (name == IGTLIO_KEY_LINEAR_WIDTH)
198 else if (name == IGTLIO_KEY_SPACING_X)
202 else if (name == IGTLIO_KEY_SPACING_Y)
236 probeDefinition->setUid(uid);
237 probeDefinition->setOrigin_p(origin_p);
238 probeDefinition->setSpacing(spacing);
239 probeDefinition->setClipRect_p(this->getBoundinBox());
241 probeDefinition->setSize(this->getSize());
242 probeDefinition->setUseDigitalVideo(
true);
244 return probeDefinition;
254 CX_LOG_ERROR() <<
"ProbeDefinitionFromStringMessages::initProbeDefinition: Incorrect probe type: " <<
mSectorInfo->mProbeType;
256 return probeDefinition;
259 double ProbeDefinitionFromStringMessages::getWidth()
273 QSize ProbeDefinitionFromStringMessages::getSize()
275 Eigen::Array3i dimensions(
mSectorInfo->mImage->getBaseVtkImageData()->GetDimensions());
276 QSize size(dimensions[0], dimensions[1]);
284 this->getBoundingBoxThirdDimensionStart(),
285 this->getBoundingBoxThirdDimensionEnd());
289 double ProbeDefinitionFromStringMessages::getBoundingBoxThirdDimensionStart()
const 297 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)
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.