<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">The files are named as file000.png, file001.png, ...file031.png.<br><br>The .vtk file generated is of a decent size. Also, when I read in the .vtk and write out Image series, using the ImageReadImageSeriesWrite.cpp file,&nbsp; I can recreate the original 32 2D slices.<br><br>I am simply not able to view them using volview. Any clues !&nbsp; Volview does ask for Z-spacing and units, but then it displays nothing.<br><br>Emma<br><br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Andinet Enquobahrie &lt;andinet.enqu@kitware.com&gt;<br>To: Emma Ryan &lt;eryanvtk@yahoo.com&gt;<br>Sent: Tuesday, June 12, 2007 5:31:13 AM<br>Subject: Re: [Insight-users]
 ImageSeriesReadWrite only reads first file.<br><br><div>Emma Ryan wrote:<br><br>&gt;<br>&gt; Hi,<br>&gt;<br>&gt;&nbsp;&nbsp; I am trying to generate a .vtk file (3D ) from a&nbsp;&nbsp;set of .png <br>&gt; images. I use the ImageSeriesReadWrite.cxx example provided in ITK as <br>&gt; is. My command line syntax is&nbsp;&nbsp;"SeriesRW.exe 0 31 output.vtk"<br><br><br>How are the png images named? Give us a list of their names... The issue <br>might be with the file format..<br><br>&gt;<br>&gt; i.e SeriesRW is the executable, there are 32 slices starting from 0, <br>&gt; and the output format is supposed to be .vtk , so that I can open it <br>&gt; using Volview.<br>&gt;<br>&gt; While the program executes with no errors or warnings, when I open <br>&gt; output.vtk file in Volview, it seems to be empty.<br>&gt;<br>&gt; I am not sure why this.&nbsp;&nbsp;If anyone has a clue as to why this happens, <br>&gt; please let me know.&nbsp;&nbsp;Here is the code.<br>&gt;<br>&gt;
 #include "itkImage.h"<br>&gt; #include "itkImageSeriesReader.h"<br>&gt; #include "itkImageFileWriter.h"<br>&gt; #include "itkNumericSeriesFileNames.h"<br>&gt; #include "itkPNGImageIO.h"<br>&gt;<br>&gt;<br>&gt; int main( int argc, char ** argv )<br>&gt; {<br>&gt;&nbsp;&nbsp;<br>&gt;&nbsp;&nbsp; if( argc &lt; 4 )<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; "Usage: " &lt;&lt; std::endl;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; argv[0] &lt;&lt; " firstSliceValue lastSliceValue&nbsp;&nbsp;<br>&gt; outputImageFile " &lt;&lt; std::endl;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; return EXIT_FAILURE;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&gt;<br>&gt;<br>&gt;&nbsp;&nbsp; typedef unsigned char&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PixelType;<br>&gt;&nbsp;&nbsp; const unsigned int Dimension = 3;<br>&gt;<br>&gt;&nbsp;&nbsp; typedef itk::Image&lt;
 PixelType, Dimension &gt;&nbsp;&nbsp;ImageType;<br>&gt;<br>&gt;&nbsp;&nbsp; typedef itk::ImageSeriesReader&lt; ImageType &gt;&nbsp;&nbsp;ReaderType;<br>&gt;&nbsp;&nbsp; typedef itk::ImageFileWriter&lt;&nbsp;&nbsp; ImageType &gt;&nbsp;&nbsp;WriterType;<br>&gt;<br>&gt;&nbsp;&nbsp; ReaderType::Pointer reader = ReaderType::New();<br>&gt;&nbsp;&nbsp; WriterType::Pointer writer = WriterType::New();<br>&gt;<br>&gt;&nbsp;&nbsp; const unsigned int first = atoi( argv[1] );<br>&gt;&nbsp;&nbsp; const unsigned int last&nbsp;&nbsp;= atoi( argv[2] );<br>&gt;<br>&gt;&nbsp;&nbsp; const char * outputFilename = argv[3];<br>&gt;<br>&gt;<br>&gt;&nbsp;&nbsp; typedef itk::NumericSeriesFileNames&nbsp;&nbsp;&nbsp;&nbsp;NameGeneratorType;<br>&gt;<br>&gt;&nbsp;&nbsp; NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New();<br>&gt;<br>&gt;<br>&gt;&nbsp;&nbsp; nameGenerator-&gt;SetSeriesFormat( "file%03d.png" );<br>&gt;<br>&gt;&nbsp;&nbsp; nameGenerator-&gt;SetStartIndex(
 first);<br>&gt;&nbsp;&nbsp; nameGenerator-&gt;SetEndIndex( last );<br>&gt;&nbsp;&nbsp; nameGenerator-&gt;SetIncrementIndex( 1 );<br>&gt;<br>&gt;<br>&gt;<br>&gt;&nbsp;&nbsp; reader-&gt;SetImageIO( itk::PNGImageIO::New() );<br>&gt;<br>&gt;&nbsp;&nbsp;reader-&gt;SetFileNames( nameGenerator-&gt;GetFileNames()&nbsp;&nbsp;);<br>&gt;<br>&gt;<br>&gt;&nbsp;&nbsp; writer-&gt;SetFileName( outputFilename );<br>&gt;<br>&gt;&nbsp;&nbsp; writer-&gt;SetInput( reader-&gt;GetOutput() );<br>&gt;<br>&gt;&nbsp;&nbsp; try<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; writer-&gt;Update();<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&gt;&nbsp;&nbsp; catch( itk::ExceptionObject &amp; err )<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; "ExceptionObject caught !" &lt;&lt; std::endl;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; err &lt;&lt; std::endl;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; return EXIT_FAILURE;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;
 }<br>&gt;<br>&gt;<br>&gt;&nbsp;&nbsp; return EXIT_SUCCESS;<br>&gt; }<br>&gt;<br>&gt;<br>&gt; Thank you,<br>&gt; Emma<br>&gt;<br>&gt; ------------------------------------------------------------------------<br>&gt; Building a website is a piece of cake.<br>&gt; Yahoo! Small Business gives you all the tools to get online. <br>&gt; &lt;<a target="_blank" href="http://us.rd.yahoo.com/evt=48251/*http://smallbusiness.yahoo.com/webhosting/?p=PASSPORTPLUS">http://us.rd.yahoo.com/evt=48251/*http://smallbusiness.yahoo.com/webhosting/?p=PASSPORTPLUS</a>&gt;<br>&gt;<br>&gt;<br>&gt; ------------------------------------------------------------------------<br>&gt; Don't get soaked. Take a quick peak at the forecast <br>&gt; &lt;<a target="_blank" href="http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&amp;#news">http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&amp;#news</a>&gt;<br>&gt; with theYahoo! Search weather shortcut. <br>&gt; &lt;<a target="_blank"
 href="http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&amp;#news">http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&amp;#news</a>&gt;<br>&gt;<br>&gt;------------------------------------------------------------------------<br>&gt;<br>&gt;_______________________________________________<br>&gt;Insight-users mailing list<br>&gt;Insight-users@itk.org<br>&gt;<a target="_blank" href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a><br>&gt;&nbsp;&nbsp;<br>&gt;<br><br><br>-- <br>==========================================================<br>Andinet A. Enquobahrie, PhD<br>R&amp;D Engineer<br>Kitware Inc.<br><br>28 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-371-3971 x124<br><a target="_blank" href="http://www.kitware.com">www.kitware.com</a><br><br><br></div></div><br></div></div><br>
      <hr size=1>Boardwalk for $500? In 2007? Ha! <br><a href="http://us.rd.yahoo.com/evt=48223/*http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow">Play Monopoly Here and Now</a> (it's updated for today's economy) at Yahoo! Games.</body></html>