[vtkusers] VTK volume from slices with timestamp and cache
David Gobbi
david.gobbi at gmail.com
Wed Feb 12 08:02:48 EST 2014
Hi Richard,
VTK doesn't have anything specifically for storing per-slice attributes,
but you could create a named array that has all of the timestamps, and
then attach that array to the FieldData of the vtkImageData:
timestamps = vtkDoubleArray::New();
timestamps->SetName("TimeStamps");
image->GetFieldData()->AddArray(timestaps);
For large volumes, you can use mmap to map the file to a pointer
(as long as the file is a raw, flat, binary file), and then you can tell
any VTK array or data set to use the provided pointer. By using mmap,
you allow the operating system to automatically swap in or swap out
portions of the file as necessary. VTK has no mmap facilities built in,
so you would have to do the mmap via a system call (and this isn't
something that I'd have time to create an example for, so don't ask).
David
On Wed, Feb 12, 2014 at 5:35 AM, Richard Whitehead
<richard.whitehead at vivosight.com> wrote:
> I am doing a redesign for a piece of medical equipment and am considering
> basing it around VTK. Please can anyone with expertise help as I have only
> played with VTK for a couple of weeks.
> The machine takes slices of data one after another. I am thinking I could
> store these in a VTK volume which can then be visualised. But I have 2
> issues:
> - We need each slice to be time-stamped; would it be possible to use some
> sort of compound data structure that can see the slices as a volume but also
> attach information to each slice? I'm thinking this might enable me to use
> VTK's serialisation for example.
> - Because of processing, filtering etc. there will be far too much data to
> keep in memory - dozens of large volumes. Most volumes will only be
> visualised as slices in the original plane, one or two will be visualised in
> another plane or as 3D. Is there a way to tell VTK to cache the volume in
> files and seamlessly load planes from disk as needed for display?
> I am at the paper design stage so direction here would be very valuable.
> All help much appreciated.
More information about the vtkusers
mailing list