Skip to content

Commit 7dd530f

Browse files
committed
Added putAndInsertXXX() methods for 64-bit VRs.
Added helper methods putAndInsertUint64(), putAndInsertUint64Array(), putAndInsertSint64() and putAndInsertSint64Array() for the still rather new 64-bit VRs "SV", "UV" and "OV".
1 parent 0905e66 commit 7dd530f

File tree

2 files changed

+258
-50
lines changed

2 files changed

+258
-50
lines changed

dcmdata/include/dcmtk/dcmdata/dcitem.h

+55-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* Copyright (C) 1994-2024, OFFIS e.V.
3+
* Copyright (C) 1994-2025, OFFIS e.V.
44
* All rights reserved. See COPYRIGHT file for details.
55
*
66
* This software and supporting documentation were developed by
@@ -1219,6 +1219,60 @@ class DCMTK_DCMDATA_EXPORT DcmItem
12191219
const unsigned long count,
12201220
const OFBool replaceOld = OFTrue);
12211221

1222+
/** create a new element, put specified value to it and insert the element into the dataset/item.
1223+
* Applicable to the following VRs: OV, UV.
1224+
* @param tag DICOM tag specifying the attribute to be created
1225+
* @param value value to be set for the new element
1226+
* @param pos index of the value to be set (0..vm). A value can be appended to
1227+
* the end of or inserted within the existing value field.
1228+
* @param replaceOld flag indicating whether to replace an existing element or not
1229+
* @return EC_Normal upon success, an error code otherwise.
1230+
*/
1231+
OFCondition putAndInsertUint64(const DcmTag &tag,
1232+
const Uint64 value,
1233+
const unsigned long pos = 0,
1234+
const OFBool replaceOld = OFTrue);
1235+
1236+
/** create a new element, put specified value to it and insert the element into the dataset/item.
1237+
* Applicable to the following VRs: OV, UV.
1238+
* @param tag DICOM tag specifying the attribute to be created
1239+
* @param value value to be set for the new element
1240+
* @param count number of values (not bytes!) to be copied from 'value'
1241+
* @param replaceOld flag indicating whether to replace an existing element or not
1242+
* @return EC_Normal upon success, an error code otherwise.
1243+
*/
1244+
OFCondition putAndInsertUint64Array(const DcmTag &tag,
1245+
const Uint64 *value,
1246+
const unsigned long count,
1247+
const OFBool replaceOld = OFTrue);
1248+
1249+
/** create a new element, put specified value to it and insert the element into the dataset/item.
1250+
* Applicable to the following VRs: SV.
1251+
* @param tag DICOM tag specifying the attribute to be created
1252+
* @param value value to be set for the new element
1253+
* @param pos index of the value to be set (0..vm). A value can be appended to
1254+
* the end of or inserted within the existing value field.
1255+
* @param replaceOld flag indicating whether to replace an existing element or not
1256+
* @return EC_Normal upon success, an error code otherwise.
1257+
*/
1258+
OFCondition putAndInsertSint64(const DcmTag &tag,
1259+
const Sint64 value,
1260+
const unsigned long pos = 0,
1261+
const OFBool replaceOld = OFTrue);
1262+
1263+
/** create a new element, put specified value to it and insert the element into the dataset/item.
1264+
* Applicable to the following VRs: SV.
1265+
* @param tag DICOM tag specifying the attribute to be created
1266+
* @param value value to be set for the new element
1267+
* @param count number of values (not bytes!) to be copied from 'value'
1268+
* @param replaceOld flag indicating whether to replace an existing element or not
1269+
* @return EC_Normal upon success, an error code otherwise.
1270+
*/
1271+
OFCondition putAndInsertSint64Array(const DcmTag &tag,
1272+
const Sint64 *value,
1273+
const unsigned long count,
1274+
const OFBool replaceOld = OFTrue);
1275+
12221276
/** create a new element, put specified value to it and insert the element into the dataset/item.
12231277
* Applicable to the following VRs: FL, OF.
12241278
* @param tag DICOM tag specifying the attribute to be created

0 commit comments

Comments
 (0)