Commit 3ded8fbe authored by vrnova's avatar vrnova
Browse files

BUGFIX: enforce inputs validation after scene loading. Sometimes inputs may be...

BUGFIX: enforce inputs validation after scene loading. Sometimes inputs may be NULL after scene loading due to async loading such as http download

git-svn-id: http://svn.slicer.org/Slicer4/trunk@11507 3bd1e089-480b-0410-8dfb-8563597acbee
parent 8c88ae5d
......@@ -1386,9 +1386,24 @@ void vtkVolumeRenderingGUI::InitializePipelineFromImageDataFg()
this->GetApplicationGUI()->SetExternalProgress(buf, 1.0);
}
int vtkVolumeRenderingGUI::ValidateParametersNode(vtkMRMLVolumeRenderingParametersNode* vspNode)
{
//check all inputs
if (!vspNode->GetVolumeNode() || !vspNode->GetFgVolumeNode())
return 0;
return 1;
}
//initialize pipeline from a loaded or user selected parameters node
void vtkVolumeRenderingGUI::InitializePipelineFromParametersNode()
{
vtkMRMLVolumeRenderingParametersNode* vspNode = this->GetCurrentParametersNode();
if (!ValidateParametersNode(vspNode))
return;
char buf[32] = "Initializing...";
this->GetApplicationGUI()->SetExternalProgress(buf, 0.1);
......@@ -1409,8 +1424,6 @@ void vtkVolumeRenderingGUI::InitializePipelineFromParametersNode()
}
}
vtkMRMLVolumeRenderingParametersNode* vspNode = this->GetCurrentParametersNode();
this->GetLogic()->SetupHistograms(vspNode);
if (vspNode->GetFgVolumeNode())
this->GetLogic()->SetupHistogramsFg(vspNode);
......
......@@ -181,6 +181,8 @@ protected:
void LoadPresets();
int ValidateParametersNode(vtkMRMLVolumeRenderingParametersNode* vspNode);
//OWN GUI Elements
//Frame input
......
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