<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">
<DIV> </DIV>
<DIV>Hi</DIV>
<DIV
style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt"> </DIV>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">You send me
only .mhd file there will be .raw file associate with it required to load. Send
me .raw file also of same to check.</DIV>
<DIV
style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt"> </DIV>
<DIV
style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt"> </DIV>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">alex</DIV>
<DIV
style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt"><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> </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> Tuesday, September 18, 2012 3:39 PM</DIV>
<DIV><B>To:</B> <A title=alexdowson@hotmail.com
href="mailto:alexdowson@hotmail.com">alexdowson@hotmail.com</A> </DIV>
<DIV><B>Cc:</B> <A title=insight-users@itk.org
href="mailto:insight-users@itk.org">insight-users@itk.org</A> </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">
<DIV>Hi</DIV>
<DIV>Thanks for your mail.I corrected some codes as you mentioned. But couldn't
read rgb values using RGBSeriesImageReadWrite.cxx.Then I tried to read and write
the image data(raw data -VHPAbdomen.mhd)in itk.codes are as follows.But it does
not write all.MY raw data file is attached herewith.</DIV>
<DIV>
<DIV> </DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN>#include
"itkImage.h"</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN>#include
"itkImageSeriesReader.h"</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN>#include
"itkImageFileWriter.h"</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN>#include
"itkNumericSeriesFileNames.h"</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN>#include
"itkPNGImageIO.h"</DIV>
<DIV> <SPAN style="WHITE-SPACE: pre"
class=Apple-tab-span></SPAN>#include <iostream></DIV>
<DIV> #include <string></DIV>
<DIV> <SPAN style="WHITE-SPACE: pre"
class=Apple-tab-span></SPAN>using namespace std;</DIV>
<DIV> </DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN></DIV>
<DIV>int main( int argc, char **argv[])</DIV>
<DIV> </DIV>
<DIV>{</DIV>
<DIV> if( argc <4 );</DIV>
<DIV> </DIV>
<DIV> {std::cout << "Usage: " << std::endl;</DIV>
<DIV> std::cout<<argv[0] << "
firstSliceValue lastSliceValue outputImageFile " << std::endl;</DIV>
<DIV> return EXIT_FAILURE;</DIV>
<DIV> }<SPAN style="WHITE-SPACE: pre" class=Apple-tab-span>
</SPAN></DIV>
<DIV> </DIV>
<DIV> //std::cout<<"sliceValue:"<<std::endl;</DIV>
<DIV> typedef unsigned
char
PixelType;</DIV>
<DIV> const unsigned int<SPAN style="WHITE-SPACE: pre"
class=Apple-tab-span> </SPAN>Dimension = 3;</DIV>
<DIV> </DIV>
<DIV> typedef itk::Image< PixelType, Dimension>
ImageType;</DIV>
<DIV> </DIV>
<DIV> typedef itk::ImageSeriesReader< ImageType >
ReaderType;</DIV>
<DIV> typedef itk::ImageFileWriter< ImageType >
WriterType;</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> ReaderType::Pointer reader = ReaderType::New();</DIV>
<DIV> WriterType::Pointer writer = WriterType::New();</DIV>
<DIV> </DIV>
<DIV> const unsigned int first = 1;</DIV>
<DIV> const unsigned int last = 450;</DIV>
<DIV> //char * outputFilename = argv[3];</DIV>
<DIV> 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> nameGenerator->SetSeriesFormat( "D:\\To_SMK\\VHPAbdomen%03d.mhd"
);</DIV>
<DIV> nameGenerator->SetStartIndex( first );</DIV>
<DIV> nameGenerator->SetEndIndex( last);</DIV>
<DIV> nameGenerator->SetIncrementIndex(1);</DIV>
<DIV> </DIV>
<DIV> reader->SetImageIO( itk::PNGImageIO::New() );</DIV>
<DIV> </DIV>
<DIV> reader->SetFileNames( nameGenerator->GetFileNames()
);</DIV>
<DIV> writer->SetInput( reader->GetOutput() );</DIV>
<DIV> writer->SetFileName("test.mhd");</DIV>
<DIV>try</DIV>
<DIV> {</DIV>
<DIV> writer->Update();</DIV>
<DIV> }</DIV>
<DIV> catch( itk::ExceptionObject & err )</DIV>
<DIV> {</DIV>
<DIV> std::cerr << "ExceptionObject caught !" <<
std::endl;</DIV>
<DIV> std::cerr << err << std::endl;</DIV>
<DIV> return EXIT_FAILURE;</DIV>
<DIV> };</DIV>
<DIV> </DIV>
<DIV> return 0;</DIV>
<DIV> </DIV>
<DIV> }</DIV>
<DIV> </DIV></DIV>
<DIV>OUTPUT </DIV>
<DIV> </DIV>
<DIV>D:\image\Debug>ImageReadWrite.exe</DIV>
<DIV>Usage:</DIV>
<DIV>0022D9E0 firstSliceValue lastSliceValue outputImageFile</DIV>
<DIV> </DIV>
<DIV>D:\image\Debug>ImageReadWrite.exe(1 450 test.mhd)</DIV>
<DIV>Usage:</DIV>
<DIV>00E71324 firstSliceValue lastSliceValue outputImageFile</DIV>
<DIV> </DIV>
<DIV>D:\image\Debug>ImageReadWrite.exe(1,450,test.mhd)</DIV>
<DIV>Usage:</DIV>
<DIV>0115131C firstSliceValue lastSliceValue outputImageFile</DIV>
<DIV> </DIV>
<DIV>D:\image\Debug></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Thankas </DIV>
<DIV> </DIV>
<DIV>Shirani</DIV></DIV></DIV></DIV></BODY></HTML>