Ejemplo n.º 1
0
bool OpenIGTLinkProtocol::unpackBody(const igtl::MessageBase::Pointer &body)
{
    int c = body->Unpack(this->doCRC());
    if (c & igtl::MessageHeader::UNPACK_BODY)
    {
        this->translate(mHeader, body);
    }
    else
    {
        CX_LOG_CHANNEL_ERROR(CX_OPENIGTLINK_CHANNEL_NAME) << "Could not unpack the body of type: " << body->GetDeviceType();
        return false;
    }
    return true;
}
Ejemplo n.º 2
0
bool OpenIGTLinkProtocol::unpackHeader(const igtl::MessageHeader::Pointer &header) const
{
    int doCRCOnHeader = 1;
    int c = header->Unpack(doCRCOnHeader);
    if (c & igtl::MessageHeader::UNPACK_HEADER)
    {
        //CX_LOG_DEBUG() << "unpacked header of type " << header->GetDeviceType();
        return true;
    }
    else
    {
        CX_LOG_CHANNEL_ERROR(CX_OPENIGTLINK_CHANNEL_NAME) << "Could not unpack header";
        return false;
    }
}
Ejemplo n.º 3
0
void DicomWidget::setupDatabaseDirectory()
{
    QString databaseDirectory = this->getDICOMDatabaseDirectory();

	QDir qdir(databaseDirectory);
	if ( !qdir.exists(databaseDirectory) )
	{
		if ( !qdir.mkpath(databaseDirectory) )
		{
			CX_LOG_CHANNEL_ERROR("dicom") << "Could not create database directory \"" << databaseDirectory;
		}
	}

    CX_LOG_CHANNEL_INFO("dicom") << "DatabaseDirectory set to: " << databaseDirectory;
	mBrowser->setDatabaseDirectory(databaseDirectory);
}