<div>Hi all,</div> <div> </div> <div>I am having problem in reading/writing a metaheader file (.mhd + .raw). The raw file is an original visible human slice image in RGB. I wrote the metaheader file myself (see below), and wanted to read .raw file thru it. I tested with a PNG file for the same slice, so that I can easily compare the result. What I want is to confirm compatiblity between image file types (.mhd to .mhd, .mhd to .png, and vice versa).</div> <div> </div> <div>Here is what happened:</div> <div>- .png to .png : worked just fine - it produced the same RGB color image.</div> <div>- .mhd to .png : produced strange result - there are nine(3x3) B/W image blocks in the same size of the image.</div> <div> </div> <div>Q1: Anything wrong with my code? My meta file and code are shown below.</div> <div>Q2: Is there any free image viewer for both 2D
and 3D .mhd file? </div> <div>Or recommentations for each type separately?</div> <div> </div> <div>Thanks in advance,</div> <div>Young.</div> <div> </div> <div>< Meta file ></div> <div>ObjectType = Image<BR>NDims = 2<BR>BinaryData = True<BR>BinaryDataByteOrderMSB = False<BR>CompressedData = False<BR>TransformMatrix = 1 0 0 1<BR>Offset = 0 0<BR>CenterOfRotation = 0 0<BR>ElementSpacing = 1 1<BR>DimSize = 2048 1216<BR>AnatomicalOrientation = ??<BR>ElementNumberOfChannels = 3<BR>ElementType = MET_UCHAR<BR>ElementDataFile = a_vm1150.raw</div> <div> </div> <div>< Code for Reading-Writing ></div><FONT size=2> <div></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> itk::RGBPixel< </FONT><FONT color=#0000ff size=2>unsigned</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>char</FONT><FONT size=2> > RGBPixelType;</div> <div></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> itk::Image< RGBPixelType, 2 >
RGBImageType;</div> <div></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> itk::ImageFileReader< RGBImageType > RGBReaderType;</div> <div></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> itk::ImageFileWriter< RGBImageType > RGBWriterType;</div></FONT> <div> </div><FONT size=2> <div>RGBImageType::Pointer image = RGBImageType::New();</div> <div>RGBReaderType::Pointer reader = RGBReaderType::New();</div> <div>RGBWriterType::Pointer writer = RGBWriterType::New();</div> <div>reader->SetFileName(</FONT><FONT color=#800000 size=2>"C:\\a_vm1150.mhd"</FONT><FONT size=2>);</div> <div>writer->SetFileName(</FONT><FONT color=#800000 size=2>"C:\\a_vm1150_out.png"</FONT><FONT size=2>);</div></FONT> <div> </div><FONT size=2> <div>writer->SetInput(reader->GetOutput());</div> <div>writer->Update();</div> <div> </div> <div>--- End of message ---</div> <div> </div> <div> </div></FONT><p> 
<hr size=1><a href="http://us.rd.yahoo.com/evt=48250/*http://searchmarketing.yahoo.com/arp/sponsoredsearch_v9.php?o=US2226&cmp=Yahoo&ctv=AprNI&s=Y&s2=EM&b=50">Pinpoint customers </a>who are looking for what you sell.