<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">
<DIV>&nbsp;</DIV>
<DIV>Hi</DIV>
<DIV 
style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">&nbsp;</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">&nbsp;</DIV>
<DIV 
style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">&nbsp;</DIV>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">alex</DIV>
<DIV 
style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt"><BR>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;&nbsp; <SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>#include &lt;iostream&gt;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #include &lt;string&gt;</DIV>
<DIV>&nbsp;&nbsp; <SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>using namespace std;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; </DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN></DIV>
<DIV>int main(&nbsp; int argc, char **argv[])</DIV>
<DIV>&nbsp;</DIV>
<DIV>{</DIV>
<DIV>&nbsp;&nbsp;&nbsp; if( argc &lt;4 );</DIV>
<DIV>&nbsp;&nbsp;&nbsp; </DIV>
<DIV>&nbsp; {std::cout &lt;&lt; "Usage: " &lt;&lt; std::endl;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; std::cout&lt;&lt;argv[0] &lt;&lt;&nbsp; " 
firstSliceValue lastSliceValue&nbsp; outputImageFile " &lt;&lt; std::endl;</DIV>
<DIV>&nbsp;&nbsp; return EXIT_FAILURE;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; }<SPAN style="WHITE-SPACE: pre" class=Apple-tab-span> 
</SPAN></DIV>
<DIV>&nbsp;&nbsp; </DIV>
<DIV>&nbsp; //std::cout&lt;&lt;"sliceValue:"&lt;&lt;std::endl;</DIV>
<DIV>&nbsp; typedef unsigned 
char&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
PixelType;</DIV>
<DIV>&nbsp; const unsigned int<SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span> </SPAN>Dimension = 3;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; typedef itk::Image&lt; PixelType, Dimension&gt;&nbsp; 
ImageType;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; typedef itk::ImageSeriesReader&lt; ImageType &gt;&nbsp; 
ReaderType;</DIV>
<DIV>&nbsp; typedef itk::ImageFileWriter&lt;&nbsp;&nbsp; ImageType &gt;&nbsp; 
WriterType;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; ReaderType::Pointer reader = ReaderType::New();</DIV>
<DIV>&nbsp; WriterType::Pointer writer = WriterType::New();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; const unsigned int first = 1;</DIV>
<DIV>&nbsp; const unsigned int last&nbsp; = 450;</DIV>
<DIV>&nbsp; //char * outputFilename = argv[3];</DIV>
<DIV>&nbsp;&nbsp; char**outputFilename=&nbsp; argv[3];</DIV>
<DIV> </DIV>
<DIV>&nbsp; typedef itk::NumericSeriesFileNames NameGeneratorType;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; NameGeneratorType::Pointer nameGenerator = 
NameGeneratorType::New();</DIV>
<DIV> </DIV>
<DIV>&nbsp; nameGenerator-&gt;SetSeriesFormat( "D:\\To_SMK\\VHPAbdomen%03d.mhd" 
);</DIV>
<DIV>&nbsp; nameGenerator-&gt;SetStartIndex( first );</DIV>
<DIV>&nbsp; nameGenerator-&gt;SetEndIndex( last);</DIV>
<DIV>&nbsp; nameGenerator-&gt;SetIncrementIndex(1);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; reader-&gt;SetImageIO( itk::PNGImageIO::New() );</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; reader-&gt;SetFileNames( nameGenerator-&gt;GetFileNames()&nbsp; 
);</DIV>
<DIV>&nbsp; writer-&gt;SetInput( reader-&gt;GetOutput() );</DIV>
<DIV>&nbsp; writer-&gt;SetFileName("test.mhd");</DIV>
<DIV>try</DIV>
<DIV>&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp; writer-&gt;Update();</DIV>
<DIV>&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp; catch( itk::ExceptionObject &amp; err )</DIV>
<DIV>&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; "ExceptionObject caught !" &lt;&lt; 
std::endl;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; err &lt;&lt; std::endl;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; return EXIT_FAILURE;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; };</DIV>
<DIV> </DIV>
<DIV>&nbsp; return 0;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; }</DIV>
<DIV> </DIV></DIV>
<DIV>OUTPUT </DIV>
<DIV>&nbsp;</DIV>
<DIV>D:\image\Debug&gt;ImageReadWrite.exe</DIV>
<DIV>Usage:</DIV>
<DIV>0022D9E0 firstSliceValue lastSliceValue&nbsp; outputImageFile</DIV>
<DIV>&nbsp;</DIV>
<DIV>D:\image\Debug&gt;ImageReadWrite.exe(1 450 test.mhd)</DIV>
<DIV>Usage:</DIV>
<DIV>00E71324 firstSliceValue lastSliceValue&nbsp; outputImageFile</DIV>
<DIV>&nbsp;</DIV>
<DIV>D:\image\Debug&gt;ImageReadWrite.exe(1,450,test.mhd)</DIV>
<DIV>Usage:</DIV>
<DIV>0115131C firstSliceValue lastSliceValue&nbsp; outputImageFile</DIV>
<DIV>&nbsp;</DIV>
<DIV>D:\image\Debug&gt;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thankas </DIV>
<DIV>&nbsp;</DIV>
<DIV>Shirani</DIV></DIV></DIV></DIV></BODY></HTML>