14 #include <vtkImageData.h> 16 #include "igtl_status.h" 31 igtl::StringMessage::Pointer retval;
32 retval = igtl::StringMessage::New();
33 retval->SetDeviceName(
"CustusX");
34 retval->SetString(msg.toStdString().c_str());
40 QString devicename(msg->GetDeviceName());
41 QString message(msg->GetString());
42 QString retval = devicename +
": " + message;
48 QString code = this->convertIGTLinkStatusCodes(msg->GetCode());
49 QString retval = code;
61 igtl::Matrix4x4 matrix;
62 msg->GetMatrix(matrix);
63 Transform3D retval = Transform3D::fromFloatArray(matrix);
73 retval->SetOrigin(input->getOrigin_p().data());
75 retval->SetProbeType(input->getType());
77 retval->SetDepthStart(input->getDepthStart());
78 retval->SetDepthEnd(input->getDepthEnd());
79 retval->SetWidth(input->getWidth());
99 probeMessage->GetDepthStart(),
100 probeMessage->GetDepthEnd(),
101 probeMessage->GetWidth(),
103 retval->setOrigin_p(
Vector3D(probeMessage->GetOrigin()));
104 retval->setUid(probeMessage->GetDeviceName());
114 imageMessage->GetDimensions(size);
115 imageMessage->GetSpacing(spacing);
117 retval->setSpacing(
Vector3D(spacing[0], spacing[1], spacing[2]));
118 retval->setSize(QSize(size[0], size[1]));
119 retval->setClipRect_p(
DoubleBoundingBox3D(0, retval->getSize().width(), 0, retval->getSize().height(), 0, 0));
136 QString IGTLinkConversion::convertIGTLinkStatusCodes(
const int code)
141 case IGTL_STATUS_INVALID:
142 retval =
"Status invalid";
145 retval =
"Ok / Freeze mode on";
147 case IGTL_STATUS_UNKNOWN_ERROR:
148 retval =
"Unknown error";
150 case IGTL_STATUS_PANICK_MODE:
151 retval =
"Panick mode";
153 case IGTL_STATUS_NOT_FOUND:
154 retval =
"Not found";
156 case IGTL_STATUS_ACCESS_DENIED:
157 retval =
"Access denied";
159 case IGTL_STATUS_BUSY:
162 case IGTL_STATUS_TIME_OUT:
163 retval =
"Time out / Connection lost";
165 case IGTL_STATUS_OVERFLOW:
166 retval =
"Overflow / Can't be reached";
168 case IGTL_STATUS_CHECKSUM_ERROR:
169 retval =
"Checksum error";
171 case IGTL_STATUS_CONFIG_ERROR:
172 retval =
"Configuration error";
174 case IGTL_STATUS_RESOURCE_ERROR:
175 retval =
"Not enough resource (memory, storage etc)";
177 case IGTL_STATUS_ILLEGAL_INSTRUCTION:
178 retval =
"Illegal/Unknown instruction";
180 case IGTL_STATUS_NOT_READY:
181 retval =
"Device not ready (starting up)";
183 case IGTL_STATUS_MANUAL_MODE:
184 retval =
"Manual mode (device does not accept commands";
186 case IGTL_STATUS_DISABLED:
187 retval =
"Device disabled";
189 case IGTL_STATUS_NOT_PRESENT:
190 retval =
"Device not present";
192 case IGTL_STATUS_UNKNOWN_VERSION:
193 retval =
"Device version not known";
195 case IGTL_STATUS_HARDWARE_FAILURE:
196 retval =
"Hardware failure";
198 case IGTL_STATUS_SHUT_DOWN:
199 retval =
"Exiting / shut down in progress";
202 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)
Namespace for all CustusX production code.