fw4spl
io/fwGdcmIO/src/fwGdcmIO/writer/ie/Study.cpp
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 #include "fwGdcmIO/writer/ie/Study.hpp"
8 
9 #include "fwGdcmIO/helper/DicomDataWriter.hxx"
10 
11 #include <fwMedData/Study.hpp>
12 
13 namespace fwGdcmIO
14 {
15 namespace writer
16 {
17 namespace ie
18 {
19 
20 //------------------------------------------------------------------------------
21 
22 Study::Study(const SPTR(::gdcm::Writer)& writer,
23  const SPTR(::fwGdcmIO::container::DicomInstance)& instance,
24  const ::fwMedData::Study::csptr& study,
25  const ::fwLog::Logger::sptr& logger,
26  ProgressCallback progress,
27  CancelRequestedCallback cancel) :
28  ::fwGdcmIO::writer::ie::InformationEntity< ::fwMedData::Study >(writer, instance, study,
29  logger, progress, cancel)
30 {
31 }
32 
33 //------------------------------------------------------------------------------
34 
36 {
37 }
38 
39 //------------------------------------------------------------------------------
40 
42 {
43  // Retrieve dataset
44  ::gdcm::DataSet& dataset = m_writer->GetFile().GetDataSet();
45 
46  // Study's date - Type 2
47  ::fwGdcmIO::helper::DicomDataWriter::setTagValue< 0x0008, 0x0020 >(m_object->getDate(), dataset);
48 
49  // Study's time - Type 2
50  ::fwGdcmIO::helper::DicomDataWriter::setTagValue< 0x0008, 0x0030 >(m_object->getTime(), dataset);
51 
52  // Study 's accession number - Type 2
53  ::fwGdcmIO::helper::DicomDataWriter::setTagValue< 0x0008, 0x0050 >("", dataset);
54 
55  // Study's description - Type 3
56  ::fwGdcmIO::helper::DicomDataWriter::setTagValue< 0x0008, 0x1030 >(m_object->getDescription(), dataset);
57 
58  // Study's UID - Type 1
59  ::fwGdcmIO::helper::DicomDataWriter::setTagValue< 0x0020, 0x000d >(m_object->getInstanceUID(), dataset);
60 
61  // Study's ID - Type 2
62  ::fwGdcmIO::helper::DicomDataWriter::setTagValue< 0x0020, 0x0010 >("Unknown", dataset);
63 
64  // Study's referring physician name
65  ::fwGdcmIO::helper::DicomDataWriter::setTagValue< 0x0008, 0x0090 >(m_object->getReferringPhysicianName(), dataset);
66 }
67 
68 //------------------------------------------------------------------------------
69 
71 {
72  // Retrieve dataset
73  ::gdcm::DataSet& dataset = m_writer->GetFile().GetDataSet();
74 
75  // PatientAge
76  ::fwGdcmIO::helper::DicomDataWriter::setTagValue< 0x0010, 0x1010 >(m_object->getPatientAge(), dataset);
77 }
78 
79 //------------------------------------------------------------------------------
80 
81 }// namespace ie
82 } // namespace writer
83 } // namespace fwGdcmIO
virtual FWGDCMIO_API void writePatientStudyModule()
Write Patient Study Module tags.
#define SPTR(_cls_)
Namespace containing medical data.
InformationEntity base class used to write modules.
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.
FWGDCMIO_API Study(const std::shared_ptr< ::gdcm::Writer > &writer, const std::shared_ptr< ::fwGdcmIO::container::DicomInstance > &instance, const ::fwMedData::Study::csptr &study, const ::fwLog::Logger::sptr &logger=nullptr, ProgressCallback progress=nullptr, CancelRequestedCallback cancel=nullptr)
Constructor.
std::shared_ptr< const ::fwMedData::Study > m_object
FW4SPL Object.
virtual FWGDCMIO_API void writeGeneralStudyModule()
Write General Study Module tags.