<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">
<DIV>It’s compiler error of code mistake.</DIV>
<DIV> </DIV>
<DIV><FONT face=Verdana></FONT> </DIV>
<DIV><FONT face=Verdana>int main( int argc, char * argv[] );</FONT></DIV>
<DIV><FONT face=Verdana>char test;</FONT></DIV>
<DIV><FONT face=Verdana>{</FONT></DIV>
<DIV><FONT face=Verdana></FONT> </DIV>
<DIV><FONT face=Verdana>should be</FONT></DIV>
<DIV><FONT face=Verdana>int main( int argc, char * argv[] )</FONT></DIV>
<DIV><FONT face=Verdana>{</FONT></DIV>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt"><FONT
face=Verdana> </FONT></DIV>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt"><FONT
face=Verdana> char test;</FONT><BR></DIV>
<DIV
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<DIV style="FONT: 10pt tahoma">
<DIV><FONT size=3 face=Calibri></FONT> </DIV>
<DIV><FONT size=3 face=Calibri></FONT> </DIV>
<DIV><FONT size=3 face=Calibri>Alex</FONT></DIV>
<DIV> </DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=mangalika673@gmail.com
href="mailto:mangalika673@gmail.com">shirani kannangara</A> </DIV>
<DIV><B>Sent:</B> Monday, September 17, 2012 4:03 PM</DIV>
<DIV><B>To:</B> <A title=insight-users@itk.org
href="mailto:insight-users@itk.org">insight-users@itk.org</A> </DIV>
<DIV><B>Subject:</B> [Insight-users] read rgb values</DIV></DIV></DIV>
<DIV> </DIV></DIV>
<DIV
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none"><SPAN
style="BACKGROUND-COLOR: rgb(229,229,229); FONT-FAMILY: verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif; FONT-SIZE: 13px">I
am constructing a program </SPAN><SPAN
style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: arial,sans-serif; COLOR: rgb(34,34,34); FONT-SIZE: 12px">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="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: arial,sans-serif; COLOR: rgb(34,34,34); FONT-SIZE: 12px">using
itk version 4.2 and CMake2.8.9.</SPAN> <SPAN
style="BACKGROUND-COLOR: rgb(229,229,229); FONT-FAMILY: verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif; FONT-SIZE: 13px">
I have constructed and spent many hours on my last error. </SPAN><BR
style="BACKGROUND-COLOR: rgb(229,229,229); FONT-FAMILY: verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif; FONT-SIZE: 13px">
<DIV><SPAN
style="BACKGROUND-COLOR: rgb(229,229,229); FONT-FAMILY: verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif; FONT-SIZE: 13px"><BR></SPAN></DIV>
<DIV><SPAN
style="BACKGROUND-COLOR: rgb(229,229,229); FONT-FAMILY: verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif; FONT-SIZE: 13px">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> </DIV>
<DIV>#include <string></DIV>
<DIV> </DIV>
<DIV>using namespace std;</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>// Software Guide : EndCodeSnippet</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>int main( int argc, char * argv[] );</DIV>
<DIV>char test;</DIV>
<DIV> </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> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> typedef itk::RGBPixel< unsigned char
> PixelType;</DIV>
<DIV> const unsigned int Dimension = 3;</DIV>
<DIV> </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> </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> </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> </DIV>
<DIV> NameGeneratorType::Pointer nameGenerator =
NameGeneratorType::New();</DIV>
<DIV> </DIV>
<DIV> const char * outputFilename = argv[3];</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> typedef itk::NumericSeriesFileNames
NameGeneratorType;</DIV>
<DIV> </DIV>
<DIV> NameGeneratorType::Pointer nameGenerator =
NameGeneratorType::New();</DIV>
<DIV> </DIV>
<DIV> nameGenerator->SetStartIndex( first );</DIV>
<DIV> nameGenerator->SetEndIndex( last );</DIV>
<DIV> nameGenerator->SetIncrementIndex( 0.333 );</DIV>
<DIV> </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> </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> </DIV>
<DIV> typedef itk::ImageSeriesWriter< ImageType, Image2DType >
SeriesWriterType;</DIV>
<DIV> </DIV>
<DIV> SeriesWriterType::Pointer seriesWriter =
SeriesWriterType::New();</DIV>
<DIV> </DIV>
<DIV> seriesWriter->SetInput( seriesReader->GetOutput() );</DIV>
<DIV> </DIV>
<DIV> </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> </DIV></FONT></DIV>
<DIV><FONT
face="verdana, geneva, lucida, lucida grande, arial, helvetica, sans-serif"><BR></FONT></DIV>
<P>
<HR>
_____________________________________<BR>Powered by www.kitware.com<BR><BR>Visit
other Kitware open-source projects
at<BR>http://www.kitware.com/opensource/opensource.html<BR><BR>Kitware offers
ITK Training Courses, for more information
visit:<BR>http://www.kitware.com/products/protraining.php<BR><BR>Please keep
messages on-topic and check the ITK FAQ
at:<BR>http://www.itk.org/Wiki/ITK_FAQ<BR><BR>Follow this link to
subscribe/unsubscribe:<BR>http://www.itk.org/mailman/listinfo/insight-users<BR></DIV></DIV></DIV></BODY></HTML>