Odil
A C++11 library for the DICOM standard
VRFinder.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 _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/odil.h"
18 #include "odil/Tag.h"
19 #include "odil/VR.h"
20 
21 namespace odil
22 {
23 
26 {
27 public:
33  typedef
34  std::function<VR(Tag const &, std::shared_ptr<DataSet const>, std::string const &)>
36 
38  static std::vector<Finder> const default_finders;
39 
41  std::vector<Finder> finders;
42 
47  bool strict;
48 
50  VRFinder(bool strict=false);
51 
59  Tag const & tag, std::shared_ptr<DataSet const> data_set,
60  std::string const & transfer_syntax) const;
61 
64  Tag const & tag, std::shared_ptr<DataSet const>, std::string const &);
65 
67  static VR group_length(
68  Tag const & tag, std::shared_ptr<DataSet const>, std::string const &);
69 
71  static VR private_tag(
72  Tag const & tag, std::shared_ptr<DataSet const>, std::string const &);
73 
76  Tag const & tag, std::shared_ptr<DataSet const> data_set,
77  std::string const & transfer_syntax);
78 
81  Tag const & tag, std::shared_ptr<DataSet const> data_set,
82  std::string const & transfer_syntax);
83 
84 private:
85  static std::vector<Finder> _get_default_finders();
86 };
87 
88 }
89 
90 #endif // _b7afd80f_327e_4d9a_b0fa_88c565add7b3
A DICOM element tag.
Definition: Tag.h:25
Find the VR of elements in an implicit VR data set.
Definition: VRFinder.h:26
std::function< VR(Tag const &, std::shared_ptr< DataSet const >, std::string const &)> Finder
Prototype of finder functions.
Definition: VRFinder.h:35
VR operator()(Tag const &tag, std::shared_ptr< DataSet const > data_set, std::string const &transfer_syntax) const
Return a VR for the given tag, partially-constructed data set and transfer-syntax....
static VR private_tag(Tag const &tag, std::shared_ptr< DataSet const >, std::string const &)
Return a default VR (UN) for private tags.
static VR group_length(Tag const &tag, std::shared_ptr< DataSet const >, std::string const &)
Return the VR of group-length (gggg,0000) elements.
static VR implicit_vr_little_endian(Tag const &tag, std::shared_ptr< DataSet const > data_set, std::string const &transfer_syntax)
Return the VR of elements defined in PS3.5, A.1 (c).
static std::vector< Finder > const default_finders
Default finder functions.
Definition: VRFinder.h:38
static VR explicit_vr_little_endian(Tag const &tag, std::shared_ptr< DataSet const > data_set, std::string const &transfer_syntax)
Return the VR of elements defined in PS3.5, A.2 (c).
static VR public_dictionary(Tag const &tag, std::shared_ptr< DataSet const >, std::string const &)
Return the VR from the public dictionary.
VRFinder(bool strict=false)
Constructor.
std::vector< Finder > finders
User-defined finder functions, empty by default.
Definition: VRFinder.h:41
bool strict
Whether to raise an exception when a VR is not found, or to return VR::UN.
Definition: VRFinder.h:47
Definition: Association.h:25
VR
Value representations of DICOM.
Definition: VR.h:23
#define ODIL_API
Definition: odil.h:28