dcm2xml and xml2dcm

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
retsil
Posts: 6
Joined: Wed, 2005-01-19, 00:48
Location: Australia
Contact:

dcm2xml and xml2dcm

#1 Post by retsil »

I've been using xml2dcm and dcm2xml to prototype a simple DICOM reader/writer/editor.

Most of my work invloves using an existing DICOM file as a template. Thus, I've reasoned that I can probably make of the modifications I would ever need to using XPaths.

I was interested if there is a convention for defining an XPath such that it always refers to a unique element.

I've considered that the 2-byte tag is unique and can only be repeated in different groups or sequences


Excerpt from dcm2xml.dtd

Code: Select all

<!ATTLIST element tag CDATA #REQUIRED > # This is a unique key

<!ATTLIST sequence tag CDATA #REQUIRED > # This is a unique key

An example XPath might be

Code: Select all

/child::file-format/child::data-set/child::sequence[attribute::tag="0054,0410"]/child::item[position()=1]/child::sequence[attribute::tag="0054,0412"]/child::item[position()=1]/child::element[attribute::tag="0008,0100"]
Would anyone be able to enlighten me that I am (reasonably) correct in these assumptions?
--

nrb@ Robbie Barnett
imag Research Assistant
wsahs Nuclear Medicine & Ultrasound
nsw Westmead Hospital
gov Sydney Australia
au +61 2 9845 7223

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#2 Post by Jörg Riesmeier »

I've considered that the 2-byte tag is unique and can only be repeated in different groups or sequences
The tag (group and element number) is unique within an item/dataset. This is at least true for valid DICOM objects.

retsil
Posts: 6
Joined: Wed, 2005-01-19, 00:48
Location: Australia
Contact:

base64 encoding

#3 Post by retsil »

Just a further question Jörg,

Is base64 encoding/decoding supported for all transfer syntaxes or does it just work for some?
I can't get dcm2xml to generate base64 encoded tags (where VR is OW or OB) when using the +Eb (aka --encode-base64) on SunOS

Cheers,

Robbie
--

nrb@ Robbie Barnett
imag Research Assistant
wsahs Nuclear Medicine & Ultrasound
nsw Westmead Hospital
gov Sydney Australia
au +61 2 9845 7223

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#4 Post by Jörg Riesmeier »

You also need to specify +Wb (--write-binary-data). In case you want to encode all binary data (even the pixel data) use +M (--load-all) in addition -- but be careful with large images!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest