Import 2017-06-07 23:51:09: master c355e705

Author Committer Branch Timestamp Parent
jcfr jcfr master 2015-02-02 23:24:20 master b6bdebc5
Changeset

ENH: Use the latest vtkImageReslice filter instead of vtkImageResliceMask

Features:

  • Performance optimization: about 2x speed increase in slice rendering
    speed when the volume is linearly transformed (e.g., transformed MRHead
    refresh rate 25fps -> 50fps)

  • Thick slices, MIP, DRR, etc. display modes are available (no GUI yet,
    but already can be enabled using Python), see the code samples below

Implementation:

  • Convert composite transform to simple linear filter before setting it
    in the reslice filter (because vtkImageResliceMask can do some additional
    optimizations if it gets a simple linear transform)

  • Use the latest vtkImageReslice filter instead of vtkImageResliceMask:
    mask output of vtkImageReslice is a stencil, therefore slice processing
    pipeline is simplified: vtkImageCast filter is not needed anymore and
    the more efficient vtkImageStencil is used instead of vtkImageMathematics
    custom vtkImageResliceMask class is removed: no need to maintain it
    any longer, etc.

Thick slice:

sliceNode = slicer.mrmlScene.GetNodeByID('vtkMRMLSliceNodeRed')
appLogic = slicer.app.applicationLogic()
sliceLogic = appLogic.GetSliceLogic(sliceNode)
sliceLayerLogic = sliceLogic.GetBackgroundLayer()
reslice = sliceLayerLogic.GetReslice()
reslice.SetSlabModeToMean()
reslice.SetSlabNumberOfSlices(10)
reslice.SetSlabSliceSpacingFraction(0.3)
sliceNode.Modified()

Maximum intensity projection (MIP):

sliceNode = slicer.mrmlScene.GetNodeByID('vtkMRMLSliceNodeRed')
appLogic = slicer.app.applicationLogic()
sliceLogic = appLogic.GetSliceLogic(sliceNode)
sliceLayerLogic = sliceLogic.GetBackgroundLayer()
reslice = sliceLayerLogic.GetReslice()
reslice.SetSlabModeToMax()
reslice.SetSlabNumberOfSlices(600)
reslice.SetSlabSliceSpacingFraction(0.5)
sliceNode.Modified()

Conflicts:
Modules/Loadable/Volumes/Logic/vtkSlicerVolumesLogic.cxx

From: Andras Lasso <lasso@queensu.ca>

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23942 3bd1e089-480b-0410-8dfb-8563597acbee

mod - Libs/MRML/Core/CMakeLists.txt Diff File
mod - Libs/MRML/Core/vtkITKTransformConverter.h Diff File
mod - Libs/MRML/Core/vtkITKTransformInverse.h Diff File
rm - Libs/MRML/Core/vtkImageResliceMask.cxx Diff File
rm - Libs/MRML/Core/vtkImageResliceMask.h Diff File
mod - Libs/MRML/Core/vtkMRMLScalarVolumeDisplayNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLScalarVolumeDisplayNode.h Diff File
mod - Libs/MRML/Core/vtkMRMLTransformNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLTransformNode.h Diff File
mod - Libs/MRML/Core/vtkMRMLVolumeNode.cxx Diff File
mod - Libs/MRML/Logic/CMakeLists.txt Diff File
mod - Libs/MRML/Logic/Testing/Cxx/vtkMRMLSliceLayerLogicTest.cxx Diff File
mod - Libs/MRML/Logic/Testing/Cxx/vtkMRMLSliceLogicTest2.cxx Diff File
rm - Libs/MRML/Logic/vtkImageLinearReslice.cxx Diff File
rm - Libs/MRML/Logic/vtkImageLinearReslice.h Diff File
mod - Libs/MRML/Logic/vtkMRMLSliceLayerLogic.cxx Diff File
mod - Libs/MRML/Logic/vtkMRMLSliceLayerLogic.h Diff File
mod - Modules/Loadable/Volumes/Logic/vtkSlicerVolumesLogic.cxx Diff File