Hi all,<div><br></div><div>I use vtkImageImporter to import images I&#39;m reading with ITK. After importing the image, I delete the importer (and whatever is before the importer in the pipeline). Something like this:<br><div>
<br></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">vtkImageImporter * importer = vtkImageImporter::New();</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">... </font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">// setup importer</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">...</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">importer-&gt;Update();</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">vtkImageData * image = importer-&gt;GetOutput();</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">image-&gt;Register(0);</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace"><br></font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">importer-&gt;Delete(); </font></div><div><br></div><div>
This approach works fine with other VTK readers and filters, but not with vtkImporter. </div><div><br></div><div>When I try to use <font class="Apple-style-span" face="&#39;courier new&#39;, monospace">image</font> after deleting the importer, the program crashes while trying to update the part of the pipeline that has been deleted. </div>
<div><br></div><div>The only solution I&#39;ve found so far is to deepcopy the output of vtkImageImporter to another image and use the copy:</div><div><br></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">vtkImageData * imCopy;</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">imCopy-&gt;DeepCopy( importer-&gt;GetOutput() );</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">importer-&gt;Delete()</font></div>
<div><br></div><div>Is there any other way? With other filters, images seem to &quot;detach&quot; from the filter that generated them. How does that happen? Why is it not happening with vtkImageImporter?</div><div><br></div>
<div>Thanks in advance.</div><div><br></div><div>s. </div><div><br></div></div>