<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">I am reading a set of 2D image files, like this:<br>
<br>
typedef itk::Image<unsigned char,2> ImageType2; // 2D image<br>
ImageType2::Pointer im2;<br>
unsigned char *p2;<br>
<br>
typedef itk::ImageFileReader<ImageType2> FileReaderType;<br>
FileReaderType::Pointer reader = FileReaderType::New();<br>
<br>
for (z=0; z<z2-z1-1; z++) {<br>
... // make frame_file<br>
printf("frame_file: %s\n",frame_file);<br>
reader->SetFileName(frame_file);<br>
try<br>
{<br>
reader->Update();<br>
printf("did reader->update\n");<br>
}<br>
catch (itk::ExceptionObject &e)<br>
{<br>
std::cout << e << std::endl;<br>
return 2;<br>
}<br>
<br>
im2 = reader->GetOutput();<br>
printf("got im2\n");<br>
...<br>
}<br>
<br>
This reads the first 2D file, but the next time through the loop it crashes while executing reader->Update().<br>
What am I doing wrong?<br>
<br>
Thanks<br>
Gib<br>
</div>
</body>
</html>