<span style="font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:13px;background-color:rgb(229,229,229)">I am constructing a program </span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.666666984558105px;background-color:rgb(255,255,255)"> to read rgb values in a raw image data set of a human abdomen obtained from a CT scan(VHP abdomen).Slice dimensions are 675,401,450 and spacing0.333 etc.) I used RGBImageSeriesReadeWrite.cxx.I am </span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255);font-size:12px">using itk version 4.2 and CMake2.8.9.</span> <span style="font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:13px;background-color:rgb(229,229,229)"> I have constructed and spent many hours on my last error. </span><br style="font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:13px;background-color:rgb(229,229,229)">
<div><span style="font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:13px;background-color:rgb(229,229,229)"><br></span></div><div><span style="font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:13px;background-color:rgb(229,229,229)">Error:</span><font face="verdana, geneva, lucida, lucida grande, arial, helvetica, sans-serif">error C2447: '{' : missing function header (old-style formal list?)</font></div>
<div><font face="verdana, geneva, lucida, lucida grande, arial, helvetica, sans-serif"><br></font></div><div><font face="verdana, geneva, lucida, lucida grande, arial, helvetica, sans-serif">Pl help me get it corrected.</font></div>
<div><font face="verdana, geneva, lucida, lucida grande, arial, helvetica, sans-serif">Thanks</font></div><div><font face="verdana, geneva, lucida, lucida grande, arial, helvetica, sans-serif">Shirani</font></div><div><font face="verdana, geneva, lucida, lucida grande, arial, helvetica, sans-serif"><br>
</font></div><div><font face="verdana, geneva, lucida, lucida grande, arial, helvetica, sans-serif">codes</font></div><div><font face="verdana, geneva, lucida, lucida grande, arial, helvetica, sans-serif"><div>#include "itkRGBPixel.h"</div>
<div>#include "itkImage.h"</div><div>#include "itkImageSeriesReader.h"</div><div>#include "itkImageSeriesWriter.h"</div><div>#include "itkNumericSeriesFileNames.h"</div><div>#include "itkPNGImageIO.h"</div>
<div><br></div><div>#include <string></div><div><br></div><div>using namespace std;</div><div> </div><div><br></div><div>// Software Guide : EndCodeSnippet</div><div><br></div><div><br></div><div>int main( int argc, char * argv[] );</div>
<div>char test;</div><div><br></div><div>{</div><div> // Verify the number of parameters in the command line</div><div> if( argc < 4 )</div><div> {</div><div> std::cout << "Usage: " << std::endl;</div>
<div> std::cout << argv[0] << "first last outputRGBImageFile " << std::endl;</div><div> return EXIT_FAILURE;</div><div> }</div><div><br></div><div><br></div><div> </div><div> typedef itk::RGBPixel< unsigned char > PixelType;</div>
<div> const unsigned int Dimension = 3;</div><div><br></div><div> typedef itk::Image< PixelType, Dimension > ImageType;</div><div> </div></font><div style="font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif">
// Software Guide : BeginCodeSnippet</div><div style="font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif"> typedef itk::ImageSeriesReader< ImageType > SeriesReaderType;</div><div style="font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif">
typedef itk::ImageFileWriter< ImageType > WriterType;</div><div><br></div><font face="verdana, geneva, lucida, lucida grande, arial, helvetica, sans-serif"><div> SeriesReaderType::Pointer seriesReader = SeriesReaderType::New();</div>
<div> WriterType::Pointer writer = WriterType::New();</div><div> </div><div> reader->SetFileName("D:\\To_SMK\\VHPAbdomen.mhd");</div><div> reader->Update();</div><div><br></div><div> const unsigned int first = 1;</div>
<div> const unsigned int last = 450;</div><div> </div><div> const char*outputFilename= argv[3];</div><div> </div><div> typedef itk::NumericSeriesFileNames NameGeneratorType;</div><div><br></div><div> NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New();</div>
<div> </div><div> const char * outputFilename = argv[3];</div><div><br></div><div> </div><div> typedef itk::NumericSeriesFileNames NameGeneratorType;</div><div><br></div><div> NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New();</div>
<div><br></div><div> nameGenerator->SetStartIndex( first );</div><div> nameGenerator->SetEndIndex( last );</div><div> nameGenerator->SetIncrementIndex( 0.333 );</div><div><br></div><div> nameGenerator->SetSeriesFormat( "vwe%03d.png" );</div>
<div> </div><div> </div><div> seriesReader->SetImageIO( itk::PNGImageIO::New() );</div><div> </div><div> seriesReader->SetFileNames( nameGenerator->GetFileNames() );</div><div> </div><div> </div><div> writer->SetFileName( "test.png" );</div>
<div><br></div><div> writer->SetInput( seriesReader->GetOutput() );</div><div> </div><div> </div><div> try</div><div> {</div><div> writer->Update();</div><div> }</div><div> catch( itk::ExceptionObject & excp )</div>
<div> {</div><div> std::cerr << "Error reading the series " << std::endl;</div><div> std::cerr << excp << std::endl;</div><div> }</div><div> </div><div> typedef itk::Image< PixelType, 2 > Image2DType;</div>
<div><br></div><div> typedef itk::ImageSeriesWriter< ImageType, Image2DType > SeriesWriterType;</div><div><br></div><div> SeriesWriterType::Pointer seriesWriter = SeriesWriterType::New();</div><div><br></div><div>
seriesWriter->SetInput( seriesReader->GetOutput() );</div><div> </div><div><br></div><div> </div><div> try</div><div> {</div><div> seriesWriter->Update();</div><div> }</div><div> catch( itk::ExceptionObject & excp )</div>
<div> {</div><div> std::cerr << "Error reading the series " << std::endl;</div><div> std::cerr << excp << std::endl;</div><div> }</div><div> </div><div> return EXIT_SUCCESS;</div>
<div>}</div><div><br></div></font></div><div><font face="verdana, geneva, lucida, lucida grande, arial, helvetica, sans-serif"><br></font></div>