<div dir="ltr">Hi Andreas,<div><br></div><div>You are correct that vtkStringArray is causing problems.  Do not use InsertValue().  Use InsertNextValue() instead:</div><div><br></div><div>  filenameArray->InsertNextValue(_firstFilename.c_str());</div><div><br></div><div>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();</div><div><br></div><div>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:</div><div><a href="http://www.vtk.org/Wiki/VTK/Image_Rendering_Classes" target="_blank">http://www.vtk.org/Wiki/VTK/Image_Rendering_Classes</a><br></div><div><br></div><div> - David</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 11, 2016 at 3:53 AM, Andreas Klos <span dir="ltr"><<a href="mailto:aklos@outlook.de" target="_blank">aklos@outlook.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div><div dir="ltr"> Dear great VTK-Comunity,<br>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.<br><br>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.<br></div></div></blockquote></div></div></div>