fw4spl
io/fwGdcmIO/include/fwGdcmIO/writer/Series.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 "fwGdcmIO/config.hpp"
10 #include "fwGdcmIO/container/DicomInstance.hpp"
11 #include "fwGdcmIO/exception/Failed.hpp"
12 
13 #include <fwData/location/Folder.hpp>
14 
15 #include <fwDataIO/writer/GenericObjectWriter.hpp>
16 
17 #include <fwMedData/ImageSeries.hpp>
18 
19 #include <fwTools/ProgressAdviser.hpp>
20 
21 namespace fwGdcmIO
22 {
23 namespace writer
24 {
25 
31 class FWGDCMIO_CLASS_API Series : public ::fwDataIO::writer::GenericObjectWriter< ::fwMedData::Series >,
32  public ::fwData::location::enableFolder< ::fwDataIO::writer::IObjectWriter >,
34 {
35 
36 public:
37 
39  (()), ::fwDataIO::writer::factory::New< Series >);
40 
41  typedef enum
42  {
43  SPATIAL_FIDUCIALS = 1,
44  COMPREHENSIVE_SR = 2,
45  COMPREHENSIVE_3D_SR = 3
47 
48  typedef std::map< std::string, SPTR(::fwGdcmIO::container::DicomInstance) > DicomInstanceMapType;
49 
51  FWGDCMIO_API Series(::fwDataIO::writer::IObjectWriter::Key key);
52 
54  FWGDCMIO_API ~Series();
55 
62  FWGDCMIO_API void write() throw (::fwGdcmIO::exception::Failed) override;
63 
68  FWGDCMIO_API std::string extension() override;
69 
71  const FiducialsExportMode& getFiducialsExportMode() const
72  {
73  return m_fiducialsExportMode;
74  }
75 
77  void setFiducialsExportMode(const FiducialsExportMode& fiducialsExportMode)
78  {
79  m_fiducialsExportMode = fiducialsExportMode;
80  }
81 
82 private:
83 
88  bool hasDocumentSR(const ::fwMedData::ImageSeries::csptr& series) const;
89 
95  SPTR(::fwGdcmIO::container::DicomInstance) getImageInstance();
96 
98  DicomInstanceMapType m_dicomInstanceMap;
99 
101  FiducialsExportMode m_fiducialsExportMode;
102 
103 };
104 
105 } // namespace writer
106 } // namespace fwGdcmIO
#define SPTR(_cls_)
Subclasses Inherited from ProgressAdviser can notify progression This class is used as base class to ...
STL namespace.
This class defines a DICOM SOP instance. It is useful during the whole writing process. This class allows to share data between module writers.
This class handles DICOM files writing. It defines needs of data storage and delegates writing to app...
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
The namespace fwGdcmIO contains reader, writer and helper for dicom data.
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
This class is derived by reader/writer.
Definition: Folder.hpp:80
void setFiducialsExportMode(const FiducialsExportMode &fiducialsExportMode)
Set Fiducials Export Mode);.
generic class for all object writers.