fw4spl
include/fwMedData/ImageSeries.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/DicomSeries.hpp"
11 #include "fwMedData/Series.hpp"
12 #include "fwMedData/types.hpp"
13 
14 #include <fwData/factory/new.hpp>
15 
16 fwCampAutoDeclareDataMacro((fwMedData)(ImageSeries), FWMEDDATA_API);
17 
18 namespace fwData
19 {
20 class Image;
21 }
22 
23 namespace fwMedData
24 {
25 
29 class FWMEDDATA_CLASS_API ImageSeries : public ::fwMedData::Series
30 {
31 
32 public:
34  ::fwData::factory::New< ImageSeries >);
35 
36  fwCampMakeFriendDataMacro((fwMedData)(ImageSeries));
37 
42  FWMEDDATA_API ImageSeries(::fwData::Object::Key key);
43 
45  FWMEDDATA_API virtual ~ImageSeries() override;
46 
48  FWMEDDATA_API void shallowCopy( const ::fwData::Object::csptr& _source ) override;
49 
51  FWMEDDATA_API void cachedDeepCopy( const ::fwData::Object::csptr& _source, DeepCopyCacheType& cache ) override;
52 
60  SPTR(::fwData::Image) getImage() const;
61  void setImage(const SPTR(::fwData::Image)& val);
67  ::fwMedData::DicomSeries::csptr getDicomReference() const;
68  void setDicomReference(const ::fwMedData::DicomSeries::csptr& reference);
73 protected:
74 
76  SPTR(::fwData::Image) m_image;
77 
79  ::fwMedData::DicomSeries::sptr m_dicomReference;
80 };
81 
82 //-----------------------------------------------------------------------------
83 
84 inline SPTR(::fwData::Image) ImageSeries::getImage() const
85 {
86  return m_image;
87 }
88 
89 //-----------------------------------------------------------------------------
90 
91 inline void ImageSeries::setImage(const SPTR(::fwData::Image)& val)
92 {
93  m_image = val;
94 }
95 
96 //-----------------------------------------------------------------------------
97 
98 inline ::fwMedData::DicomSeries::csptr ImageSeries::getDicomReference() const
99 {
100  return m_dicomReference;
101 }
102 
103 //-----------------------------------------------------------------------------
104 
105 inline void ImageSeries::setDicomReference(const ::fwMedData::DicomSeries::csptr& reference)
106 {
107  m_dicomReference = std::const_pointer_cast< ::fwMedData::DicomSeries >( reference );
108 }
109 
110 //-----------------------------------------------------------------------------
111 
112 } //end namespace fwMedData
#define SPTR(_cls_)
Namespace containing medical data.
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
Base class for each data object.
Contains the representation of the data objects used in the framework.
This class defines an image.