Odil
A C++11 library for the DICOM standard
Selector.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 _b1a6d333_684d_4b50_a9b9_68af24027a10
10 #define _b1a6d333_684d_4b50_a9b9_68af24027a10
11 
12 #include <string>
13 #include <utility>
14 #include <vector>
15 #include <map>
16 
17 #include "odil/odil.h"
18 
19 namespace odil
20 {
21 
22 namespace webservices
23 {
24 
27 {
28 public:
29 
32  std::map<std::string, std::string> const & selector={},
33  std::vector<int> const & frames={});
34 
35  Selector(Selector const &) = default;
36  Selector(Selector &&) = default;
37  Selector & operator=(Selector const &) = default;
38  Selector & operator=(Selector &&) = default;
39  ~Selector() = default;
40 
42  static std::pair<std::string, Selector> from_path(std::string const & path);
43 
45  bool operator==(Selector const & other) const;
46 
48  bool operator!=(Selector const & other) const;
49 
54  std::string get_path(bool include_frames) const;
55 
57  bool is_study_present() const;
59  bool is_series_present() const;
61  bool is_instance_present() const;
62 
64  std::string const & get_study() const;
66  std::string const & get_series() const;
68  std::string const & get_instance() const;
70  std::vector<int> const & get_frames() const;
71 
73  Selector & set_study(std::string const & study);
75  Selector & set_series(std::string const & series);
77  Selector & set_instance(std::string const & instance);
79  Selector & set_frames(std::vector<int> const & frames);
80 
81 private:
82  std::string _study;
83  std::string _series;
84  std::string _instance;
85  std::vector<int> _frames;
86  bool _study_present;
87  bool _series_present;
88  bool _instance_present;
89 };
90 
91 }
92 
93 }
94 
95 #endif // _b1a6d333_684d_4b50_a9b9_68af24027a10
odil::webservices::Selector::from_path
static std::pair< std::string, Selector > from_path(std::string const &path)
Build selector from URL path, return service path and selector.
odil::webservices::Selector::get_series
std::string const & get_series() const
return the wanted series
odil::webservices::Selector::set_instance
Selector & set_instance(std::string const &instance)
set the wanted instance
odil::webservices::Selector::operator=
Selector & operator=(Selector const &)=default
odil
Definition: Association.h:25
ODIL_API
#define ODIL_API
Definition: odil.h:28
odil::webservices::Selector::is_study_present
bool is_study_present() const
return if study field is present in the selector
odil.h
odil::webservices::Selector::is_instance_present
bool is_instance_present() const
return if instance field is present in the selector
odil::webservices::Selector
Target (in the DICOM data model) of the request.
Definition: Selector.h:27
odil::webservices::Selector::get_path
std::string get_path(bool include_frames) const
Return the associated URL path, with the optional "frames" component.
odil::webservices::Selector::Selector
Selector(Selector &&)=default
odil::webservices::Selector::set_series
Selector & set_series(std::string const &series)
set the wanted series
odil::webservices::Selector::operator==
bool operator==(Selector const &other) const
Equality operator.
odil::webservices::Selector::get_instance
std::string const & get_instance() const
return the wanted instance
odil::webservices::Selector::get_study
std::string const & get_study() const
return the wanted study
odil::webservices::Selector::set_study
Selector & set_study(std::string const &study)
set the wanted study
odil::webservices::Selector::get_frames
std::vector< int > const & get_frames() const
return the wanted frames
odil::webservices::Selector::is_series_present
bool is_series_present() const
return if series field is present in the selector
odil::webservices::Selector::Selector
Selector(Selector const &)=default
odil::webservices::Selector::operator=
Selector & operator=(Selector &&)=default
odil::webservices::Selector::set_frames
Selector & set_frames(std::vector< int > const &frames)
set the wanted frames
odil::webservices::Selector::Selector
Selector(std::map< std::string, std::string > const &selector={}, std::vector< int > const &frames={})
Default constructor.
odil::webservices::Selector::~Selector
~Selector()=default
odil::webservices::Selector::operator!=
bool operator!=(Selector const &other) const
Difference operator.