From 470ff847fe78b59226ad1d6ac9d9ba91170eaf24 Mon Sep 17 00:00:00 2001 From: Ira Ktena Date: Wed, 20 Aug 2014 16:18:34 +0100 Subject: [PATCH] VTK version specific commands for irtkGenericImage --- image++/src/irtkGenericImage.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/image++/src/irtkGenericImage.cc b/image++/src/irtkGenericImage.cc index b61601e5..4422d224 100644 --- a/image++/src/irtkGenericImage.cc +++ b/image++/src/irtkGenericImage.cc @@ -7,6 +7,10 @@ Date : $Date$ Version : $Revision$ Changes : $Author$ + +Copyright (c) 1999-2014 and onwards, Imperial College London +All rights reserved. +See LICENSE for details =========================================================================*/ @@ -1437,8 +1441,16 @@ template void irtkGenericImage::ImageToVTK(vtkStructuredPoint vtk->SetOrigin(x, y, z); vtk->SetDimensions(_attr._x, _attr._y, _attr._z); vtk->SetSpacing(_attr._dx, _attr._dy, _attr._dz); +#if VTK_MAJOR_VERSION >= 6 + vtkInformation* outInfo; + vtk->SetScalarType(this->ImageToVTKScalarType(),outInfo); + vtk->AllocateScalars(outInfo); +#else //VTK_MAJOR_VERSION >= 6 vtk->SetScalarType(this->ImageToVTKScalarType()); vtk->AllocateScalars(); +#endif //VTK_MAJOR_VERSION >= 6 + + // Initialize the VTK image n = this->GetNumberOfVoxels();