fw4spl
SegmentedPropertyRegistry.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2017.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWGDCMIO_HELPER_SEGMENTEDPROPERTYREGISTRY_HPP__
8 #define __FWGDCMIO_HELPER_SEGMENTEDPROPERTYREGISTRY_HPP__
9 
10 #include "fwGdcmIO/config.hpp"
11 #include "fwGdcmIO/container/DicomCodedAttribute.hpp"
12 
13 #include <fwData/Object.hpp>
14 
15 #include <boost/filesystem/path.hpp>
16 
17 #include <array>
18 #include <string>
19 
20 namespace fwLog
21 {
22 class Logger;
23 }
24 
25 namespace fwGdcmIO
26 {
27 namespace helper
28 {
29 
40 class FWGDCMIO_CLASS_API SegmentedPropertyRegistry
41 {
42 public:
43 
45  typedef std::array<std::string, 5> EntryType;
46 
48  FWGDCMIO_API SegmentedPropertyRegistry();
49 
64  FWGDCMIO_API bool readSegmentedPropertyRegistryFile(const ::boost::filesystem::path& filepath,
65  bool omitFirstLine = false,
66  const SPTR(::fwLog::Logger)& logger = 0);
67 
82  FWGDCMIO_API bool readSegmentedPropertyRegistryFile(std::istream& csvStream,
83  bool omitFirstLine = false,
84  const SPTR(::fwLog::Logger)& logger = 0);
85 
87  FWGDCMIO_API bool empty() const;
88 
90  FWGDCMIO_API std::size_t count() const;
91 
93  FWGDCMIO_API void clear();
94 
99  FWGDCMIO_API bool hasEntry(const std::string& structureType) const;
100 
105  FWGDCMIO_API EntryType getEntry(const std::string& structureType) const;
106 
111  FWGDCMIO_API std::string getPropertyType(const std::string& structureType) const;
112  FWGDCMIO_API std::string getPropertyCategory(const std::string& structureType) const;
113  FWGDCMIO_API std::string getPropertyTypeModifiers(const std::string& structureType) const;
114  FWGDCMIO_API std::string getAnatomicRegion(const std::string& structureType) const;
115  FWGDCMIO_API std::string getAnatomicRegionModifiers(const std::string& structureType) const;
127  FWGDCMIO_API std::string getStructureType(const std::string& propertyType,
128  const std::string& propertyCategory,
129  const std::string& propertyTypeModifiers,
130  const std::string& anatomicRegion,
131  const std::string& anatomicRegionModifiers) const;
132 
133 private:
134 
136  typedef std::map<std::string, EntryType> EntryRegistryType;
137 
139  static const EntryType s_DEFAULT_ENTRY_VALUE;
140 
142  EntryRegistryType m_registry;
143 
144 };
145 
146 } //namespace helper
147 } //namespace fwGdcmIO
148 
149 #endif // __FWGDCMIO_HELPER_SEGMENTEDPROPERTYREGISTRY_HPP__
#define SPTR(_cls_)
The namespace fwGdcmIO contains reader, writer and helper for dicom data.
fwLog contains classes used to manage logs.
Definition: Log.hpp:16
Registry of Segment Properties. This class defines a registry which links a structure type to an entr...
Logger class used to store logs.
std::array< std::string, 5 > EntryType
Entry containing the 5 attributes of a structure type.