Commit 49d82509 authored by lassoan's avatar lassoan

ENH: Add support for vtkMRMLProceduralColorNode in distance encoded projection

Co-authored-by: Sunderlandkyl's avatarKyle Sunderland <sunderlandkyl@gmail.com>

git-svn-id: http://svn.slicer.org/Slicer4/trunk@28013 3bd1e089-480b-0410-8dfb-8563597acbee
parent 0a8e2d77
......@@ -26,6 +26,7 @@
#include <vtkMRMLDisplayableNode.h>
#include <vtkMRMLModelDisplayNode.h>
#include <vtkMRMLModelNode.h>
#include <vtkMRMLProceduralColorNode.h>
#include <vtkMRMLScene.h>
#include <vtkMRMLSliceCompositeNode.h>
#include <vtkMRMLSliceLogic.h>
......@@ -37,6 +38,7 @@
#include <vtkActor2D.h>
#include <vtkAlgorithmOutput.h>
#include <vtkCallbackCommand.h>
#include <vtkColorTransferFunction.h>
#include <vtkDataSetSurfaceFilter.h>
#include <vtkEventBroker.h>
#include <vtkLookupTable.h>
......@@ -503,13 +505,26 @@ void vtkMRMLModelSliceDisplayableManager::vtkInternal
if (modelDisplayNode->GetSliceDisplayMode() == vtkMRMLModelDisplayNode::SliceDisplayDistanceEncodedProjection)
{
vtkMRMLColorNode* colorNode = modelDisplayNode->GetDistanceEncodedProjectionColorNode();
vtkLookupTable* dNodeLUT = (colorNode ? colorNode->GetLookupTable() : NULL);
if (dNodeLUT)
vtkSmartPointer<vtkScalarsToColors> lut = NULL;
vtkSmartPointer<vtkMRMLProceduralColorNode> proceduralColor = vtkMRMLProceduralColorNode::SafeDownCast(colorNode);
if (proceduralColor)
{
lut = vtkScalarsToColors::SafeDownCast(proceduralColor->GetColorTransferFunction());
}
else
{
vtkLookupTable* dNodeLUT = (colorNode ? colorNode->GetLookupTable() : NULL);
if (dNodeLUT)
{
mapper->SetScalarRange(modelDisplayNode->GetScalarRange());
lut = vtkSmartPointer<vtkLookupTable>::Take(
vtkMRMLModelDisplayableManager::CreateLookupTableCopy(dNodeLUT));
lut->SetAlpha(displayNode->GetSliceIntersectionOpacity());
}
}
if (lut != NULL)
{
mapper->SetScalarRange(modelDisplayNode->GetScalarRange());
vtkSmartPointer<vtkLookupTable> lut = vtkSmartPointer<vtkLookupTable>::Take(
vtkMRMLModelDisplayableManager::CreateLookupTableCopy(dNodeLUT));
lut->SetAlpha(displayNode->GetSliceIntersectionOpacity());
mapper->SetLookupTable(lut.GetPointer());
mapper->SetScalarRange(lut->GetRange());
mapper->SetScalarVisibility(true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment