[Insight-users] DICOM RT Images

Hoole, Andrew andrew.hoole at addenbrookes.nhs.uk
Fri Jun 2 07:29:05 EDT 2006


Hi All 

 

I am having a bit of difficulty displaying an image from a DICOM RT Image
file. I can probably work around it but I'm not sure if I should have too. 

 

My issue is as follows:

 

DICOM RT Image pixel data is stored starting at the top left hand corner of
the image then rastered right and down with the last pixel in the sequence
being the bottom right hand pixel. The origin of the image is the top left
corner of the image. So far this is pretty much the same as axial DICOM CT
images. For DICOM RT Images however the co-ordinate system: Positive X left
to right, positive Y bottom to top - i.e. the image data is sent with
decreasing Y values. So if I use the ITK stuff and set the origin of the
image according to the origin which is specified in the original file then
the image comes out mirrored vertically about the horizontal line through
the specified origin. 

 

Does all that make any sense. For example an image of width, height of
512,512 and origin -256,256 and pixel size 1mm is actually centred on the
origin. 

 

Any ideas how I can easily handle this mirroring.

 

thanks

 

Andrew Hoole 

-------------------------------------------------------------------------

Medical Physics, Box 152 

Cambridge University Hospitals NHS Trust
Addenbrooke's Hospital

Hills Rd

Cambridge         Tel: (+44) (0)1223-216544

CB2 2QQ           Fax: (+44) (0)1223-257137

UK                    Email: andrew.hoole at addenbrookes.nhs.uk

--------------------------------------------------------------------------

The information contained in this EMAIL and any attachments is confidential
and intended solely for the attention and use of the intended recipient. If
you are not the intended recipient and have received this email in error you
may not disclose, copy, distribute or retain this message or any part of it.
See Email disclaimer <http://www.addenbrookes.org.uk/email_disclaimer.html
<http://www.addenbrookes.org.uk/email_disclaimer.html> >

-----Original Message-----
From: Bill Lorensen [mailto:bill.lorensen at gmail.com] 
Sent: 01 June 2006 18:03
To: Hoole, Andrew
Cc: insight insight
Subject: Re: [Insight-users] Reading Dicom files

 

Andrew,

You can still get at this information. We store all dicom tags in the meta
data dictionary for the image. Look at the dicom processing examples in
Examples/IO to see how to get the meta data dictionary. Once you have it,
you can use the ExposeMetaData method to get the values for a given tag. 

 

Bill

 

On 6/1/06, Hoole, Andrew <andrew.hoole at addenbrookes.nhs.uk
<mailto:andrew.hoole at addenbrookes.nhs.uk> > wrote: 

Hi Bill 

 

The image which I have been using is a DRR from our planning system -
RTImage modality. I have looked in the DICOM and the spacing is in
(0x3002,0x0011) and the position is in  (0x3002,0x0012). This is probably
the issue - it handles normal images not DICOM RT images. 

 

Andrew Hoole 

------------------------------------------------------------------------- 

Medical Physics, Box 152 

Cambridge University Hospitals NHS Trust
Addenbrooke's Hospital

Hills Rd

Cambridge         Tel: (+44) (0)1223-216544

CB2 2QQ           Fax: (+44) (0)1223-257137

UK                    Email: andrew.hoole at addenbrookes.nhs.uk
<mailto:andrew.hoole at addenbrookes.nhs.uk> 

-------------------------------------------------------------------------- 

The information contained in this EMAIL and any attachments is confidential
and intended solely for the attention and use of the intended recipient. If
you are not the intended recipient and have received this email in error you
may not disclose, copy, distribute or retain this message or any part of it.

See Email disclaimer < http://www.addenbrookes.org.uk/email_disclaimer.html
<http://www.addenbrookes.org.uk/email_disclaimer.html>  >

-----Original Message-----
From: Bill Lorensen [mailto: bill.lorensen at gmail.com
<mailto:bill.lorensen at gmail.com> ] 
Sent: 01 June 2006 17:35
To: Hoole, Andrew 
Cc: insight-users at itk.org <mailto:insight-users at itk.org> 
Subject: Re: [Insight-users] Reading Dicom files

 

Andrew,

 

The reader does read the pixel spacing and origin. What is the source of
your dicom images?

 

Bill

 

On 6/1/06, Hoole, Andrew < <mailto:andrew.hoole at addenbrookes.nhs.uk>
andrew.hoole at addenbrookes.nhs.uk> wrote: 

Hi All

 

I'm new to the ITK stuff and having been working through the User guide. I
have used the code in the guide to read a DICOM file and display it in a
window. When I read the file it doesn't appear to read the information
related to the pixel size or the origin of the image. This information is
embedded in the DICOM is there a way to make the reader get this data or is
the problem with the image which I hook onto the output of the reader. The
code I am using is as follows: 

 

            typedef signed short InputPixelType;

            const unsigned int   InputDimension = 2;

 

            typedef itk::Image< InputPixelType, InputDimension >
InputImageType; 

            typedef itk::ImageFileReader< InputImageType > ReaderType;

 

            ReaderType::Pointer reader = ReaderType::New();

            reader->SetFileName("c:\\temp\\test.dcm");

            typedef itk::GDCMImageIO           ImageIOType;

 

            ImageIOType::Pointer gdcmImageIO = ImageIOType::New();

  

            reader->SetImageIO( gdcmImageIO );

            try {

                        reader->Update();

            } 

            catch (itk::ExceptionObject & e){

                        AfxMessageBox("Exception in file reader
",MB_OK,NULL); 

                        return;

            }

 

            typedef itk::Point< double, InputImageType::ImageDimension >
PointType; 

            PointType point;

            InputImageType::IndexType pixelIndex;

            InputImageType::PixelType pixelValue;

            InputImageType::Pointer image = reader->GetOutput();

 

            InputImageType::SpacingType spacing;

            spacing[0] = 0.5; // spacing along X

            spacing[1] = 0.5; // spacing along Y

            image->SetSpacing( spacing );

            

            InputImageType::PointType origin;

            origin[0] = -128.0; // coordinates of the

            origin[1] = -128.0; // first pixel in N-D

            image->SetOrigin( origin );          

            

As you can see I am manually setting the pixel size and origin which is not
ideal. 

 

Regards

 

Andrew Hoole 

------------------------------------------------------------------------- 

Medical Physics, Box 152 

Cambridge University Hospitals NHS Trust
Addenbrooke's Hospital 

Hills Rd

Cambridge         Tel: (+44) (0)1223-216544 

CB2 2QQ           Fax: (+44) (0)1223-257137

UK                    Email: andrew.hoole at addenbrookes.nhs.uk
<mailto:andrew.hoole at addenbrookes.nhs.uk> 

-------------------------------------------------------------------------- 

The information contained in this EMAIL and any attachments is confidential
and intended solely for the attention and use of the intended recipient. If
you are not the intended recipient and have received this email in error you
may not disclose, copy, distribute or retain this message or any part of it.

See Email disclaimer <
<http://www.addenbrookes.org.uk/email_disclaimer.html>
http://www.addenbrookes.org.uk/email_disclaimer.html>

 


_______________________________________________
Insight-users mailing list
Insight-users at itk.org <mailto:Insight-users at itk.org> 
http://www.itk.org/mailman/listinfo/insight-users
<http://www.itk.org/mailman/listinfo/insight-users> 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20060602/084b123b/attachment.htm


More information about the Insight-users mailing list