[vtkusers] varying zspacing
Grześ Furga
grzesiof at gmail.com
Sat Nov 14 09:08:55 EST 2009
Hi,
I'm using vtk to reconstruct surfaces from a set of slides. Most of
the time the slides maintain constant spacing
but occasionally a batch of oddly spaced ones comes.
I can use reslice / changeinformation to interpolate the constant
spacing batches and end up with a
set of volumes with matching z spacing.
Is there a way to merge / join the individual volumes into a continous
one before feeding into vtkContourFilter?
The only alternative solution I can think of is exporting the
interpolated chunks as scalararrays, joining them
and then building a continous volume.
I haven't tested it yet but I imagine doing something along the lines of:
image = vtk.vtkImageImport()
image.SetDataSpacing(xspacing, yspacing, zspacing );
image.SetImportVoidPointer(data)
# reslice / change information and export:
export = vtk.vtkImageExport()
export.SetInput(image.GetOutput())
export.SetExportVoidPointer(data)
export.Export()
Now data will be exported resliced, right? And I can join it with
other chunks to form a continues array of equally spaced
data and feed right into a vtkImageImport again?
--
Best Regards,
Grześ Furga
More information about the vtkusers
mailing list