DCM_PixelSpacing

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Someone
Posts: 10
Joined: Wed, 2005-09-07, 00:44

DCM_PixelSpacing

#1 Post by Someone »

I am trying to write a CTImageStorage file. I specify all the necessary tag information. When I push it to the server, the server log says " Pixel spacing - Tag parameter invalid". Even when the Pixel Spacing tag parameter is not specified (I know it is required for a CT file), I am getting the same error.

Please let me know how to specify the pixel spacing tag parameters or is it something I should do with respect to dcmtk before writing a CT dicom file.

Thanks in advance.

Michael Onken
DCMTK Developer
Posts: 2054
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: DCM_PixelSpacing

#2 Post by Michael Onken »

Hi,

perhaps you only inserted only one value into the Pixel Spacing Attribute? It has a Value Multiplicity = 2, so you have to enter a pair of values there.

In the DCMTK, attribute values with VM>1 are represented by a string with all its value parts separated by a backslash character. So the attribute Pixel Spacing might have the value "1\1". You can use the putAndInsertOFStringArray() method from the class DcmItem to insert such a value.

Someone
Posts: 10
Joined: Wed, 2005-09-07, 00:44

#3 Post by Someone »

Thank you very much for your rely. I am not sure how to associate the DcmItem with the current DcmDataset that contains the tag parameters.

I am writing the dicom file similar to the example code given in the DCMTK documentation. I use the following to specify the pixel spacing tag value,

dataset->putAndInsertString(DCM_PixelSpacing, "1.0\1.0");

and I even tried this as well,

dataset->putAndInsertFloat32(DCM_PixelSpacing, 1.0, 1.0);

Both the syntax did not give me any error messages.

But this doesn't seem to work. Is this wrong? Please let me know if there is any other alternative to write a dicom file.

Thanks.

Michael Onken
DCMTK Developer
Posts: 2054
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#4 Post by Michael Onken »

Hm, first you could use dcmdump from the DCMTK to check, whether your values are set correctly in the file. I'm not experienced with CT images, but you should check in part 3 of the standard, whether the possible values of "Pixel Spacing" are restricted for CT images.

Good luck,
Michael

Post Reply

Who is online

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