<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Hi all,<br><br>I'm attempting to grab a series of images from a real time source and store them into a vector for future processing. The problem that I am having is that when I try to access the vector, it returns an image from the real time source as opposed to the one that I had previously stored. Below is a sample of my code.<br><br>///////////////////////////////////////////<br>typedef itk::Image< unsigned char, 2 > FixedImageType;<br>typedef itk::VTKImageToImageFilter<FixedImageType> VTKImageToITKImageType;<br><br>vector<vtkSmartPointer<vtkImageData>> ImagePanorama;<br><br> for (int i = 0; i < 50; i++)<br> {<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>                                            </body>
</html>