fw4spl
DicomSRTextNode.cpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2017.
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/container/sr/DicomSRTextNode.hpp"
8 
9 #include "fwGdcmIO/helper/DicomDataWriter.hxx"
10 
11 namespace fwGdcmIO
12 {
13 namespace container
14 {
15 namespace sr
16 {
17 
18 //------------------------------------------------------------------------------
19 
21  const std::string& relationship,
22  const std::string textValue) :
23  ::fwGdcmIO::container::sr::DicomSRNode(codedAttribute, "TEXT", relationship),
24  m_textValue(textValue)
25 {
26 }
27 
28 //------------------------------------------------------------------------------
29 
31 {
32 }
33 
34 //------------------------------------------------------------------------------
35 
36 void DicomSRTextNode::write(::gdcm::DataSet& dataset) const
37 {
39 
40  // Text Value - Type 1C
41  ::fwGdcmIO::helper::DicomDataWriter::setTagValue< 0x0040, 0xa160 >(m_textValue, dataset);
42 }
43 
44 //------------------------------------------------------------------------------
45 
46 void DicomSRTextNode::print(std::ostream& os) const
47 {
49  os << "\\nText value : [" << m_textValue << "]";
50 }
51 
52 //------------------------------------------------------------------------------
53 
54 } //namespace sr
55 } //namespace container
56 } //namespace fwGdcmIO
virtual FWGDCMIO_API void write(::gdcm::DataSet &dataset) const
Write the SR node in the dataset.
The namespace fwGdcmIO contains reader, writer and helper for dicom data.
This class defines a node in a SR document.
Definition: DicomSRNode.hpp:27
virtual void print(std::ostream &os) const
Dump function.
std::string m_textValue
Text Value (0040, a160)
FWGDCMIO_API DicomSRTextNode(const DicomCodedAttribute &codedAttribute, const std::string &relationship, const std::string textValue)
Constructor.
This class represents a DICOM basic coded entry. It stores the four mains attributes : Code Value...
virtual void print(std::ostream &os) const
Dump function.
virtual FWGDCMIO_API void write(::gdcm::DataSet &dataset) const
Write the SR node in the dataset.
Definition: DicomSRNode.cpp:44
virtual FWGDCMIO_API ~DicomSRTextNode()
Destructor.