[vtkusers] help for rendering a large amount of images
Henry Blanco
henry.blanco at cbiomed.cu
Fri Nov 6 10:52:59 EST 2015
Hello David, thanks for your help and sorry for the late reply, I've
been absent for a couple of days.
Well we're newbies on vtk, ... therefore it would nice if you give us
more details on:
1- How to create a flat file from several images. I guess we have to use
some vtk classes, but we don't know which one.
2- How to achieve the mapping from the flat file memory address to the
vtkImageData.
Thanks in advance,
Henry
On mar, 2015-11-03 at 11:03 -0700, David Gobbi wrote:
> Hi Henry,
>
>
> Please reply to the vtk list, not just to me.
>
>
> You're requirement of rendering "thousands of medical images" is
> way too vague. Do you need to render them all simultaneously,
> i.e. will they all be on screen at the same time? I really do not
> understand what you are trying to do.
>
>
> The vtkImageDataStreamer will be no help to you, because it always
> loads the entire volume. It's job is to pull the data through the
> pipeline
> in small chunks, but the end result is still that the whole volume
> ends
> up in memory.
>
>
> Yes, vtkImageReslice can show a sagittal or coronal view by only
> streaming a small part of the volume into memory, but this will only
> work with certain reader classes. For example, the vtkTIFFReader
> always reads entire slices, so it cannot read just one row of a
> slice that vtkImageReslice can then incorporate into a sagittal view.
> In fact, I think that only vtkImageReader2 can stream individual
> rows or columns of an image from disk. The other readers can
> only stream the data slice-by-slice.
>
>
> You should seriously consider my recommendation of using memory
> mapping. If you simply map a flat file to a memory address and then
> use that memory address as a pixel data inside a vtkImageData, then
> the operating system can make all the decisions about how and when
> to load the data from disk.
>
>
> - David
>
>
>
> On Tue, Nov 3, 2015 at 10:33 AM, Henry Blanco
> <henry.blanco at cbiomed.cu> wrote:
> Thanks David for your soon reply. Ok, my problem is to load
> and render thousands of medical images,
> organized into series, by using VTK, but considering strong
> limitations
> in terms of RAM (e.g., only 128 or 256 MB of RAM available).
>
> To achieve this task, we have tried to use the
> "vtkImageDataStreamer"
> class, but we have failed. This class seems to load the whole
> volume into
> memory, therefore loading 2000 CT images (1GB) into memory may
> fail if
> we consider just 128 MB of RAM.
>
> We are thinking to partition the whole volume into K blocks
> and to load
> a block of images into memory just when it's needed. The
> illusion of
> having the whole volume loaded in memory could be achieved by
> uploading/downloading one or more blocks of images to/from
> memory when
> needed. I'm wondering whether exist some vtk classes which can
> be used
> to picture a different view than the original (e.g., sagittal,
> coronal,
> or even oblique) without loading the whole volume of images.
>
> Henry
>
> On lun, 2015-11-02 at 17:29 -0700, David Gobbi wrote:
> > What kind of views will you need? Do you just have to view
> the
> > original
> > slices? If so, then the VTK pipeline's streaming will make
> the job
> > easy.
> > If you need orthogonal or oblique views, things are more
> difficult.
> > Also,
> > how is the data stored on disk? If the whole volume is
> stored on disk
> > as a single flat file, then you can memory map the file.
> >
> >
> > - David
> >
> > On Mon, Nov 2, 2015 at 4:10 PM, Henry Blanco
> <henry.blanco at cbiomed.cu>
> > wrote:
> > Hello guys, I need some hints on how to render a
> large amount
> > of images
> > (e.g., thousands of images) using just few RAM
> resources
> > (e.g., 128 MB)
> > using the vtkImageReslice class for the whole
> volume.
> >
> > Thanks in advance
> >
> > Henry
>
>
>
>
>
>
More information about the vtkusers
mailing list