fw4spl
core/fwMedData/include/fwMedData/DicomSeries.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2018.
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 #pragma once
8 
9 #include "fwMedData/config.hpp"
10 #include "fwMedData/Series.hpp"
11 #include "fwMedData/types.hpp"
12 
13 #include <fwData/factory/new.hpp>
14 
15 #include <fwMemory/BufferObject.hpp>
16 
17 #include <boost/filesystem/path.hpp>
18 
19 fwCampAutoDeclareDataMacro((fwMedData)(DicomSeries), FWMEDDATA_API);
20 
21 namespace fwMedData
22 {
23 
27 class FWMEDDATA_CLASS_API DicomSeries : public ::fwMedData::Series
28 {
29 
30 public:
31 
33  ::fwData::factory::New< DicomSeries >);
34 
35  fwCampMakeFriendDataMacro((fwMedData)(DicomSeries));
36 
37  typedef std::map < std::size_t, ::fwMemory::BufferObject::sptr > DicomContainerType;
38 
39  typedef std::set < std::string > SOPClassUIDContainerType;
40 
41  typedef std::map < std::string, std::string > ComputedTagValueContainerType;
42 
47  FWMEDDATA_API DicomSeries(::fwData::Object::Key key);
48 
50  FWMEDDATA_API virtual ~DicomSeries() override;
51 
53  FWMEDDATA_API void shallowCopy( const ::fwData::Object::csptr& _source ) override;
54 
56  FWMEDDATA_API void cachedDeepCopy( const ::fwData::Object::csptr& _source, DeepCopyCacheType& cache ) override;
57 
59  FWMEDDATA_API void addDicomPath(std::size_t instanceIndex, const ::boost::filesystem::path& path);
60 
62  FWMEDDATA_API void addBinary(std::size_t instanceIndex, const ::fwMemory::BufferObject::sptr& buffer);
63 
67  FWMEDDATA_API bool isInstanceAvailable(std::size_t instanceIndex) const;
68 
73  FWMEDDATA_API void addSOPClassUID(const std::string& sopClassUID);
74 
80  FWMEDDATA_API void addComputedTagValue(const std::string& tagName, const std::string& value);
81 
87  FWMEDDATA_API bool hasComputedValues(const std::string& tagName) const;
88 
92  size_t getNumberOfInstances () const
93  {
94  return m_numberOfInstances;
95  }
96  //------------------------------------------------------------------------------
97 
98  void setNumberOfInstances (std::size_t val)
99  {
100  m_numberOfInstances = val;
101  }
107  const DicomContainerType& getDicomContainer () const
108  {
109  return m_dicomContainer;
110  }
111  //------------------------------------------------------------------------------
112 
113  void setDicomContainer (const DicomContainerType& dicomContainer)
114  {
115  m_dicomContainer = dicomContainer;
116  }
117 
118  //------------------------------------------------------------------------------
119 
121  {
122  m_dicomContainer.clear();
123  }
129  const SOPClassUIDContainerType& getSOPClassUIDs () const
130  {
131  return m_SOPClassUIDs;
132  }
133  //------------------------------------------------------------------------------
134 
135  void setSOPClassUIDs (const SOPClassUIDContainerType& val)
136  {
137  m_SOPClassUIDs = val;
138  }
144  const ComputedTagValueContainerType& getComputedTagValues () const
145  {
146  return m_computedTagValues;
147  }
148  //------------------------------------------------------------------------------
149 
150  void setComputedTagValues (const ComputedTagValueContainerType& val)
151  {
152  m_computedTagValues = val;
153  }
159  std::size_t getFirstInstanceNumber() const
160  {
161  return m_firstInstanceNumber;
162  }
163 
164  //------------------------------------------------------------------------------
165 
166  void setFirstInstanceNumber(std::size_t firstInstanceNumber)
167  {
168  m_firstInstanceNumber = firstInstanceNumber;
169  }
174 protected:
175 
178 
180  DicomContainerType m_dicomContainer;
181 
183  SOPClassUIDContainerType m_SOPClassUIDs;
184 
186  ComputedTagValueContainerType m_computedTagValues;
187 
190 };
191 
192 } //end namespace fwMedData
const ComputedTagValueContainerType & getComputedTagValues() const
Computed Tag Values.
std::size_t m_firstInstanceNumber
First instance number (0 or 1) - Used for PACS preview.
std::size_t getFirstInstanceNumber() const
First Instance Number (0 or 1) - Used for PACS preview.
Namespace containing medical data.
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
size_t m_numberOfInstances
Number of instances in the series (0020,1209)
ComputedTagValueContainerType m_computedTagValues
Computed tag values.
void setNumberOfInstances(std::size_t val)
Number of instances in the series (0020,1009)
size_t getNumberOfInstances() const
Number of instances in the series (0020,1009)
DicomContainerType m_dicomContainer
Dicom container.
void setDicomContainer(const DicomContainerType &dicomContainer)
Dicom container.
SOPClassUIDContainerType m_SOPClassUIDs
SOP Class UIDs.
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
void setComputedTagValues(const ComputedTagValueContainerType &val)
Computed Tag Values.
Base class for each data object.
const SOPClassUIDContainerType & getSOPClassUIDs() const
SOP Class UID.
void setSOPClassUIDs(const SOPClassUIDContainerType &val)
SOP Class UID.
const DicomContainerType & getDicomContainer() const
Dicom container.
void setFirstInstanceNumber(std::size_t firstInstanceNumber)
First Instance Number (0 or 1) - Used for PACS preview.