comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » IDLffDicom and multiple items
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
IDLffDicom and multiple items [message #39717] Thu, 10 June 2004 05:45 Go to next message
justspam03 is currently offline  justspam03
Messages: 36
Registered: October 2003
Member
Hi all,

I have a problem with Dicom files containing more
than one 'item'. In my special case, the dicom file
contains 3 items, all of which contain an instance
number (tag 0020x,0013x which is of multiplicity 1),
but only the second item contains all the patient,
examination and image data I'm interested in.

When accessing this tag via IDLffDicom's getvalue
method, IDL returns a 3-element array - one element
for each 'item', but only the second element
contains a meaningful instance number.

Unluckily, I cannot rely on the fact, that it will
always be the second.

Now for my question:
Is there any way in IDL to find out about the
'item' hierarchy which allows me to link, say, the
image data to a certain item and thus derive the
index to use for the instance tag?

Thanks
Oliver
Re: IDLffDicom and multiple items [message #39762 is a reply to message #39717] Mon, 14 June 2004 13:50 Go to previous messageGo to next message
muswick is currently offline  muswick
Messages: 10
Registered: April 1998
Junior Member
Dear Oliver,

What you are observing is a situation where the same tag exists
multiple times within one DICOM file. According to the DICOM
standard, tags may appear only once, and in ascending order, except
when sequences are present (VR type SQ). Sequences are allowed to
reuse the tags but with the same restrictions (only once and in
ascending order). For example, when a thumbnail or icon image is
stored in a dicom file, you will have two sets of "rows", "columns",
"pixel data" etc.

The tag (0020,0013) used to be called "image number" in older
revisions. It is somewhat a meaningless number. Each manufacturer
can decide on how to use this number. It is just a number that
identifies the image in relation to other images in series or
acquisition. It can be in numerical order starting at one for each
series or it can continue counting up for every image of the patient.

However, back to the problem at hand, what to do when you have
indentical tags in the same dicom file. Keep in mind that each
additional tag that has the same group/element numbers, and will be
within a new sequence. IDLffDICOM provides a method for tracking the
hirearchy of sequences (yes, sequences can contain sequences.) The
GetChildren and GetParent methods are used to identify which sequence
hirearchy the tag belongs to.

Thus, in the case of an icon image that is imbedded in a dicom file,
the GetReference method for (0028,0010) "rows" will return an array of
two reference numbers, one for the primary image and the other for the
icon image. Using the GetParent method for each of these reference
numbers, it will return either -1 (no parent sequence) or a reference
number of the "icon image" sequence (0088,0200). In the case the icon
sequence, the "row", "column", and "pixel data" references will all
have the same parent.

I bring up the point of the icon image sequence because they are used
frequently with CT and CR images. When you encounter a dicom file
with an icon image embedded, IDL will return value arrays for "rows",
"columns" and "pixel data" as follows:

rows = dicomobj->GetValue('0028'x,'0010'x,/NO_COPY)
HELP,rows
ROWS INT = Array[2]
PRINT,rows
512, 64
columns = dicomobj->GetValue('0028'x,'0011'x,/NO_COPY)
HELP,columns
COLUMNS INT = Array[2]
PRINT,columns
512, 64
image = dicomobj->GetValue('7fe0'x,'0010'x,/NO_COPY)
HELP, image
IMAGE POINTER = Array[2]
HELP,*image[0]
<PtrHeapVar116> INT = Array[64, 64]
HELP,*image[1]
<PtrHeapVar143> INT = Array[512, 512]

The problem is that the first elements of the "row" and "column"
arrays represent the size of the primary image, ie 512xs512, which is
the second image array pointer. The second elements of "row" and
"column" arrays are those of the icon image, ie 64x64 which is the
first pixel array encountered.

The reason this happens goes back to the primary rule of ascending
order of all tags. The tag (0088,0200) "icon image" comes after "row"
(0028,0010) and "column" (0028,0011) tags. The tags that follow after
(0088,0200) will be "row" (0028,0010), "column" (0028,0011) and
"pixel data" (7fe0,0010) of the icon image. After the end of the
"icon image" sequence, another "pixel data" (7fe0,0010) will indicate
the primary image data.

In your case, you might have two sequences that have "instance number"
contained in them. Knowing the definition of the parent tag, ie
sequence, with tell you which one you are dealing with. In your case,
I will bet that the one you want, will always have a GetParent value
of -1.

I hope this helps.

Gary Muswick


justspam03@yahoo.de (Oliver Thilmann) wrote in message news:<c992bd37.0406100445.739f082a@posting.google.com>...
> Hi all,
>
> I have a problem with Dicom files containing more
> than one 'item'. In my special case, the dicom file
> contains 3 items, all of which contain an instance
> number (tag 0020x,0013x which is of multiplicity 1),
> but only the second item contains all the patient,
> examination and image data I'm interested in.
>
> When accessing this tag via IDLffDicom's getvalue
> method, IDL returns a 3-element array - one element
> for each 'item', but only the second element
> contains a meaningful instance number.
>
> Unluckily, I cannot rely on the fact, that it will
> always be the second.
>
> Now for my question:
> Is there any way in IDL to find out about the
> 'item' hierarchy which allows me to link, say, the
> image data to a certain item and thus derive the
> index to use for the instance tag?
>
> Thanks
> Oliver
Re: IDLffDicom and multiple items [message #39875 is a reply to message #39762] Wed, 16 June 2004 02:36 Go to previous message
justspam03 is currently offline  justspam03
Messages: 36
Registered: October 2003
Member
Hello Gary,

thank you so much for your extensive answer!

> I hope this helps.

It sure does.

Best regards
Oliver
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: bug in polyfiilv
Next Topic: creation of rectangle dataset

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 14:00:44 PDT 2025

Total time taken to generate the page: 0.00479 seconds