本文整理汇总了C++中mitk::image::Pointer::GetTimeGeometry方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointer::GetTimeGeometry方法的具体用法?C++ Pointer::GetTimeGeometry怎么用?C++ Pointer::GetTimeGeometry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mitk::image::Pointer
的用法示例。
在下文中一共展示了Pointer::GetTimeGeometry方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setUp
void setUp() override
{
m_ReferenceImage = mitk::IOUtil::LoadImage(GetTestDataFilePath("Pic3D.nrrd"));
CPPUNIT_ASSERT_MESSAGE("Failed to load image for test: [Pic3D.nrrd]", m_ReferenceImage.IsNotNull());
m_InterpolationController = mitk::SegmentationInterpolationController::GetInstance();
// Create empty segmentation
// Surely there must be a better way to get an image with all zeros?
m_SegmentationImage = mitk::Image::New();
const mitk::PixelType pixelType(mitk::MakeScalarPixelType<mitk::Tool::DefaultSegmentationDataType>());
m_SegmentationImage->Initialize(pixelType, m_ReferenceImage->GetDimension(), m_ReferenceImage->GetDimensions());
m_SegmentationImage->SetClonedTimeGeometry(m_ReferenceImage->GetTimeGeometry());
unsigned int size = sizeof(mitk::Tool::DefaultSegmentationDataType);
for (unsigned int dim = 0; dim < m_SegmentationImage->GetDimension(); ++dim)
{
size *= m_SegmentationImage->GetDimension(dim);
}
mitk::ImageWriteAccessor imageAccessor(m_SegmentationImage);
memset(imageAccessor.GetData(), 0, size);
// Work in the center of the image (Pic3D)
m_CenterPoint = {{ 127, 127, 25 }};
}
示例2: GetGeometry
// Helper function to get a geometry of an image for a specific time step.
static mitk::BaseGeometry::Pointer GetGeometry(mitk::Image::Pointer image, unsigned int timeStep)
{
mitk::TimeGeometry::Pointer timeGeometry = image->GetTimeGeometry();
if (timeGeometry.IsNull())
mitkThrow();
auto geometry = timeGeometry->GetGeometryForTimeStep(timeStep);
if (geometry.IsNull())
mitkThrow();
return geometry;
}