<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.E-MailFormatvorlage17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>Hello David,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><br>Thank you for your fast reply. I have tried your recommendations. You were right, i do not need vtkImageStack for my purposes and the hint with InsertNextValue() was also really helpful. But this recommended changes of my code does not solve my problem. I think the issue lies in the combined usage of Qt and VTK. Because i try to extend my „imagestack“ out of a SLOT. Could that cause my issue? Or is there something else which i am doing wrong?<br><br>Nonetheless i solved the problem through the usage of ITK. At the moment i am loading my imagestack through itk::ImageSeriesReader and export my imagedata to VTK.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>Best regards,<br>Andreas<o:p></o:p></span></p><p class=MsoNormal><a name="_MailEndCompose"><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></a></p><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Von:</span></b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> David Gobbi [mailto:david.gobbi@gmail.com] <br><b>Gesendet:</b> Freitag, 11. März 2016 15:15<br><b>An:</b> Andreas Klos<br><b>Cc:</b> vtkusers@vtk.org<br><b>Betreff:</b> Re: [vtkusers] Extend Imagestack dynamically<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Hi Andreas,<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>You are correct that vtkStringArray is causing problems. Do not use InsertValue(). Use InsertNextValue() instead:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal> filenameArray->InsertNextValue(_firstFilename.c_str());<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>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();<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>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:<o:p></o:p></p></div><div><p class=MsoNormal><a href="http://www.vtk.org/Wiki/VTK/Image_Rendering_Classes" target="_blank">http://www.vtk.org/Wiki/VTK/Image_Rendering_Classes</a><o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal> - David<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>On Fri, Mar 11, 2016 at 3:53 AM, Andreas Klos <<a href="mailto:aklos@outlook.de" target="_blank">aklos@outlook.de</a>> wrote:<o:p></o:p></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><div><div><p class=MsoNormal> 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.<o:p></o:p></p></div></div></blockquote></div></div></div></div></body></html>