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.
DCM_PixelSpacing
Moderator: Moderator Team
-
- DCMTK Developer
- Posts: 2054
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
Re: DCM_PixelSpacing
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.
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.
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.
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.
-
- DCMTK Developer
- Posts: 2054
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest