Having trouble getting date and time to get written to .dcm

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
johnmann56
Posts: 7
Joined: Fri, 2006-01-27, 06:53

Having trouble getting date and time to get written to .dcm

#1 Post by johnmann56 »

Hello. I would like to know what tags or other factors are necessary for the date, time, patient name, and patient ID to be written to a .dcm file using DCMTK. I have written my own little program using DCMTK to write a DICOM file, which includes statements like

Code: Select all

status = dataset->putAndInsertUint32(DCM_StudyDate,19941016); 
and similar. The .dcm file gets written, and the image is there, but the image info, as viewed in EZDICOM and a couple other vieweres, doesn't have the date, time, etc. I've done a lot of googling looking for a table or other "simple" document which tells what's needed to get these variables to show up in the info, but no luck. Thanks.
John

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 »

As you can read in the documentation you have to use putAndInsertString() for the value representation DA (Date):

Code: Select all

status = dataset->putAndInsertString(DCM_StudyDate,"19941016");

johnmann56
Posts: 7
Joined: Fri, 2006-01-27, 06:53

#3 Post by johnmann56 »

:o :arrow: :D
Thank you Jörg, that did the trick. I also had to fix a dumb error in my program which was the REAL problem (emoticon:sheepish).
John

Post Reply

Who is online

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