[vtkusers] vtkXMLImageDataWriter: saving large data

Oldrich Svec oldrich.svec at gmail.com
Fri Aug 12 02:01:29 EDT 2011


I use Activiz .NET and have 4GB of memory. I save my data during the
computation in the following way:

let vti = new vtkXMLImageDataWriter()
use arr = new vtkDoubleArray()
arr.SetNumberOfComponents 1
for z = 0 to data.lengthZ 0 0 - 1 do
  for y = 0 to data.LengthY - 1 do
    for x = 0 to data.LengthX - 1 do
          arr.InsertNextValue data.[x,y,z]
vti.GetInput().GetCellData().AddArray arr
vti.SetFileName path

I get an error "vtkDoubleArray: Unable to allocate 4194303
elements...". Is there any way how to save the XML image data without
using the intermediate vtkDoubleArray? Or is there any best practise
way how to save large data into file without having to worry about the

Thanks in advance.

More information about the vtkusers mailing list