[Insight-users] Dicom slice position
Mathieu Malaterre
Mathieu . Malaterre at creatis . insa-lyon . fr
Fri, 04 Jul 2003 09:53:41 +0200
George,
I am using gdcm to read my dicom images:
http://www . creatis . insa-lyon . fr/Public/Gdcm/
The cvs version also provide a vtkGdcmReader which should be easy to
pipeline in ITK.
Furthermore you can access all the fields you like through a gdcmHeader.
For example
gdcmHeader GdcmHeader( "filename.dcm" );
GdcmHeader.GetPubElValByNumber(0x0010,0x0010);
will return a std::string giving you the patient name.
In the source tree you'll find:
gdcm/Dict/dicomV3.dic
where you can find the equivalence between patient name (or whatever)
For instance:
0010 0010 PN PAT Patient Name
^^^^ ^^^^
HTH
mathieu
Ps: if you prefer you can use: GdcmHeader.GetPubElValRepByName
Iordanescu, Gheorghe (NIH/CC/DRD) wrote:
> Jolinda,
>
> Thank you very much for your reply. The information you gave me is very
> useful but I still need some help. I already have a code that reads Dicom
> images and finally gives me an ITK image. I was interested though in using
> ITK classes to do this. All the code is there - I only need some guidance on
> how to extract the necessary fields. Instead of writing the info from the
> dicom header in a txt file on the disk, I would like to use it and build the
> 3d ITK image. I think this would be a big improvement for our code...
>
> George
>
>
>
> -----Original Message-----
> From: Jolinda Smith [mailto:jolinda at darkwing . uoregon . edu]
> Sent: Thursday, July 03, 2003 6:36 PM
> To: insight-users at itk . org
> Subject: Re: [Insight-users] Dicom slice position
>
> Hi George,
>
> Just a quick note -- be very careful of the "slice thickness" and "slice
> spacing" fields. Slice spacing is supposed to be the center-to-center
> distance between slices, but in reality it's meaning is scanner-dependent.
> "Image number" will not necessarily help either. What you can trust are the
> "Image Orientation Patient" and "Image Position Patient" fields. You can use
> the first to calculate the slice normal, and the second to calculate the
> position of the slice along the slice normal (as well as the distance
> between adjacent slices).
>
> Or, you could use my program MRIConvert, which does all that for you.
>
> Jolinda Smith
> Lewis Center for NeuroImaging
> University of Oregon
> jolinda at uoregon . edu
> http://lcni . uoregon . edu/~jolinda/MRIConvert
> ----- Original Message -----
> From: Iordanescu, Gheorghe (NIH/CC/DRD)
> To: 'insight-users at itk . org'
> Sent: Wednesday, July 02, 2003 10:22 AM
> Subject: [Insight-users] Dicom slice position
>
> Hi everybody,
>
> I would like to read a sequence of Dicom images in a volume. Unfortunately
> the images' names do not correspond to their order in space. For this I
> would like to read from each image header the "Image number", "Patient
> position", "slice thickness".and "pixel spacing". Does anybody have an
> example of how to read these fields from a dicom header? Thank you very
> much.
>
> George
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk . org
> http://www . itk . org/mailman/listinfo/insight-users
>
--
Mathieu Malaterre
CREATIS
28 Avenue du Doyen LEPINE
B.P. Lyon-Montchat
69394 Lyon Cedex 03
http://www . creatis . insa-lyon . fr/~malaterre/