本文整理汇总了C++中DataStorage::Exists方法的典型用法代码示例。如果您正苦于以下问题:C++ DataStorage::Exists方法的具体用法?C++ DataStorage::Exists怎么用?C++ DataStorage::Exists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataStorage
的用法示例。
在下文中一共展示了DataStorage::Exists方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void mitk::PickingTool::OnPointAdded()
{
if (m_WorkingData != this->GetWorkingData())
{
DataStorage *dataStorage = this->GetDataStorage();
if (dataStorage->Exists(m_PointSetNode))
{
dataStorage->Remove(m_PointSetNode);
dataStorage->Add(m_PointSetNode, this->GetWorkingData());
}
if (dataStorage->Exists(m_ResultNode))
{
dataStorage->Remove(m_ResultNode);
dataStorage->Add(m_ResultNode, this->GetWorkingData());
}
m_WorkingData = this->GetWorkingData();
}
// Perform region growing/picking
int timeStep =
mitk::BaseRenderer::GetInstance(mitk::BaseRenderer::GetRenderWindowByName("stdmulti.widget1"))->GetTimeStep();
mitk::PointSet::PointType seedPoint = m_PointSet->GetPointSet(timeStep)->GetPoints()->Begin().Value();
// as we want to pick a region from our segmentation image use the working data from ToolManager
mitk::Image::Pointer orgImage = dynamic_cast<mitk::Image *>(m_ToolManager->GetWorkingData(0)->GetData());
if (orgImage.IsNotNull())
{
if (orgImage->GetDimension() == 4)
{ // there may be 4D segmentation data even though we currently don't support that
mitk::ImageTimeSelector::Pointer timeSelector = mitk::ImageTimeSelector::New();
timeSelector->SetInput(orgImage);
timeSelector->SetTimeNr(timeStep);
timeSelector->UpdateLargestPossibleRegion();
mitk::Image *timedImage = timeSelector->GetOutput();
AccessByItk_2(timedImage, StartRegionGrowing, timedImage->GetGeometry(), seedPoint);
}
else if (orgImage->GetDimension() == 3)
{
AccessByItk_2(orgImage, StartRegionGrowing, orgImage->GetGeometry(), seedPoint);
}
this->m_PointSet->Clear();
}
}
示例2:
void mitk::PickingTool::Activated()
{
DataStorage* dataStorage = this->GetDataStorage();
m_WorkingData = this->GetWorkingData();
//add to datastorage and enable interaction
if (!dataStorage->Exists(m_PointSetNode))
dataStorage->Add(m_PointSetNode, m_WorkingData);
// now add result to data tree
dataStorage->Add(m_ResultNode, m_WorkingData);
}