[vtkusers] varying zspacing
Bill Lorensen
bill.lorensen at gmail.com
Sat Nov 14 11:05:55 EST 2009
You can make it into a RectilinearGrid. The rectilinear grid is
topologically regular but allows variable spacing in the 3 coordinate
directions. Look at Filtering/vtkRectilinearGrid.h for documentation.
Bill
On Sat, Nov 14, 2009 at 9:08 AM, Grześ Furga <grzesiof at gmail.com> wrote:
> 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
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
More information about the vtkusers
mailing list