<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2658.24">
<TITLE>RE: [Insight-users] how to read multilayer DICOM</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Mathieu:</FONT>
</P>
<P><FONT SIZE=2>The code I use is similar to yours, and I used Dimension = 3, but</FONT>
<BR><FONT SIZE=2>it didn't work. The program cored down when I asked for the pixelValue</FONT>
<BR><FONT SIZE=2>out of the range of the first slice, for example, at pixelIndex[2] = 1, </FONT>
<BR><FONT SIZE=2>or if pixelIndex[2] = 0 but pixelIndex[0] and pixelIndex[1] are greater</FONT>
<BR><FONT SIZE=2>than the range of the first slice.</FONT>
</P>
<P><FONT SIZE=2>Weiguang</FONT>
</P>
<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Mathieu Malaterre [<A HREF="mailto:mathieu.malaterre@gmail.com">mailto:mathieu.malaterre@gmail.com</A>]</FONT>
<BR><FONT SIZE=2>Sent: Thursday, June 21, 2007 1:38 PM</FONT>
<BR><FONT SIZE=2>To: Yao, Weiguang</FONT>
<BR><FONT SIZE=2>Cc: insight-users@itk.org</FONT>
<BR><FONT SIZE=2>Subject: Re: [Insight-users] how to read multilayer DICOM</FONT>
</P>
<BR>
<P><FONT SIZE=2>Yao,</FONT>
</P>
<P><FONT SIZE=2> Could you please send us the code you used to try to read the DICOM</FONT>
<BR><FONT SIZE=2>file ? In your email you are talking about some lenght and block data,</FONT>
<BR><FONT SIZE=2>please specify section of the ITK Software Guide you are referring to,</FONT>
<BR><FONT SIZE=2>this will help us a lot.</FONT>
</P>
<P><FONT SIZE=2> All you need to do is the very usual ITK code:</FONT>
</P>
<BR>
<P><FONT SIZE=2> typedef signed short PixelType;</FONT>
<BR><FONT SIZE=2> const unsigned int Dimension = 3;</FONT>
</P>
<P><FONT SIZE=2> typedef itk::Image< PixelType, Dimension > ImageType;</FONT>
<BR><FONT SIZE=2> typedef itk::ImageFileReader< ImageType > ReaderType;</FONT>
</P>
<P><FONT SIZE=2> ReaderType::Pointer reader = ReaderType::New();</FONT>
</P>
<P><FONT SIZE=2> reader->SetFileName( argv[1] );</FONT>
</P>
<P><FONT SIZE=2> try</FONT>
<BR><FONT SIZE=2> {</FONT>
<BR><FONT SIZE=2> reader->Update();</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> catch (itk::ExceptionObject &excp)</FONT>
<BR><FONT SIZE=2> {</FONT>
<BR><FONT SIZE=2> std::cerr << "Exception thrown while writing the image" << std::endl;</FONT>
<BR><FONT SIZE=2> std::cerr << excp << std::endl;</FONT>
<BR><FONT SIZE=2> return EXIT_FAILURE;</FONT>
<BR><FONT SIZE=2> }</FONT>
</P>
<P><FONT SIZE=2>HTH</FONT>
<BR><FONT SIZE=2>-Mathieu</FONT>
</P>
<P><FONT SIZE=2>On 6/21/07, Yao, Weiguang <wyao@hrsrh.on.ca> wrote:</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>> Steve and all:</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>> Do you have any idea to read a multi-frame DICOM file?</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>> I guess that for a single 2D DICOM image reader, the length of</FONT>
<BR><FONT SIZE=2>> the block data which will be read in is determined by the</FONT>
<BR><FONT SIZE=2>> dimensions of the image. If I can find the place to modify</FONT>
<BR><FONT SIZE=2>> the length, maybe I could use the 2D image reader to read</FONT>
<BR><FONT SIZE=2>> a multi-frame file. Do you know which file and where I can</FONT>
<BR><FONT SIZE=2>> find the assignation of the length? Thanks.</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>> Weiguang</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>> -----Original Message-----</FONT>
<BR><FONT SIZE=2>> From: Steve M. Robbins [<A HREF="mailto:steve@sumost.ca">mailto:steve@sumost.ca</A>]</FONT>
<BR><FONT SIZE=2>> Sent: Thursday, June 21, 2007 11:11 AM</FONT>
<BR><FONT SIZE=2>> To: Yao, Weiguang</FONT>
<BR><FONT SIZE=2>> Subject: Re: [Insight-users] how to read multilayer DICOM</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>> Hi,</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>> I'm pretty sure you mean multi-frame. I just looked through the</FONT>
<BR><FONT SIZE=2>> DICOM standard part 3</FONT>
<BR><FONT SIZE=2>> (<A HREF="http://medical.nema.org/dicom/2007/07_03pu.pdf" TARGET="_blank">http://medical.nema.org/dicom/2007/07_03pu.pdf</A>)</FONT>
<BR><FONT SIZE=2>> and there is no mention of multi-layer.</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>> Regards,</FONT>
<BR><FONT SIZE=2>> -Steve</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>> On Thu, Jun 21, 2007 at 08:32:37AM -0400, Yao, Weiguang wrote:</FONT>
<BR><FONT SIZE=2>> > Hi Steve:</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > For a normal 2D image file in DICOM format, it consists of the header and</FONT>
<BR><FONT SIZE=2>> > the body in which there is the 2D data for one slice. My file consists of</FONT>
<BR><FONT SIZE=2>> > one header but many slices of 2D data in the body. Maybe it should be</FONT>
<BR><FONT SIZE=2>> > called multiframe.</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > Thanks.</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > Weiguang</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > -----Original Message-----</FONT>
<BR><FONT SIZE=2>> > From: Steve M. Robbins [<A HREF="mailto:steve@sumost.ca">mailto:steve@sumost.ca</A>]</FONT>
<BR><FONT SIZE=2>> > Sent: Wednesday, June 20, 2007 6:02 PM</FONT>
<BR><FONT SIZE=2>> > To: Yao, Weiguang</FONT>
<BR><FONT SIZE=2>> > Subject: Re: [Insight-users] how to read multilayer DICOM</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > On Wed, Jun 20, 2007 at 05:58:12PM -0400, Yao, Weiguang wrote:</FONT>
<BR><FONT SIZE=2>> > > Hi,</FONT>
<BR><FONT SIZE=2>> > ></FONT>
<BR><FONT SIZE=2>> > > Can anyone tell me how to read a multilayer DICOM file? The file</FONT>
<BR><FONT SIZE=2>> consists</FONT>
<BR><FONT SIZE=2>> > of</FONT>
<BR><FONT SIZE=2>> > > one header and many slices data.</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > I don't know what a multilayer file is; did you mean "multiframe"?</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > I don't know the answer, in any case, but you might want to clarify</FONT>
<BR><FONT SIZE=2>> > your question on the list.</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > -Steve</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> **********************************************************************</FONT>
<BR><FONT SIZE=2>> > The information contained in this email and document(s)attached are for</FONT>
<BR><FONT SIZE=2>> the</FONT>
<BR><FONT SIZE=2>> > exclusive use of the addressee and may contain confidential, privileged</FONT>
<BR><FONT SIZE=2>> and</FONT>
<BR><FONT SIZE=2>> > non-disclosable information. If the recipient of this e-mail is not the</FONT>
<BR><FONT SIZE=2>> > addressee, such recipient is strictly prohibited from reading,</FONT>
<BR><FONT SIZE=2>> photocopying,</FONT>
<BR><FONT SIZE=2>> > distributing or otherwise using this e-mail or its content in any way.</FONT>
<BR><FONT SIZE=2>> **********************************************************************</FONT>
<BR><FONT SIZE=2>> The information contained in this email and document(s)attached are for the</FONT>
<BR><FONT SIZE=2>> exclusive use of the addressee and may contain confidential, privileged and</FONT>
<BR><FONT SIZE=2>> non-disclosable information. If the recipient of this e-mail is not the</FONT>
<BR><FONT SIZE=2>> addressee, such recipient is strictly prohibited from reading, photocopying,</FONT>
<BR><FONT SIZE=2>> distributing or otherwise using this e-mail or its content in any way.</FONT>
<BR><FONT SIZE=2>> _______________________________________________</FONT>
<BR><FONT SIZE=2>> Insight-users mailing list</FONT>
<BR><FONT SIZE=2>> Insight-users@itk.org</FONT>
<BR><FONT SIZE=2>> <A HREF="http://www.itk.org/mailman/listinfo/insight-users" TARGET="_blank">http://www.itk.org/mailman/listinfo/insight-users</A></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
</P>
<BR>
<P><FONT SIZE=2>-- </FONT>
<BR><FONT SIZE=2>Mathieu</FONT>
<BR><FONT SIZE=2>**********************************************************************</FONT>
<BR><FONT SIZE=2>The information contained in this email and document(s)attached are for the exclusive use of the addressee and may contain confidential, privileged and non-disclosable information. If the recipient of this e-mail is not the addressee, such recipient is strictly prohibited from reading, photocopying, distributing or otherwise using this e-mail or its content in any way.</FONT></P>
</BODY>
</HTML>