[vtkusers] vtkXMLImageDataWriter: saving large data
Oldrich Svec
oldrich.svec at gmail.com
Fri Aug 12 02:01:29 EDT 2011
Hi,
I use Activiz .NET and have 4GB of memory. I save my data during the
computation in the following way:
let vti = new vtkXMLImageDataWriter()
vti.SetCompressorTypeToZLib()
vti.SetDataModeToAppended()
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
vti.Write()
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
memory?
Thanks in advance.
Oldrich
More information about the vtkusers
mailing list