<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV>Hi All,</DIV>
<DIV> </DIV>
<DIV>Please see the code attached. <BR>It should read the 3 slices and write them as a tiff file but it only reads the 2nd slice and write it 3 times in a tiff file. Apparently it is incrementing the start index by 1 and reading that slice 3 times. <BR>Can some body please help me in finding what i m doing wrong?</DIV>
<DIV>Many many thanks<BR>Nadia</DIV>
<DIV> </DIV>
<DIV>///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////</DIV>
<DIV><BR>typedef unsigned char PixelType;<BR> const unsigned int Dimension = 3;<BR> </DIV>
<DIV> typedef itk::Image< PixelType, Dimension > ImageType;<BR> <BR> typedef itk::ImageSeriesReader< ImageType > ReaderType;<BR> typedef itk::ImageFileWriter<ImageType> WriterType;</DIV>
<DIV><BR> WriterType::Pointer writer = WriterType::New();<BR> ReaderType::Pointer reader1 = ReaderType::New();</DIV>
<DIV> typedef itk::NumericSeriesFileNames NameGeneratorType;</DIV>
<DIV> NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New();</DIV>
<DIV> nameGenerator->SetSeriesFormat( "clint_binary_080320_noDescription%04d.tiff" );</DIV>
<DIV> nameGenerator->SetStartIndex(1);<BR> nameGenerator->SetEndIndex(3);<BR> nameGenerator->SetIncrementIndex(1);</DIV>
<DIV><BR> reader1->SetImageIO( itk::TIFFImageIO::New() );</DIV>
<DIV> reader1->SetFileNames( nameGenerator->GetFileNames() );</DIV>
<DIV><BR> writer->SetFileName("labeledImage.tif");<BR> writer->SetInput(reader1->GetOutput());<BR> try <BR> { <BR> <BR> writer->Update(); </DIV>
<DIV> } </DIV></td></tr></table><br>