Help with inserting multiple float values on a single tag

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
newbie43
Posts: 2
Joined: Mon, 2012-05-14, 19:36

Help with inserting multiple float values on a single tag

#1 Post by newbie43 »

Hello
Has anyone here ever set multiple float values on an attribute that has a VM of 6-n and a VR of FL. Ive tried calling it like this

float SomeFloatOne = 1.0;
float SomeFloatTwo = 2.0;

// to insert the first float
my_seq->putAndInsertFloat32(DCM_MyTag, SomeFloatOne, 0, OFTTrue);
my_seq->putAndInsertFloat32(DCM_MyTag, SomeFloatTwo, 1, OFTTrue);

or am i suppose to put all the floats in the call seperated by a comma? like so putAndInsertFloat32(DCM_MyTag, 1.0,20,3.0, 0, OFTTrue);
that didnt work either. Status coming back when set is EVR 7
Ive also tried swapping the OFFalse and it still just keeps setting a single float value in the output file. The value is the last float.
I need it to look like this (1.0,2.0) any little example code or help would be appreciated
thanks

Xiao
Posts: 36
Joined: Wed, 2011-05-25, 07:53

Re: Help with inserting multiple float values on a single ta

#2 Post by Xiao »

Did you try below functions?

OFCondition putFloat32 (const Float32 floatVal, const unsigned long pos=0)
set particular element value to given float

OFCondition putFloat32Array (const Float32 *floatVals, const unsigned long numFloats)
set element value to given float array data

J. Riesmeier
DCMTK Developer
Posts: 2506
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Help with inserting multiple float values on a single ta

#3 Post by J. Riesmeier »

Three questions to the original poster:

1. Which version of the DCMTK are you using?
2. What is the type of "my_seq"?
3. What is the value of "DCM_MyTag"?

Post Reply

Who is online

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