7 #include "fwGdcmIO/writer/tid/Fiducial.hpp" 9 #include "fwGdcmIO/container/DicomCodedAttribute.hpp" 10 #include "fwGdcmIO/container/sr/DicomSRCodeNode.hpp" 11 #include "fwGdcmIO/container/sr/DicomSRImageNode.hpp" 12 #include "fwGdcmIO/container/sr/DicomSRSCoord3DNode.hpp" 13 #include "fwGdcmIO/container/sr/DicomSRSCoordNode.hpp" 14 #include "fwGdcmIO/container/sr/DicomSRTextNode.hpp" 15 #include "fwGdcmIO/container/sr/DicomSRUIDRefNode.hpp" 16 #include "fwGdcmIO/helper/DicomDataTools.hpp" 18 #include <fwData/PointList.hpp> 19 #include <fwData/String.hpp> 20 #include <fwData/Vector.hpp> 22 #include <fwDataTools/fieldHelper/Image.hpp> 24 #include <fwMedData/Series.hpp> 25 #include <fwMedData/types.hpp> 27 #include <fwTools/Stringizer.hpp> 29 #include <boost/algorithm/string/split.hpp> 31 #include <gdcmUIDGenerator.h> 46 const ::fwData::Image::csptr& image) :
62 ::fwData::PointList::sptr pointList =
67 for(const ::fwData::Point::sptr&
point : pointList->getPoints())
77 const ::fwData::Point::csptr&
point,
78 unsigned int id,
bool useSCoord3D)
82 std::make_shared< ::fwGdcmIO::container::sr::DicomSRCodeNode >(
90 std::make_shared< ::fwGdcmIO::container::sr::DicomSRUIDRefNode >(
92 "Fiducial ID"),
"HAS PROPERTIES", ::fwTools::getString(
id));
93 rootNode->addSubNode(idNode);
96 ::gdcm::UIDGenerator generator;
98 std::make_shared< ::fwGdcmIO::container::sr::DicomSRUIDRefNode >(
100 generator.Generate());
101 rootNode->addSubNode(uidNode);
104 const std::string label =
107 std::make_shared< ::fwGdcmIO::container::sr::DicomSRTextNode >(
109 rootNode->addSubNode(intentNode);
114 const float scoord[] = {
115 static_cast<float>(point->getCoord()[0]),
116 static_cast<float>(point->getCoord()[1]),
117 static_cast<float>(point->getCoord()[2])
119 std::vector<float> scoordVector(scoord, scoord + 3);
121 std::make_shared< ::fwGdcmIO::container::sr::DicomSRSCoord3DNode >(
124 rootNode->addSubNode(scoord3DNode);
129 const float scoord[] = {
130 static_cast<float>(point->getCoord()[0]),
131 static_cast<float>(point->getCoord()[1])
133 std::vector<float> scoordVector(scoord, scoord + 2);
135 std::make_shared< ::fwGdcmIO::container::sr::DicomSRSCoordNode >(
137 rootNode->addSubNode(scoordNode);
142 std::make_shared< ::fwGdcmIO::container::sr::DicomSRImageNode >(
144 m_instance->getSOPInstanceUIDContainer()[frameNumber-1], frameNumber);
145 scoordNode->addSubNode(imageNode);
This class defines a UIDREF node in a SR document.
std::shared_ptr< const ::fwData::Image > m_object
FW4SPL Object.
void createFiducial(const std::shared_ptr< ::fwGdcmIO::container::sr::DicomSRNode > &parent, const std::shared_ptr< const ::fwData::Point > &point, unsigned int id, bool useSCoord3D)
Create a fiducial node.
This class defines a TEXT node in a SR document.
This class defines a DICOM SOP instance. It is useful during the whole writing process. This class allows to share data between module writers.
This class defines an IMAGE node in a SR document.
FWGDCMIO_API Fiducial(const std::shared_ptr< ::gdcm::Writer > &writer, const std::shared_ptr< ::fwGdcmIO::container::DicomInstance > &instance, const ::fwData::Image::csptr &image)
Constructor.
virtual FWGDCMIO_API void createNodes(const std::shared_ptr< ::fwGdcmIO::container::sr::DicomSRNode > &parent, bool useSCoord3D=true)
Create nodes according to the template.
TemplateID base class used to write templates.
The namespace fwGdcmIO contains reader, writer and helper for dicom data.
This class defines a node in a SR document.
This class represents a DICOM basic coded entry. It stores the four mains attributes : Code Value...
std::shared_ptr< ::fwGdcmIO::container::DicomInstance > m_instance
DICOM Instance.
This class defines a SCOORD node in a SR document.
virtual FWGDCMIO_API ~Fiducial()
Destructor.
This class defines a CODE node in a SR document.
This class defines a list of points.
FWGDCMIO_API void addSubNode(const std::shared_ptr< DicomSRNode > &node)
Add a sub node.
Contains the representation of the data objects used in the framework.
This class defines a SCOORD3D node in a SR document.
This class contains an std::string value.