本文整理汇总了C++中image::Pointer::GetData方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointer::GetData方法的具体用法?C++ Pointer::GetData怎么用?C++ Pointer::GetData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类image::Pointer
的用法示例。
在下文中一共展示了Pointer::GetData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pixelType
mitk::DataNode::Pointer mitk::Tool::CreateEmptySegmentationNode( Image* original, const std::string& organName, const mitk::Color& color )
{
// we NEED a reference image for size etc.
if (!original) return NULL;
// actually create a new empty segmentation
PixelType pixelType(mitk::MakeScalarPixelType<DefaultSegmentationDataType>() );
Image::Pointer segmentation = Image::New();
if (original->GetDimension() == 2)
{
const unsigned int dimensions[] = { original->GetDimension(0), original->GetDimension(1), 1 };
segmentation->Initialize(pixelType, 3, dimensions);
}
else
{
segmentation->Initialize(pixelType, original->GetDimension(), original->GetDimensions());
}
unsigned int byteSize = sizeof(DefaultSegmentationDataType);
for (unsigned int dim = 0; dim < segmentation->GetDimension(); ++dim)
{
byteSize *= segmentation->GetDimension(dim);
}
memset( segmentation->GetData(), 0, byteSize );
if (original->GetTimeSlicedGeometry() )
{
AffineGeometryFrame3D::Pointer originalGeometryAGF = original->GetTimeSlicedGeometry()->Clone();
TimeSlicedGeometry::Pointer originalGeometry = dynamic_cast<TimeSlicedGeometry*>( originalGeometryAGF.GetPointer() );
segmentation->SetGeometry( originalGeometry );
}
else
{
Tool::ErrorMessage("Original image does not have a 'Time sliced geometry'! Cannot create a segmentation.");
return NULL;
}
return CreateSegmentationNode( segmentation, organName, color );
}