odil
VRFinder.h
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 _b7afd80f_327e_4d9a_b0fa_88c565add7b3
10 #define _b7afd80f_327e_4d9a_b0fa_88c565add7b3
11 
12 #include <functional>
13 #include <string>
14 #include <vector>
15 
16 #include "odil/DataSet.h"
17 #include "odil/Tag.h"
18 #include "odil/VR.h"
19 
20 namespace odil
21 {
22 
24 class VRFinder
25 {
26 public:
32  typedef
33  std::function<VR(Tag const &, DataSet const &, std::string const &)>
35 
37  static std::vector<Finder> const default_finders;
38 
40  std::vector<Finder> finders;
41 
43  VRFinder();
44 
51  VR operator()(
52  Tag const & tag, DataSet const & data_set,
53  std::string const & transfer_syntax) const;
54 
56  static VR public_dictionary(
57  Tag const & tag, DataSet const &, std::string const &);
58 
60  static VR group_length(
61  Tag const & tag, DataSet const &, std::string const &);
62 
64  static VR private_tag(
65  Tag const & tag, DataSet const &, std::string const &);
66 
68  static VR implicit_vr_little_endian(
69  Tag const & tag, DataSet const & data_set,
70  std::string const & transfer_syntax);
71 
72 private:
73  static std::vector<Finder> _get_default_finders();
74 };
75 
76 }
77 
78 #endif // _b7afd80f_327e_4d9a_b0fa_88c565add7b3
Definition: Association.cpp:39
static VR public_dictionary(Tag const &tag, DataSet const &, std::string const &)
Return the VR from the public dictionary.
Definition: VRFinder.cpp:81
A DICOM element tag.
Definition: Tag.h:22
std::vector< Finder > finders
User-defined finder functions, empty by default.
Definition: VRFinder.h:40
static VR implicit_vr_little_endian(Tag const &tag, DataSet const &data_set, std::string const &transfer_syntax)
Return the VR of elements defined in PS3.5, A.1 (c).
Definition: VRFinder.cpp:124
static std::vector< Finder > const default_finders
Default finder functions.
Definition: VRFinder.h:37
std::function< VR(Tag const &, DataSet const &, std::string const &)> Finder
Prototype of finder functions.
Definition: VRFinder.h:34
DICOM Data set.
Definition: DataSet.h:66
VRFinder()
Constructor.
Definition: VRFinder.cpp:29
VR operator()(Tag const &tag, DataSet const &data_set, std::string const &transfer_syntax) const
Return a VR for the given tag, partially-constructed data set and transfer-syntax. If no VR can be found, raise an exception.
Definition: VRFinder.cpp:36
static VR private_tag(Tag const &tag, DataSet const &, std::string const &)
Return a default VR (UN) for private tags.
Definition: VRFinder.cpp:109
Find the VR of elements in an implicit VR data set.
Definition: VRFinder.h:24
static VR group_length(Tag const &tag, DataSet const &, std::string const &)
Return the VR of group-length (gggg,0000) elements.
Definition: VRFinder.cpp:94