Do you have a question?

First Name:
Surname:
Email:
Phone:
Message:
Get Audio Code

Changing DicomAttribute's VR
Last Post 21 Jan 2012 06:46 PM by Mladen L. 2 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Mladen LUser is Offline
New Member
New Member
Posts:8

--
19 Jan 2012 09:59 AM  

 Hi all,

I am working on a plugin which convers various formats to DICOM and I am having trouble setting Pixel Padding Value attribute. It is defined as US or SS, but how can I choose between these two. I need to store signed short value in it since Pixel Data is signed short. I tried something like this:

dataSet[DicomTags.PixelRepresentation].SetInt32(0, 1);
dataSet[DicomTags.PixelPaddingValue] = new DicomAttributeSS(DicomTags.PixelPaddingValue);
dataSet[DicomTags.PixelPaddingValue].SetInt16(0, -32768);

With this I manage to put "-32768" in Pixel Padding Value attribute but when I save this dataSet to DICOM file it changes it back to unsigned string and instead "-32768" it saves "32768". So I was wondering if there is a way to tell CC that VR of PixelPaddingValue supposed to be SS and not US.

Thank you in advance.

Best regards,
Mladen

Tags: Pixel Padding Value, VR
JasperUser is Offline
Advanced Member
Advanced Member
Posts:525

--
19 Jan 2012 12:34 PM  
Hi Mladen,

The DicomTags.ABC members are just tag value constants - when you use them to access a dataset (either to read or write attributes), they will use the VR of the attribute if it already exists (and is known, e.g. explicit VR transfer syntax), defaulting to the first VR as defined in the DICOM data dictionary.

In the case where that VR is not the correct one, you can construct your own DicomTag instance and explicitly specify the VR (the constructor takes a number of arguments, including tag value, VR, name, VM, ...) then use the resulting tag object the same way as you used the tag value constant. Most of our API where a tag value is expected will also accept a DicomTag object.

Hope this helps,
Mladen LUser is Offline
New Member
New Member
Posts:8

--
21 Jan 2012 06:46 PM  
Hi Jasper,

Thank you for you response. That is exactly what I needed. It worked like a charm.

Thanks.

Regards,
Mladen
You are not authorized to post a reply.

Active Forums 4.1