Skip to content

Commit

Permalink
VTK version specific commands for irtkGenericImage
Browse files Browse the repository at this point in the history
  • Loading branch information
Ira Ktena committed Aug 20, 2014
1 parent 81d935d commit 470ff84
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions image++/src/irtkGenericImage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
=========================================================================*/

Expand Down Expand Up @@ -1437,8 +1441,16 @@ template <class Type> void irtkGenericImage<Type>::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();
Expand Down

0 comments on commit 470ff84

Please sign in to comment.