[vtkusers] about exchanging images within Render Windows

Eric E. Monson emonson at cs.duke.edu
Fri Apr 16 09:01:46 EDT 2010


Hello,

(Please also CC to the list so everyone can contribute and learn together.)

Since memory is an issue for you, I would first try just changing the parameters of the reader when the user wants to switch image series (like with SetFileNames()). If that is too slow for some reason, then I would try having a second reader that can read in the images for the second series, and then switch the input of the image coloring filter to this second reader after it's updated.

vtkImageReslice is very efficient for displaying individual slices from a vtkImageData. If you haven't yet, take a look at how [vtksource]/Examples/ImageProcessing/ImageSlicing.py is implemented. Note that there are different interpolation modes, so if you want to show definite slices instead of interpolated ones, you can set reslice.SetInterpolationModeToNearestNeighbor().

Talk to you later,
-Eric


On Apr 15, 2010, at 4:46 PM, Lic. José M. Rodriguez Bacallao wrote:

> well, I am displaying one slice of a larger loaded 3D stack and then,
> I have another completely different series of images that you want to
> switch to but I'm not sure what would be the most efficient way to
> switch between the first series and the second (and so on), all with
> the same render window. Memory is an issue but I need to balance the
> performance with the memory usage, so, what do you recommend.
> 
> PS: And for displaying individual slices of a list of slices images,
> what could be an efficient way to display them in terms of memory
> consumption and performance?
> 
> On Thu, Apr 15, 2010 at 2:10 PM, Eric E. Monson <emonson at cs.duke.edu> wrote:
>> Hey,
>> 
>> Just to clarify a bit -- you are displaying one dicom series in some way (are you rendering just one slice of a larger 3D stack?), and then you have another completely different series of images (with different properties?) that you want to switch to, but you're not sure what would be the most efficient way to switch between the first series and the second (and so on)? (Or, do you have a list of files that you're displaying individually and you're just wanting to switch between viewing the individual images in the list of files?)
>> 
>> What happens when you just call SetFileNames() on your reader with the new file list, and then renderWin.Render()? Is the update too slow?
>> 
>> In general, I think you shouldn't have to swap out the actor or renderer, but can just change the input to an earlier part of your pipeline with the new element. For example, if you wanted to read your next series while still displaying your first, I bet you could set up a second reader and Update() it, then switch the input to the vtkImageMapTo... to the second reader and call renWin.Render() to show the new set. But if memory usage is a big issue, just changing the properties of the reader for the new series and then updating the pipeline will probably suit you best.
>> 
>> Let us know if I'm misunderstanding what you're trying to do. Or, describe what you've tried so far and what isn't working well.
>> 
>> -Eric
>> 
>> ------------------------------------------------------
>> Eric E Monson
>> Duke Visualization Technology Group
>> 
>> 
>> On Apr 14, 2010, at 6:13 PM, Lic. José M. Rodriguez Bacallao wrote:
>> 
>>> hi folks, I have one Render Window and a list of dicom series (list of
>>> vtkImageData), what I need to do is to dynamically exchange the
>>> current displayed serie from one to another. Which is the better way
>>> to do it, removing the actor that represent the serie and adding the
>>> new one or removing the renderer that have the actor and adding the
>>> new one?. I am trying to get my memory usage as low as possible
>>> without affect too much the performance.
>>> 
>>> A basic pipeline for one serie is the following:
>>> 
>>> vtkGDCMImageReader -> vtkImageMapToWindowLevelColors -> vtkImageActor
>>> -> vtkRenderer -> vtkRenderWindow (Qt)
>>> 
>>> which component of the pipeline to change to achieve this?
>>> 
>>> --
>>> Lic. José M. Rodriguez Bacallao
>>> Centro de Biofisica Medica
>>> -----------------------------------------------------------------
>>> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.
>>> 
>>> Recuerda: El arca de Noe fue construida por aficionados, el titanic
>>> por profesionales
>>> -----------------------------------------------------------------
>>> _______________________________________________
>>> 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
>> 
>> 
> 
> 
> 
> -- 
> Lic. José M. Rodriguez Bacallao
> Centro de Biofisica Medica
> -----------------------------------------------------------------
> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.
> 
> Recuerda: El arca de Noe fue construida por aficionados, el titanic
> por profesionales
> -----------------------------------------------------------------





More information about the vtkusers mailing list