Slicer学习笔记(二十六)vtkSlicerSegmentationsModuleLogic类下的方法

一下整理了几个数据转换函数。

1、CreateLabelmapVolumeFromOrientedImageData()

CreateLabelmapVolumeFromOrientedImageData()
static bool vtkSlicerSegmentationsModuleLogic::CreateLabelmapVolumeFromOrientedImageData	(	vtkOrientedImageData * 	orientedImageData,
vtkMRMLLabelMapVolumeNode * 	labelmapVolumeNode 
)	

Create labelmap volume MRML node from oriented image data. Creates a display node if a display node does not exist. Shifts image extent to start from zero. Image is shallow-copied (voxel array is not duplicated).

Parameters

  • orientedImageData Oriented image data to create labelmap from
  • labelmapVolumeNode Labelmap volume to be populated with the oriented image data. The volume node must exist and be added to the MRML scene.
  • Returns
    Success flag

2、CreateOrientedImageDataFromVolumeNode()

CreateOrientedImageDataFromVolumeNode()
static vtkOrientedImageData* vtkSlicerSegmentationsModuleLogic::CreateOrientedImageDataFromVolumeNode	(	vtkMRMLScalarVolumeNode * 	volumeNode,
vtkMRMLTransformNode * 	outputParentTransformNode = nullptr 
)	

Create oriented image data from a volume node

Parameters

  • outputParentTransformNode Specifies the parent transform node where the created image data can be placed. NOTE: Need to take ownership of the created object! For example using vtkSmartPointer::Take

3、CreateRepresentationForOneSegment()

CreateRepresentationForOneSegment()
static vtkDataObject* vtkSlicerSegmentationsModuleLogic::CreateRepresentationForOneSegment	(	vtkSegmentation * 	segmentation,
std::string 	segmentID,
std::string 	representationName 
)	

Create representation of only one segment in a segmentation. Useful if only one segment is processed, and we do not want to convert all segments to a certain segmentation to save time. NOTE: Need to take ownership of the created object! For example using vtkSmartPointer::Take

Returns
Representation of the specified segment if found or can be created, nullptr otherwise

4、 CreateSegmentFromLabelmapVolumeNode()

CreateSegmentFromLabelmapVolumeNode()
static vtkSegment* vtkSlicerSegmentationsModuleLogic::CreateSegmentFromLabelmapVolumeNode	(	vtkMRMLLabelMapVolumeNode * 	labelmapVolumeNode,
vtkMRMLSegmentationNode * 	segmentationNode = nullptr 
)

Create segment from labelmap volume MRML node. The contents are set as binary labelmap representation in the segment. Returns nullptr if labelmap contains more than one label. In that case

See also
ImportLabelmapToSegmentationNode needs to be used. NOTE: Need to take ownership of the created object! For example using vtkSmartPointer::Take
Parameters

  • labelmapVolumeNode Model node containing image data that will be the binary labelmap representation in the created segment
  • segmentationNode Segmentation node that will be the container of the segment. It is used to get parent transform to make sure the created segment will be located the same place the image was, considering all transforms involved. nullptr value means that this consideration is not needed. Default value is nullptr.
  • Returns
    Created segment that then can be added to the segmentation if needed. Need to take ownership of the created object! For example using vtkSmartPointer::Take

5、CreateSegmentFromModelNode()

CreateSegmentFromModelNode()
static vtkSegment* vtkSlicerSegmentationsModuleLogic::CreateSegmentFromModelNode	(	vtkMRMLModelNode * 	modelNode,
vtkMRMLSegmentationNode * 	segmentationNode = nullptr 
)		

Create segment from model MRML node. The contents are set as closed surface model representation in the segment. NOTE: Need to take ownership of the created object! For example using vtkSmartPointer::Take

Parameters

  • modelNode Model node containing poly data that will be the closed surface representation in the created segment
  • segmentationNode Segmentation node that will be the container of the segment. It is used to get parent transform to make sure the created segment will be located the same place the model was, considering all transforms involved. nullptr value means that this consideration is not needed. Default value is nullptr.

Returns
Created segment that then can be added to the segmentation if needed. Need to take ownership of the created object! For example using vtkSmartPointer::Take

6、CopyOrientedImageDataToVolumeNode()

CopyOrientedImageDataToVolumeNode()
static bool vtkSlicerSegmentationsModuleLogic::CopyOrientedImageDataToVolumeNode	(	vtkOrientedImageData * 	orientedImageData,
vtkMRMLVolumeNode * 	volumeNode,
bool 	shallowCopy = true,
bool 	shiftImageDataExtentToZeroStart = true 
)	

Create volume MRML node from oriented image data. Display node is not created.

Parameters

  • orientedImageData Oriented image data to create volume node from
  • scalarVolumeNode Volume to be populated with the oriented image data.
  • shallowCopy If true then voxel array is not duplicated.
  • shiftImageDataExtentToZeroStart Adjust image origin to make image extents start from zero. May be necessary for compatibility with some algorithms that assumes image extent start from 0.

Returns
Success flag

参考:vtkSlicerSegmentationsModuleLogic Member List
参考:CreateLabelmapVolumeFromOrientedImageData()
参考:CreateOrientedImageDataFromVolumeNode()
参考:CreateSegmentFromLabelmapVolumeNode()
参考:CreateSegmentFromModelNode()

猜你喜欢

转载自blog.csdn.net/juluwangriyue/article/details/121060214
今日推荐