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