fw4spl
reader/tid/TemplateID.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 
12 #include <fwData/Object.hpp>
13 
14 #include <fwLog/Logger.hpp>
15 
16 #include <gdcmReader.h>
17 
18 namespace fwGdcmIO
19 {
20 namespace reader
21 {
22 namespace tid
23 {
24 
28 template< class DATATYPE >
29 class FWGDCMIO_CLASS_API TemplateID
30 {
31 
32 public:
41  FWGDCMIO_API TemplateID(const CSPTR(::fwMedData::DicomSeries)& dicomSeries,
42  const SPTR(::gdcm::Reader)& reader,
43  const SPTR(::fwGdcmIO::container::DicomInstance)& instance,
44  const SPTR(DATATYPE)& object,
45  const ::fwLog::Logger::sptr& logger);
46 
48  FWGDCMIO_API virtual ~TemplateID();
49 
50 protected:
51 
53  CSPTR(::fwMedData::DicomSeries) m_dicomSeries;
54 
56  SPTR(::gdcm::Reader) m_reader;
57 
59  SPTR(::fwGdcmIO::container::DicomInstance) m_instance;
60 
62  SPTR(DATATYPE) m_object;
63 
65  ::fwLog::Logger::sptr m_logger;
66 };
67 
68 //------------------------------------------------------------------------------
69 
70 template< class DATATYPE >
71 TemplateID<DATATYPE>::TemplateID(const CSPTR(::fwMedData::DicomSeries)& dicomSeries,
72  const SPTR(::gdcm::Reader)& reader,
73  const SPTR(::fwGdcmIO::container::DicomInstance)& instance,
74  const SPTR(DATATYPE)& object,
75  const ::fwLog::Logger::sptr& logger) :
76  m_dicomSeries(dicomSeries),
77  m_reader(reader),
78  m_instance(instance),
79  m_object(object),
80  m_logger(logger)
81 {
82  SLM_ASSERT("DicomSeries should not be null.", dicomSeries);
83  SLM_ASSERT("Reader should not be null.", reader);
84  SLM_ASSERT("Instance should not be null.", instance);
85  SLM_ASSERT("Object should not be null.", object);
86  SLM_ASSERT("Logger should not be null.", logger);
87 }
88 
89 //------------------------------------------------------------------------------
90 
91 template< class DATATYPE >
93 {
94 }
95 
96 //------------------------------------------------------------------------------
97 
98 } // namespace tid
99 } // namespace reader
100 } // namespace fwGdcmIO
#define SPTR(_cls_)
#define CSPTR(_cls_)
Namespace containing medical data.
This class defines a DICOM SOP instance. It is useful during the whole writing process. This class allows to share data between module writers.
The namespace fwGdcmIO contains reader, writer and helper for dicom data.
fwLog contains classes used to manage logs.
Definition: Log.hpp:16
#define SLM_ASSERT(message, cond)
work like &#39;assert&#39; from &#39;cassert&#39;, with in addition a message logged by spylog (with FATAL loglevel) ...
Definition: spyLog.hpp:308
virtual FWGDCMIO_API ~TemplateID()
Destructor.
TemplateID base class used to write templates.