35 #include <vtkImageData.h>
37 #include "igtl_status.h"
52 igtl::StringMessage::Pointer retval;
53 retval = igtl::StringMessage::New();
54 retval->SetDeviceName(
"CustusX");
55 retval->SetString(msg.toStdString().c_str());
61 QString devicename(msg->GetDeviceName());
62 QString message(msg->GetString());
63 QString retval = devicename +
": " + message;
69 QString code = this->convertIGTLinkStatusCodes(msg->GetCode());
70 QString retval = code;
82 igtl::Matrix4x4 matrix;
83 msg->GetMatrix(matrix);
84 Transform3D retval = Transform3D::fromFloatArray(matrix);
94 retval->SetOrigin(input->getOrigin_p().data());
96 retval->SetProbeType(input->getType());
98 retval->SetDepthStart(input->getDepthStart());
99 retval->SetDepthEnd(input->getDepthEnd());
100 retval->SetWidth(input->getWidth());
120 probeMessage->GetDepthStart(),
121 probeMessage->GetDepthEnd(),
122 probeMessage->GetWidth(),
124 retval->setOrigin_p(
Vector3D(probeMessage->GetOrigin()));
125 retval->setUid(probeMessage->GetDeviceName());
135 imageMessage->GetDimensions(size);
136 imageMessage->GetSpacing(spacing);
138 retval->setSpacing(
Vector3D(spacing[0], spacing[1], spacing[2]));
139 retval->setSize(QSize(size[0], size[1]));
140 retval->setClipRect_p(
DoubleBoundingBox3D(0, retval->getSize().width(), 0, retval->getSize().height(), 0, 0));
157 QString IGTLinkConversion::convertIGTLinkStatusCodes(
const int code)
162 case IGTL_STATUS_INVALID:
163 retval =
"Status invalid";
166 retval =
"Ok / Freeze mode on";
168 case IGTL_STATUS_UNKNOWN_ERROR:
169 retval =
"Unknown error";
171 case IGTL_STATUS_PANICK_MODE:
172 retval =
"Panick mode";
174 case IGTL_STATUS_NOT_FOUND:
175 retval =
"Not found";
177 case IGTL_STATUS_ACCESS_DENIED:
178 retval =
"Access denied";
180 case IGTL_STATUS_BUSY:
183 case IGTL_STATUS_TIME_OUT:
184 retval =
"Time out / Connection lost";
186 case IGTL_STATUS_OVERFLOW:
187 retval =
"Overflow / Can't be reached";
189 case IGTL_STATUS_CHECKSUM_ERROR:
190 retval =
"Checksum error";
192 case IGTL_STATUS_CONFIG_ERROR:
193 retval =
"Configuration error";
195 case IGTL_STATUS_RESOURCE_ERROR:
196 retval =
"Not enough resource (memory, storage etc)";
198 case IGTL_STATUS_ILLEGAL_INSTRUCTION:
199 retval =
"Illegal/Unknown instruction";
201 case IGTL_STATUS_NOT_READY:
202 retval =
"Device not ready (starting up)";
204 case IGTL_STATUS_MANUAL_MODE:
205 retval =
"Manual mode (device does not accept commands";
207 case IGTL_STATUS_DISABLED:
208 retval =
"Device disabled";
210 case IGTL_STATUS_NOT_PRESENT:
211 retval =
"Device not present";
213 case IGTL_STATUS_UNKNOWN_VERSION:
214 retval =
"Device version not known";
216 case IGTL_STATUS_HARDWARE_FAILURE:
217 retval =
"Hardware failure";
219 case IGTL_STATUS_SHUT_DOWN:
220 retval =
"Exiting / shut down in progress";
223 retval =
"Could not determine what OpenIGTLink status code means.";
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
boost::shared_ptr< class Image > ImagePtr
cstring_cast_Placeholder cstring_cast(const T &val)
QString decode(igtl::StringMessage::Pointer msg)
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 of characteristics for an Ultrasound Probe Sector.
igtl::StringMessage::Pointer encode(QString msg)
igtl::SmartPointer< Self > Pointer
boost::shared_ptr< class ProbeDefinition > ProbeDefinitionPtr
ImagePtr decode(igtl::ImageMessage::Pointer msg)