Signed Waveform

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
nmoraes
Posts: 7
Joined: Wed, 2012-08-08, 17:58

Signed Waveform

#1 Post by nmoraes »

Hi,

I'm developing a dicom file creator putting our ecg database data.
I have problems with WaveformData tag, I have a Sint16 array but I have seen that only putAndInsertUint16Array or putAndInsertUint8Array methods are available for this tag.
Converting Sint16 array to Uint16 I can create a Dicom Waveform File, and open it in a dicom viewer but I can't get the expected values.
I can't use putAndInsertUint16Array because is only applicable to the VRs: SS, xs (US or SS) and WaveformData is OB or OW.

I need to send a signed signal and I don't know what I'm doing wrong, how can I handle this?


Thanks in advance :)


Natalie

nmoraes
Posts: 7
Joined: Wed, 2012-08-08, 17:58

Re: Signed Waveform

#2 Post by nmoraes »

Hello again,

I think I have solved it working with Uint8 arrays and putAndInsertUint8Array. Sorry if it seemed a stupid question.


Regards

Mark Wang
Posts: 8
Joined: Wed, 2013-06-05, 11:38

Re: Signed Waveform

#3 Post by Mark Wang »

nmoraes wrote:Hello again,

I think I have solved it working with Uint8 arrays and putAndInsertUint8Array. Sorry if it seemed a stupid question.


Regards
hi, seems i am a stupider one. I have the same question and i am not familiar with C++. I can not uderstand why Uint8 arrays could solve the problem.
since the tag WaveformBitsAllocated(5400,1004) in my program is set to be 16. i use putAndIsertUnit16Array, but the result seems wrong.
Could anyone tell me how to solve it?(in details will be better :D ) .
Thanks in advance.

Chung-Yueh Lien
Posts: 61
Joined: Wed, 2010-05-19, 09:27
Location: Taipei, Taiwan

Re: Signed Waveform

#4 Post by Chung-Yueh Lien »

Mark Wang wrote:
nmoraes wrote: since the tag WaveformBitsAllocated(5400,1004) in my program is set to be 16. i use putAndIsertUnit16Array, but the result seems wrong.
Could anyone tell me how to solve it?(in details will be better :D ) .
Thanks in advance.
Hi, when you use Uint8 arrays then the default VR of WaveformData is OB. That is why using Uint8 will work. If the value of WaveformBitsAllocated(5400,1004) is 16, then the VR of WaveformData shall be set as OW. Then you can use putAndIsertUnit16Array that the result would be correct.

Mark Wang
Posts: 8
Joined: Wed, 2013-06-05, 11:38

Re: Signed Waveform

#5 Post by Mark Wang »

Chung-Yueh Lien wrote:
Mark Wang wrote:
nmoraes wrote: since the tag WaveformBitsAllocated(5400,1004) in my program is set to be 16. i use putAndIsertUnit16Array, but the result seems wrong.
Could anyone tell me how to solve it?(in details will be better :D ) .
Thanks in advance.
Hi, when you use Uint8 arrays then the default VR of WaveformData is OB. That is why using Uint8 will work. If the value of WaveformBitsAllocated(5400,1004) is 16, then the VR of WaveformData shall be set as OW. Then you can use putAndIsertUnit16Array that the result would be correct.
I have another question. when i use putAndInsertUint8Array (Item_1->putAndInsertUint8Array(DCM_WaveformData,(Uint8 *)databyte, NUMBER_OF_SAMPLES_DUOBLE)), and the WaveformBitsAllocated(5400,1004) is set to be 8. But it does not work as i wish, the VR of WaveformData is OW, not OB.
the databyte in my program is defined here(byte *databyte = new byte[NUMBER_OF_SAMPLES_DUOBLE];).
Does there anyone know how to solve this?
Thanks in advance.

Chung-Yueh Lien
Posts: 61
Joined: Wed, 2010-05-19, 09:27
Location: Taipei, Taiwan

Re: Signed Waveform

#6 Post by Chung-Yueh Lien »

Mark Wang wrote: I have another question. when i use putAndInsertUint8Array (Item_1->putAndInsertUint8Array(DCM_WaveformData,(Uint8 *)databyte, NUMBER_OF_SAMPLES_DUOBLE)), and the WaveformBitsAllocated(5400,1004) is set to be 8. But it does not work as i wish, the VR of WaveformData is OW, not OB.
the databyte in my program is defined here(byte *databyte = new byte[NUMBER_OF_SAMPLES_DUOBLE];).
Does there anyone know how to solve this?
Thanks in advance.
The attribute WaveformData has the VR which may be OB or OW, so you have to specify which one you want to use. In case, you can create a new data element and insert it into Item_1 for verifying your codes, such as:

Code: Select all

DcmElement *newelement;
newDicomElement(newelement, DCM_WaveformData);
newelement->createUint8Array(NUMBER_OF_SAMPLES_DUOBLE, databyte);
Item_1->insert(element);
And also I suggest you to look Waveform IOD Module in Part 3. The value of attributes defined in waveform module shall be matched, like WaveformBitsStored, WaveformBitsAllocated, ect.

Post Reply

Who is online

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