Skip to content

Instantly share code, notes, and snippets.

@tfmoraes
Created April 17, 2018 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tfmoraes/1404f45be41fd21df5f078db6163d2e4 to your computer and use it in GitHub Desktop.
Save tfmoraes/1404f45be41fd21df5f078db6163d2e4 to your computer and use it in GitHub Desktop.
diff --git a/Utilities/VTK/vtkGDCMPolyDataWriter.cxx b/Utilities/VTK/vtkGDCMPolyDataWriter.cxx
index e2c661c39..62eda25f5 100644
--- a/Utilities/VTK/vtkGDCMPolyDataWriter.cxx
+++ b/Utilities/VTK/vtkGDCMPolyDataWriter.cxx
@@ -586,7 +586,11 @@ void vtkGDCMPolyDataWriter::WriteRTSTRUCTData(gdcm::File &file, int pdidx )
if( darray )
{
double tuple[3];
+#if (VTK_MAJOR_VERSION >= 8)
+ darray->GetTypedTuple( 0, tuple );
+#else
darray->GetTupleValue( 0, tuple );
+#endif
intcolor[0] = (int32_t)(tuple[0] * 255.);
intcolor[1] = (int32_t)(tuple[1] * 255.);
intcolor[2] = (int32_t)(tuple[2] * 255.);
@@ -594,7 +598,12 @@ void vtkGDCMPolyDataWriter::WriteRTSTRUCTData(gdcm::File &file, int pdidx )
else if( farray )
{
float ftuple[3];
+
+#if (VTK_MAJOR_VERSION >= 8)
+ farray->GetTypedTuple( 0, ftuple );
+#else
farray->GetTupleValue( 0, ftuple );
+#endif
intcolor[0] = (int32_t)(ftuple[0] * 255.);
intcolor[1] = (int32_t)(ftuple[1] * 255.);
intcolor[2] = (int32_t)(ftuple[2] * 255.);
diff --git a/Utilities/VTK/vtkImageColorViewer.cxx b/Utilities/VTK/vtkImageColorViewer.cxx
index 3d6df39ee..3a24595dd 100644
--- a/Utilities/VTK/vtkImageColorViewer.cxx
+++ b/Utilities/VTK/vtkImageColorViewer.cxx
@@ -539,7 +539,10 @@ public:
if (event == vtkCommand::ResetWindowLevelEvent)
{
-#if (VTK_MAJOR_VERSION >= 6)
+#if (VTK_MAJOR_VERSION >= 8)
+ this->IV->GetInputAlgorithm()->UpdateInformation();
+ this->IV->GetInputAlgorithm()->Update();
+#elif (VTK_MAJOR_VERSION >= 6)
this->IV->GetInputAlgorithm()->UpdateInformation();
vtkStreamingDemandDrivenPipeline::SetUpdateExtent(
this->IV->GetInputInformation(),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment