本文整理汇总了C++中mitk::datanode::Pointer::GetStringProperty方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointer::GetStringProperty方法的具体用法?C++ Pointer::GetStringProperty怎么用?C++ Pointer::GetStringProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mitk::datanode::Pointer
的用法示例。
在下文中一共展示了Pointer::GetStringProperty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
mitk::NavigationTool::Pointer mitk::NavigationToolReader::ConvertDataNodeToNavigationTool(mitk::DataNode::Pointer node, std::string toolPath)
{
mitk::NavigationTool::Pointer returnValue = mitk::NavigationTool::New();
//DateTreeNode with Name and Surface
returnValue->SetDataNode(node);
//Identifier
std::string identifier;
node->GetStringProperty("identifier", identifier);
returnValue->SetIdentifier(identifier);
node->RemoveProperty("identifier");
//Serial Number
std::string serial;
node->GetStringProperty("serial number", serial);
returnValue->SetSerialNumber(serial);
node->RemoveProperty("serial number");
//Tracking Device
mitk::TrackingDeviceType device_type;
node->GetStringProperty("tracking device type", device_type);
//For backward compability with old tool stroages (before 12/2015 device_type was an int value, now it is string)
if (device_type.size() == 0)
{
/*
This was the old enum. Numbers inserted for better readibility. Don't delete this if-case to allow loading of ols storages...
enum TrackingDeviceType
{
0 NDIPolaris, ///< Polaris: optical Tracker from NDI
1 NDIAurora, ///< Aurora: electromagnetic Tracker from NDI
2 ClaronMicron, ///< Micron Tracker: optical Tracker from Claron
3 IntuitiveDaVinci, ///< Intuitive Surgical: DaVinci Telemanipulator API Interface
4 AscensionMicroBird, ///< Ascension microBird / PCIBird family
5 VirtualTracker, ///< Virtual Tracking device class that produces random tracking coordinates
6 TrackingSystemNotSpecified, ///< entry for not specified or initialized tracking system
7 TrackingSystemInvalid, ///< entry for invalid state (mainly for testing)
8 NPOptitrack, ///< NaturalPoint: Optitrack optical Tracking System
9 OpenIGTLinkTrackingDeviceConnection ///< Device which is connected via open igt link
};
*/
int device_type_old;
node->GetIntProperty("tracking device type", device_type_old);
switch (device_type_old)
{
case 0:device_type = mitk::NDIPolarisTypeInformation::GetTrackingDeviceName(); break;
case 1:device_type = mitk::NDIAuroraTypeInformation::GetTrackingDeviceName(); break;
case 2:device_type = mitk::MicronTrackerTypeInformation::GetTrackingDeviceName(); break;
case 3:device_type = "IntuitiveDaVinci"; break;
case 4:device_type = "AscensionMicroBird"; break;
case 5:device_type = mitk::VirtualTrackerTypeInformation::GetTrackingDeviceName(); break;
case 6:device_type = mitk::UnspecifiedTrackingTypeInformation::GetTrackingDeviceName(); break;
case 7:device_type = "TrackingSystemInvalid"; break;
case 8:device_type = mitk::NPOptitrackTrackingTypeInformation::GetTrackingDeviceName(); break;
case 9:device_type = mitk::OpenIGTLinkTypeInformation::GetTrackingDeviceName(); break;
default: device_type = mitk::UnspecifiedTrackingTypeInformation::GetTrackingDeviceName(); break; //default... unknown...
}
}
node->RemoveProperty("tracking device type");
returnValue->SetTrackingDeviceType(static_cast<mitk::TrackingDeviceType>(device_type));
//Tool Type
int type;
node->GetIntProperty("tracking tool type", type);
returnValue->SetType(static_cast<mitk::NavigationTool::NavigationToolType>(type));
node->RemoveProperty("tracking tool type");
//Calibration File Name
std::string calibration_filename;
node->GetStringProperty("toolfileName", calibration_filename);
if (calibration_filename == "none")
{
returnValue->SetCalibrationFile("none");
}
else
{
std::string calibration_filename_with_path = toolPath + Poco::Path::separator() + calibration_filename;
returnValue->SetCalibrationFile(calibration_filename_with_path);
}
node->RemoveProperty("toolfileName");
//Tool Landmarks
mitk::PointSet::Pointer ToolRegLandmarks = mitk::PointSet::New();
mitk::PointSet::Pointer ToolCalLandmarks = mitk::PointSet::New();
std::string RegLandmarksString;
std::string CalLandmarksString;
node->GetStringProperty("ToolRegistrationLandmarks", RegLandmarksString);
node->GetStringProperty("ToolCalibrationLandmarks", CalLandmarksString);
ToolRegLandmarks = ConvertStringToPointSet(RegLandmarksString);
ToolCalLandmarks = ConvertStringToPointSet(CalLandmarksString);
returnValue->SetToolLandmarks(ToolRegLandmarks);
returnValue->SetToolControlPoints(ToolCalLandmarks);
//.........这里部分代码省略.........
示例2: if
mitk::NavigationTool::Pointer mitk::NavigationToolReader::ConvertDataNodeToNavigationTool(mitk::DataNode::Pointer node, std::string toolPath)
{
mitk::NavigationTool::Pointer returnValue = mitk::NavigationTool::New();
//DateTreeNode with Name and Surface
mitk::DataNode::Pointer newNode = mitk::DataNode::New();
newNode->SetName(node->GetName());
newNode->SetData(node->GetData());
returnValue->SetDataNode(newNode);
//Identifier
std::string identifier;
node->GetStringProperty("identifier",identifier);
returnValue->SetIdentifier(identifier);
//Serial Number
std::string serial;
node->GetStringProperty("serial number",serial);
returnValue->SetSerialNumber(serial);
//Tracking Device
int device_type;
node->GetIntProperty("tracking device type",device_type);
returnValue->SetTrackingDeviceType(static_cast<mitk::TrackingDeviceType>(device_type));
//Tool Type
int type;
node->GetIntProperty("tracking tool type",type);
returnValue->SetType(static_cast<mitk::NavigationTool::NavigationToolType>(type));
//Calibration File Name
std::string calibration_filename;
node->GetStringProperty("toolfileName",calibration_filename);
if (calibration_filename=="none")
{
returnValue->SetCalibrationFile("none");
}
else
{
std::string calibration_filename_with_path = toolPath + Poco::Path::separator() + calibration_filename;
returnValue->SetCalibrationFile(calibration_filename_with_path);
}
//Tool Landmarks
mitk::PointSet::Pointer ToolRegLandmarks = mitk::PointSet::New();
mitk::PointSet::Pointer ToolCalLandmarks = mitk::PointSet::New();
std::string RegLandmarksString;
std::string CalLandmarksString;
node->GetStringProperty("ToolRegistrationLandmarks",RegLandmarksString);
node->GetStringProperty("ToolCalibrationLandmarks",CalLandmarksString);
ToolRegLandmarks = ConvertStringToPointSet(RegLandmarksString);
ToolCalLandmarks = ConvertStringToPointSet(CalLandmarksString);
returnValue->SetToolRegistrationLandmarks(ToolRegLandmarks);
returnValue->SetToolCalibrationLandmarks(ToolCalLandmarks);
//Tool Tip
std::string toolTipPositionString;
std::string toolTipOrientationString;
bool positionSet = node->GetStringProperty("ToolTipPosition",toolTipPositionString);
bool orientationSet = node->GetStringProperty("ToolTipOrientation",toolTipOrientationString);
if(positionSet && orientationSet) //only define tooltip if it is set
{
returnValue->SetToolTipPosition(ConvertStringToPoint(toolTipPositionString));
returnValue->SetToolTipOrientation(ConvertStringToQuaternion(toolTipOrientationString));
}
else if(positionSet != orientationSet)
{
MITK_WARN << "Tooltip definition incomplete: position and orientation have to be set! Skipping tooltip definition.";
}
return returnValue;
}