<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;">Hi Luis,<br><br> Thank you for your reply. Yes, the .png files recreated from the .vtk file (by doing a ImageReadImageSeriesWrite) opens fine in Volview. I do get a normal visualization. While this suffices my requirements, I was wondering why Volview was not being able to read the .vtk file. I would rather fix the bug now than later as it might be difficult to trace the origins. If you have any further suggestions, please do let me know. <br><br>Has anyone ever encountered a problem reading .vtk files generated using ITK ? <br><br>Thank you,<br>Emma<br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Luis Ibanez <luis.ibanez@kitware.com><br>To:
Emma Ryan <eryanvtk@yahoo.com><br>Cc: Andinet Enquobahrie <andinet.enqu@kitware.com>; insight-users@itk.org<br>Sent: Tuesday, June 12, 2007 6:28:19 PM<br>Subject: Re: [Insight-users] ImageSeriesReadWrite only reads first file.<br><br><div><br>Hi Emma,<br><br>Note that you can directly read in VolView the set of PNG images,<br>you don't really need to convert them to .vtk.<br><br>Simply load one of the .png images, and Volview will offer you<br>the option of completing the series.<br><br>Please let us know if by loading the data in this way, you<br>get a normal visualization.<br><br><br> Thanks<br><br><br> Luis<br><br><br>--------------------<br>Emma Ryan wrote:<br>> 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 <br>> .vtk and write out Image series, using the ImageReadImageSeriesWrite.cpp
<br>> file, I can recreate the original 32 2D slices.<br>> <br>> I am simply not able to view them using volview. Any clues ! Volview <br>> does ask for Z-spacing and units, but then it displays nothing.<br>> <br>> Emma<br>> <br>> <br>> ----- Original Message ----<br>> From: Andinet Enquobahrie <andinet.enqu@kitware.com><br>> To: Emma Ryan <eryanvtk@yahoo.com><br>> Sent: Tuesday, June 12, 2007 5:31:13 AM<br>> Subject: Re: [Insight-users] ImageSeriesReadWrite only reads first file.<br>> <br>> Emma Ryan wrote:<br>> <br>> ><br>> > Hi,<br>> ><br>> > I am trying to generate a .vtk file (3D ) from a set of .png<br>> > images. I use the ImageSeriesReadWrite.cxx example provided in ITK as<br>> > is. My command line syntax is "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>> ><br>> > i.e SeriesRW is the executable, there are 32 slices starting from 0,<br>> > and the output format is supposed to be .vtk , so that I can open it<br>> > using Volview.<br>> ><br>> > While the program executes with no errors or warnings, when I open<br>> > output.vtk file in Volview, it seems to be empty.<br>> ><br>> > I am not sure why this. If anyone has a clue as to why this happens,<br>> > please let me know. Here is the code.<br>> ><br>> > #include "itkImage.h"<br>> > #include "itkImageSeriesReader.h"<br>> > #include "itkImageFileWriter.h"<br>> >
#include "itkNumericSeriesFileNames.h"<br>> > #include "itkPNGImageIO.h"<br>> ><br>> ><br>> > int main( int argc, char ** argv )<br>> > {<br>> > <br>> > if( argc < 4 )<br>> > {<br>> > std::cerr << "Usage: " << std::endl;<br>> > std::cerr << argv[0] << " firstSliceValue lastSliceValue <br>> > outputImageFile " << std::endl;<br>> > return EXIT_FAILURE;<br>> > }<br>> ><br>> ><br>> > typedef unsigned
char PixelType;<br>> > const unsigned int Dimension = 3;<br>> ><br>> > typedef itk::Image< PixelType, Dimension > ImageType;<br>> ><br>> > typedef itk::ImageSeriesReader< ImageType > ReaderType;<br>> > typedef itk::ImageFileWriter< ImageType > WriterType;<br>> ><br>> > ReaderType::Pointer reader = ReaderType::New();<br>> > WriterType::Pointer writer = WriterType::New();<br>> ><br>> > const unsigned int first = atoi( argv[1] );<br>> > const unsigned int last = atoi( argv[2]
);<br>> ><br>> > const char * outputFilename = argv[3];<br>> ><br>> ><br>> > typedef itk::NumericSeriesFileNames NameGeneratorType;<br>> ><br>> > NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New();<br>> ><br>> ><br>> > nameGenerator->SetSeriesFormat( "file%03d.png" );<br>> ><br>> > nameGenerator->SetStartIndex( first);<br>> > nameGenerator->SetEndIndex( last );<br>> > nameGenerator->SetIncrementIndex( 1 );<br>> ><br>> ><br>> ><br>> > reader->SetImageIO( itk::PNGImageIO::New()
);<br>> ><br>> > reader->SetFileNames( nameGenerator->GetFileNames() );<br>> ><br>> ><br>> > writer->SetFileName( outputFilename );<br>> ><br>> > writer->SetInput( reader->GetOutput() );<br>> ><br>> > try<br>> > {<br>> > writer->Update();<br>> > }<br>> > catch( itk::ExceptionObject & err )<br>> > {<br>> > std::cerr << "ExceptionObject caught !" << std::endl;<br>> > std::cerr << err << std::endl;<br>> > return
EXIT_FAILURE;<br>> > }<br>> ><br>> ><br>> > return EXIT_SUCCESS;<br>> > }<br>> ><br>> ><br>> > Thank you,<br>> > Emma<br>> ><br>> > ------------------------------------------------------------------------<br>> > Building a website is a piece of cake.<br>> > Yahoo! Small Business gives you all the tools to get online.<br>> > <br>> <<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>><br>> ><br>> ><br>> >
------------------------------------------------------------------------<br>> > Don't get soaked. Take a quick peak at the forecast<br>> > <<a target="_blank" href="http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&#news">http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&#news</a> <br>> <<a target="_blank" href="http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&#news">http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&#news</a>>><br>> > with theYahoo! Search weather shortcut.<br>> > <<a target="_blank" href="http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&#news">http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&#news</a> <br>> <<a target="_blank"
href="http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&#news">http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&#news</a>>><br>> ><br>> >------------------------------------------------------------------------<br>> ><br>> >_______________________________________________<br>> >Insight-users mailing list<br>> >Insight-users@itk.org<br>> ><a target="_blank" href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a><br>> > <br>> ><br>> <br>> <br>> -- <br>> ==========================================================<br>> Andinet A. Enquobahrie, PhD<br>> R&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> <<a target="_blank" href="http://www.kitware.com">http://www.kitware.com</a>><br>> <br>> <br>> <br>> <br>> ------------------------------------------------------------------------<br>> Boardwalk for $500? In 2007? Ha!<br>> Play Monopoly Here and Now <br>> <<a target="_blank" href="http://us.rd.yahoo.com/evt=48223/*http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow">http://us.rd.yahoo.com/evt=48223/*http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow</a>> <br>> (it's updated for today's economy) at Yahoo! Games.<br>> <br>> <br>> ------------------------------------------------------------------------<br>> <br>> _______________________________________________<br>> Insight-users mailing list<br>> Insight-users@itk.org<br>> <a target="_blank"
href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a><br></div></div><br></div></div><br>
<hr size=1><a href="
http://us.rd.yahoo.com/evt=49981/*http://advision.webevents.yahoo.com/mailbeta/features_spam.html">Sucker-punch spam</a> with award-winning protection.<br> Try the <a href="
http://us.rd.yahoo.com/evt=49981/*http://advision.webevents.yahoo.com/mailbeta/features_spam.html">free Yahoo! Mail Beta.</a></body></html>