Odil
A C++11 library for the DICOM standard
Toggle main menu visibility
Loading...
Searching...
No Matches
ElementAccessor.h
Go to the documentation of this file.
1
/*************************************************************************
2
* odil - Copyright (C) Universite de Strasbourg
3
* Distributed under the terms of the CeCILL-B license, as published by
4
* the CEA-CNRS-INRIA. Refer to the LICENSE file or to
5
* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
6
* for details.
7
************************************************************************/
8
9
#ifndef _dfa4858b_1c9d_4ce9_b220_a1c15d873602
10
#define _dfa4858b_1c9d_4ce9_b220_a1c15d873602
11
12
#include <functional>
13
14
#include <dcmtk/config/osconfig.h>
15
#include <dcmtk/dcmdata/dcelem.h>
16
#include <dcmtk/dcmdata/dcdatset.h>
17
18
#include "
odil/dcmtk/ElementTraits.h
"
19
#include "
odil/dcmtk/Exception.h
"
20
#include "
odil/odil.h
"
21
22
namespace
odil
23
{
24
25
namespace
dcmtk
26
{
27
29
template
<
typename
TValueType>
30
struct
ElementAccessor
31
{
33
typedef
TValueType
ValueType
;
34
36
typedef
std::function<
37
ValueType
(DcmElement
const
&,
unsigned
long
const
)>
GetterType
;
38
40
static
ODIL_API
GetterType
const
element_get
;
41
43
typedef
std::function<
44
void(DcmElement &,
ValueType
const
&,
unsigned
long
const
)>
SetterType
;
45
47
static
ODIL_API
SetterType
const
element_set
;
48
50
static
bool
has
(DcmDataset
const
& dataset, DcmTagKey
const
& tag);
51
53
static
ValueType
get
(
54
DcmDataset
const
& dataset,
55
DcmTagKey
const
tag,
unsigned
int
const
position=0);
56
58
static
void
set
(
59
DcmDataset & dataset,
60
DcmTagKey
const
tag,
ValueType
const
& value,
unsigned
int
const
position=0);
61
};
62
63
}
64
65
}
66
67
#include "odil/dcmtk/ElementAccessor.txx"
68
69
#endif
// _dfa4858b_1c9d_4ce9_b220_a1c15d873602
ElementTraits.h
Exception.h
odil::dcmtk
Definition
conversion.h:25
odil
Definition
Association.h:25
odil.h
ODIL_API
#define ODIL_API
Definition
odil.h:28
odil::dcmtk::ElementAccessor
Generic access to values in DcmElement.
Definition
ElementAccessor.h:31
odil::dcmtk::ElementAccessor::ValueType
TValueType ValueType
C++ type of the VR.
Definition
ElementAccessor.h:33
odil::dcmtk::ElementAccessor::get
static ValueType get(DcmDataset const &dataset, DcmTagKey const tag, unsigned int const position=0)
Return the value of an element in a dataset.
odil::dcmtk::ElementAccessor::GetterType
std::function< ValueType(DcmElement const &, unsigned long const)> GetterType
Getter type.
Definition
ElementAccessor.h:37
odil::dcmtk::ElementAccessor::SetterType
std::function< void(DcmElement &, ValueType const &, unsigned long const)> SetterType
Setter type.
Definition
ElementAccessor.h:44
odil::dcmtk::ElementAccessor::element_get
static GetterType const element_get
Return the value in the element.
Definition
ElementAccessor.h:40
odil::dcmtk::ElementAccessor::set
static void set(DcmDataset &dataset, DcmTagKey const tag, ValueType const &value, unsigned int const position=0)
Set the value of an element in a dataset.
odil::dcmtk::ElementAccessor::element_set
static SetterType const element_set
Set the value in the element.
Definition
ElementAccessor.h:47
odil::dcmtk::ElementAccessor::has
static bool has(DcmDataset const &dataset, DcmTagKey const &tag)
Test whether the data set contains a given tag.
src
odil
dcmtk
ElementAccessor.h
Generated by
1.17.0