本文整理汇总了C++中mitk::image::Pointer::AddObserver方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointer::AddObserver方法的具体用法?C++ Pointer::AddObserver怎么用?C++ Pointer::AddObserver使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mitk::image::Pointer
的用法示例。
在下文中一共展示了Pointer::AddObserver方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool mitk::SurfaceInterpolationController::ReplaceInterpolationSession(mitk::Image::Pointer oldSession, mitk::Image::Pointer newSession)
{
if (oldSession.IsNull() || newSession.IsNull())
return false;
if (oldSession.GetPointer() == newSession.GetPointer())
return false;
if (!mitk::Equal(*(oldSession->GetGeometry()), *(newSession->GetGeometry()), mitk::eps, false))
return false;
auto it = m_ListOfInterpolationSessions.find(oldSession.GetPointer());
if (it == m_ListOfInterpolationSessions.end())
return false;
ContourPositionInformationVec2D oldList = (*it).second;
m_ListOfInterpolationSessions.insert(std::pair<mitk::Image*, ContourPositionInformationVec2D>(newSession.GetPointer(), oldList));
itk::MemberCommand<SurfaceInterpolationController>::Pointer command = itk::MemberCommand<SurfaceInterpolationController>::New();
command->SetCallbackFunction(this, &SurfaceInterpolationController::OnSegmentationDeleted);
m_SegmentationObserverTags.insert( std::pair<mitk::Image*, unsigned long>( newSession, newSession->AddObserver( itk::DeleteEvent(), command ) ) );
if (m_SelectedSegmentation == oldSession)
m_SelectedSegmentation = newSession;
mitk::ImageTimeSelector::Pointer timeSelector = mitk::ImageTimeSelector::New();
timeSelector->SetInput( m_SelectedSegmentation );
timeSelector->SetTimeNr( m_CurrentTimeStep );
timeSelector->SetChannelNr( 0 );
timeSelector->Update();
mitk::Image::Pointer refSegImage = timeSelector->GetOutput();
m_NormalsFilter->SetSegmentationBinaryImage(refSegImage);
this->RemoveInterpolationSession(oldSession);
return true;
}