本文整理汇总了C++中mitk::image::Pointer::SetSlice方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointer::SetSlice方法的具体用法?C++ Pointer::SetSlice怎么用?C++ Pointer::SetSlice使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mitk::image::Pointer
的用法示例。
在下文中一共展示了Pointer::SetSlice方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: inputReadAccessor
void mitk::USTelemedImageSource::GetNextRawImage( mitk::Image::Pointer& image)
{
if ( image.IsNull() ) { image = mitk::Image::New(); }
//get the actual resolution to check if it changed. We have to do this every time because the geometry takes a few frames to adapt
Usgfw2Lib::tagImageResolution resolutionInMetersActual;
m_ImageProperties->GetResolution(&resolutionInMetersActual, 0);
if (m_OldnXPelsPerUnit != resolutionInMetersActual.nXPelsPerUnit || m_OldnYPelsPerUnit != resolutionInMetersActual.nYPelsPerUnit)
{
//we can only update if the image exists and has a geometry
if (m_Image.IsNotNull() && m_Image->GetGeometry() != nullptr)
{
m_OldnXPelsPerUnit = resolutionInMetersActual.nXPelsPerUnit;
m_OldnYPelsPerUnit = resolutionInMetersActual.nYPelsPerUnit;
UpdateImageGeometry();
}
}
//now update image
if ( m_Image->IsInitialized() )
{
m_ImageMutex->Lock();
// copy contents of the given image into the member variable
image->Initialize(m_Image->GetPixelType(), m_Image->GetDimension(), m_Image->GetDimensions());
mitk::ImageReadAccessor inputReadAccessor(m_Image, m_Image->GetSliceData(0,0,0));
image->SetSlice(inputReadAccessor.GetData());
image->SetGeometry(m_Image->GetGeometry());
m_ImageMutex->Unlock();
}
}