<div class="gmail_quote">Disconnect the image from the pipeline, or it will be subject to updates when you call Update() or update any of the downstream filters like the VTK-ITK connector... This is done with a shallow copy.<br>
<br>ie Instead of :<br><br> USImageStitch = sonixGrabber->GetOutput();<br> USImageStitch->Update();<br><br>write<br><br> sonixGrabber->Update();<br> USImageStich->ShallowCopy(sonixGrabber->GetOutput());<br>
<br> <br><br><br>On Tue, Feb 15, 2011 at 4:18 AM, Alexis Cheng <span dir="ltr"><<a href="mailto:acheng_1221@hotmail.com">acheng_1221@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<br> vtkSmartPointer<vtkImageData> USImageStitch = vtkSmartPointer<vtkImageData>::New();<br> USImageStitch->SetScalarTypeToUnsignedChar();<br> USImageStitch->SetDimensions(640,480,1);<br>
USImageStitch->SetSpacing(1,1,1);<br> USImageStitch = sonixGrabber->GetOutput();<br> USImageStitch->Update();<br> <br> ImagePanorama.push_back(USImageStitch);<br>
Sleep(100);<br> }<br><br> for (vector<vtkSmartPointer<vtkImageData>>::iterator PanoramaIterator = ImagePanorama.begin();PanoramaIterator < ImagePanorama.end()-1;PanoramaIterator++)<br>
{<br> VTKImageToITKImageType::Pointer VTKToITKConnector1 = VTKImageToITKImageType::New();<br> VTKToITKConnector1->SetInput(*PanoramaIterator);<br> VTKToITKConnector1->Update();<br>
<br> VTKImageToITKImageType::Pointer VTKToITKConnector2 = VTKImageToITKImageType::New();<br> VTKToITKConnector2->SetInput(*(PanoramaIterator+1));<br> VTKToITKConnector2->Update();<br>
}<br>//////////////////////////////////////////<br><br>The iterators are returning the real time image as opposed to the stored image. I'm not quite sure what the problem may be. Has anybody worked with smartpointers and vectors? Thank you all in advance.<br>
<br>Regards,<br>Alexis Cheng<br>Electrical Engineering<br>University of British Columbia<br>                                            </div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br>