[vtkusers] Extend Imagestack dynamically

David Gobbi david.gobbi at gmail.com
Fri Mar 11 09:15:17 EST 2016


Hi Andreas,

You are correct that vtkStringArray is causing problems.  Do not
use InsertValue().  Use InsertNextValue() instead:

  filenameArray->InsertNextValue(_firstFilename.c_str());

Do not call filenameArray->SetNumberOfValues(1) in your constructor. And do
not use a "counter" variable: if you want to know how many files are in the
array, use filenameArray->GetNumberOfValues();

I do not think your program needs vtkImageStack.  If you remove it from
your program, and add vtkImageSlice directly to your renderer, you will
probably get what you need.  The following wiki page describes the purpose
of vtkImageStack:
http://www.vtk.org/Wiki/VTK/Image_Rendering_Classes

 - David

On Fri, Mar 11, 2016 at 3:53 AM, Andreas Klos <aklos at outlook.de> wrote:

>  Dear great VTK-Comunity,
> I am actually trying to use vtkImageStack to create a imagestack of
> .png-Images. This seems to be very easy through VTK but it seem to be a bit
> harder when the Imagestack becomes extended dynamically. I'm working with
> Qt-plugin for visualstudio and VTK Version 7.0. When an Image is in the
> folder for visualisation purposes my Qt- GUI emits a Signal and transmit
> the full filename(path+filename) to a SLOT of my QVTK widget. If the SIGNAL
> is emitted the first time, my QVTK widget becomes created. The QVTK widget
> contains a Object of my visualisation pipeline  and executes the
> visualisation  pipeline through the call of the construtor. Till there,
> everything seems to work fine. The First Image is represented well. In
> Addition i should mention that the object of my visualisation pipeline has
> a method which should extend my imagestack. So if the SIGNAL is emitted
> again the SLOT of my QVTK widget should call this method. this is also well
> done. But it seems that the vtkStringArray of my visualisation pipline is
> not Extended with the new filename. so i can still just visualize the first
> Image. The Code of my visualisation Pipeline is shown below.
>
> It would be greatful if somebody can help me or give me a hint if i had
> coded something wrong or if there is a better Approach of how to extend the
> imagestack dynamically.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160311/edfb1123/attachment.html>


More information about the vtkusers mailing list