<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">
<DIV>Hi</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>1) I mean to say where is files from a_vm1455.raw to a_vm1905.raw ?
Is it same directory where you load VHPabdomen.mhd ?</DIV>
<DIV>2) Your input image VHPabdomen.mhd is color or gray scale ?</DIV>
<DIV>3) After loading VHPabdomen.mhd do you want to produce slices or want to do
any conversion ?</DIV>
<DIV> </DIV>
<DIV>Your code is not complete . If you can tell exactly what you want to do
then we can help.</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV
style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt"><BR><BR><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 4:05 PM</DIV>
<DIV><B>To:</B> <A title=alexdowson@hotmail.com
href="mailto:alexdowson@hotmail.com">alexdowson@hotmail.com</A> </DIV>
<DIV><B>Subject:</B> Re:</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">Hi
<DIV>Sorry I am not very clear what you need.I have attached my .mhd file.Did
you go through it .IF you need any clarification pl let me know.</DIV>
<DIV> </DIV>
<DIV>Shirani</DIV>
<DIV> </DIV>
<DIV>
<DIV class=gmail_quote>---------- Forwarded message ----------<BR>From: <B
class=gmail_sendername>shirani kannangara</B> <SPAN dir=ltr><<A
href="mailto:mangalika673@gmail.com"
target=_blank>mangalika673@gmail.com</A>></SPAN><BR>Date: Tue, Sep 18, 2012
at 3:39 PM<BR>Subject: <BR>To: <A href="mailto:alexdowson@hotmail.com"
target=_blank>alexdowson@hotmail.com</A><BR>Cc: <A
href="mailto:insight-users@itk.org"
target=_blank>insight-users@itk.org</A><BR><BR><BR>
<DIV> </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-wrap"></SPAN>#include "itkImage.h"</DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN>#include
"itkImageSeriesReader.h"</DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN>#include
"itkImageFileWriter.h"</DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN>#include
"itkNumericSeriesFileNames.h"</DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN>#include "itkPNGImageIO.h"</DIV>
<DIV> <SPAN style="WHITE-SPACE: pre-wrap"></SPAN>#include
<iostream></DIV>
<DIV> #include <string></DIV>
<DIV> <SPAN style="WHITE-SPACE: pre-wrap"></SPAN>using namespace
std;</DIV>
<DIV> </DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></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-wrap"> </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-wrap">
</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><SPAN><FONT color=#888888>
<DIV> </DIV>
<DIV>Shirani</DIV></FONT></SPAN></DIV>
<DIV> </DIV></DIV></DIV></DIV></DIV></BODY></HTML>