BUG: Fix display node copy in CloneVolume
Created by: agirault
Motivation If a volume is rendered through the Volume Rendering volume module then cropped through the Crop Volume module, it is not possible to display the volume rendering of the cropped volume: the original volume would be displayed instead.
Reason
In the Crop Volume module, the method vtkSlicerVolumesLogic::CloneVolume
was called. The volume and its first display node were cloned using
vtkMRMLVolumeNode::CopyWithScene
, but the remaining display nodes were
ignored. This was resulting in having a cloned volume with references to
the original volume display nodes. In the case above, the display node of
type vtkMRMLVolumeRenderingDisplayNode
was the same for the cropped and
original volumes, referencing the original volume for both of them.
Fix
In this commit only the first display node is cloned, and the other display
nodes are removed. Cloning a vtkMRMLVolumeRenderingDisplayNode
would not be
as straightforward as copying a vtkMRMLVolumeDisplayNode
since the display
node itself has a VolumeNodeID
, a ROINodeID
and a VolumePropertyNodeID
that
would need to be created/updated.
This fixes the issue 4109: http://na-mic.org/Mantis/view.php?id=4109