fw4spl
FrameOfReference.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/FrameOfReference.hpp"
8 
9 #include "fwGdcmIO/helper/DicomDataWriter.hxx"
10 
11 #include <fwMedData/Series.hpp>
12 
13 namespace fwGdcmIO
14 {
15 namespace writer
16 {
17 namespace ie
18 {
19 
20 //------------------------------------------------------------------------------
21 
22 FrameOfReference::FrameOfReference(const SPTR(::gdcm::Writer)& writer,
23  const SPTR(::fwGdcmIO::container::DicomInstance)& instance,
24  const ::fwMedData::Series::csptr& series,
25  const ::fwLog::Logger::sptr& logger,
26  ProgressCallback progress,
27  CancelRequestedCallback cancel) :
28  ::fwGdcmIO::writer::ie::InformationEntity< ::fwMedData::Series >(writer, instance, series,
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  // Frame of Reference UID
47  const std::string frameOfReferenceUID = m_instance->getFrameOfReferenceUID();
48  ::fwGdcmIO::helper::DicomDataWriter::setTagValue< 0x0020, 0x0052 >(frameOfReferenceUID, dataset);
49 
50  // Position Reference Indicator - Type 2
51  ::fwGdcmIO::helper::DicomDataWriter::setEmptyTagValue< 0x0020, 0x1040 >(dataset);
52 
53 }
54 
55 //------------------------------------------------------------------------------
56 
57 } // namespace ie
58 } // namespace writer
59 } // namespace fwGdcmIO
#define SPTR(_cls_)
Namespace containing medical data.
virtual FWGDCMIO_API void writeFrameOfReferenceModule()
Write Frame of Reference Module tags.
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.
std::shared_ptr< ::fwGdcmIO::container::DicomInstance > m_instance
DICOM Instance.
virtual FWGDCMIO_API ~FrameOfReference()
Destructor.
FWGDCMIO_API FrameOfReference(const std::shared_ptr< ::gdcm::Writer > &writer, const std::shared_ptr< ::fwGdcmIO::container::DicomInstance > &instance, const ::fwMedData::Series::csptr &series, const ::fwLog::Logger::sptr &logger=nullptr, ProgressCallback progress=nullptr, CancelRequestedCallback cancel=nullptr)
Constructor.