本文整理汇总了C++中mitk::datanode::Pointer::IsNull方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointer::IsNull方法的具体用法?C++ Pointer::IsNull怎么用?C++ Pointer::IsNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mitk::datanode::Pointer
的用法示例。
在下文中一共展示了Pointer::IsNull方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetImage
// Helper function to get an image from a data node.
static mitk::Image::Pointer GetImage(mitk::DataNode::Pointer dataNode)
{
if (dataNode.IsNull())
mitkThrow();
mitk::Image::Pointer image = dynamic_cast<mitk::Image*>(dataNode->GetData());
if (image.IsNull())
mitkThrow();
return image;
}
示例2: SetTrackerFiducialsNode
void QmitkFiducialRegistrationWidget::SetTrackerFiducialsNode( mitk::DataNode::Pointer trackerFiducialsNode )
{
if(trackerFiducialsNode.IsNull())
{
FRW_WARN<< "tracker fiducial node is NULL";
return;
}
m_Controls->m_RegistrationTrackingPoints->SetPointSetNode(trackerFiducialsNode); // pass node to pointListWidget
if(m_MultiWidget == NULL)
{
FRW_WARN<< "stdMultiWidget is NULL";
return;
}
m_Controls->m_RegistrationTrackingPoints->SetMultiWidget(m_MultiWidget); // pass multiWidget to pointListWidget
}
示例3: mitkThrow
bool mitk::NodeDisplacementFilter::AddNode( mitk::DataNode::Pointer node )
{
// Consistency Checks
if (node.IsNull())
{
MITK_WARN("NodeDisplacementFilter")
<< "Null Node passed to NodeDisplacementFilter. Ignoring Node....";
return false;
}
if (node->GetData() == 0)
{
MITK_WARN("NodeDisplacementFilter")
<< "Empty Node passed to NodeDisplacementFilter. Ignoring Node....";
return false;
}
if(m_SelectedInput == -1)
{
MITK_ERROR("NodeDisplacementFilter")
<< "Cannot add nodes before input Stream was selected";
mitkThrow() << "Cannot add nodes before input Stream was selected";
}
this->Update(); // make sure we are working on current data
mitk::NavigationData::Pointer reference = this->GetOutput(m_SelectedInput);
if (! reference->IsDataValid())
{
MITK_WARN("NodeDisplacementFilter")
<< "Cannot add node while selected tool is not tracked. Ignoring Node....";
return false;
}
// find transformation and add node
mitk::AffineTransform3D::Pointer inverseAffineTransform = mitk::AffineTransform3D::New();
if ( ! reference->GetAffineTransform3D()->GetInverse(inverseAffineTransform) )
{
MITK_ERROR("NodeDisplacementFilter")
<< "Could not get the inverse transformation of the navigation data transformation.";
mitkThrow() << "Could not get the inverse transformation of the navigation data transformation.";
}
inverseAffineTransform->Compose(node->GetData()->GetGeometry()->GetIndexToWorldTransform(), true);
m_Transforms.push_back(inverseAffineTransform);
m_Nodes.push_back(node);
return true;
}
示例4: foreach
foreach ( mitk::DataNode::Pointer referenceNode, selectedNodes )
{
if (referenceNode.IsNull()) return;
mitk::LabelSetImage::Pointer referenceImage = dynamic_cast<mitk::LabelSetImage*>( referenceNode->GetData() );
assert(referenceImage);
std::string sName = referenceNode->GetName();
QString qName;
qName.sprintf("%s.lsetp",sName.c_str());
QString filename = QFileDialog::getOpenFileName(nullptr,"Load file",QString(),"LabelSet Preset(*.lsetp)");
if ( filename.isEmpty() )
return;
std::string fileName = filename.toStdString();
mitk::LabelSetIOHelper::LoadLabelSetImagePreset(fileName, referenceImage);
}