fw4spl
DicomSRCodeNode.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/DicomSRCodeNode.hpp"
8 
9 #include "fwGdcmIO/helper/DicomDataWriter.hxx"
10 
11 namespace fwGdcmIO
12 {
13 namespace container
14 {
15 namespace sr
16 {
17 
18 //------------------------------------------------------------------------------
19 
20 DicomSRCodeNode::DicomSRCodeNode(const DicomCodedAttribute& codedAttribute, const std::string& relationship
21  , const DicomCodedAttribute& codedEntry) :
22  ::fwGdcmIO::container::sr::DicomSRNode(codedAttribute, "CODE", relationship),
23  m_codedEntry(codedEntry)
24 {
25 }
26 
27 //------------------------------------------------------------------------------
28 
30 {
31 }
32 
33 //------------------------------------------------------------------------------
34 
35 void DicomSRCodeNode::write(::gdcm::DataSet& dataset) const
36 {
38 
39  // Concept Code Sequence - Type 1
40  ::gdcm::SmartPointer< ::gdcm::SequenceOfItems > codeSequence =
42  ::fwGdcmIO::helper::DicomDataWriter::setAndMergeSequenceTagValue< 0x0040, 0xa168 >(codeSequence, dataset);
43 }
44 
45 //------------------------------------------------------------------------------
46 
47 void DicomSRCodeNode::print(std::ostream& os) const
48 {
50  os << "\\nCoded entry : [" << m_codedEntry << "]";
51 }
52 
53 //------------------------------------------------------------------------------
54 
55 } //namespace sr
56 } //namespace container
57 } //namespace fwGdcmIO
virtual FWGDCMIO_API void write(::gdcm::DataSet &dataset) const
Write the SR node in the dataset.
virtual FWGDCMIO_API ~DicomSRCodeNode()
Destructor.
The namespace fwGdcmIO contains reader, writer and helper for dicom data.
This class defines a node in a SR document.
Definition: DicomSRNode.hpp:27
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 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
FWGDCMIO_API DicomSRCodeNode(const DicomCodedAttribute &codedAttribute, const std::string &relationship, const DicomCodedAttribute &codedEntry)
Constructor.
::gdcm::SmartPointer< ::gdcm::SequenceOfItems > createConceptNameCodeSequence(const DicomCodedAttribute &codedAttribute) const
Create a concept name code sequence.
Definition: DicomSRNode.cpp:73
DicomCodedAttribute m_codedEntry
Coded Entry.