7 #include "fwGdcmIO/reader/tid/Measurement.hpp" 9 #include "fwGdcmIO/container/sr/DicomSRImageNode.hpp" 10 #include "fwGdcmIO/container/sr/DicomSRSCoord3DNode.hpp" 11 #include "fwGdcmIO/container/sr/DicomSRSCoordNode.hpp" 12 #include "fwGdcmIO/container/sr/DicomSRTextNode.hpp" 13 #include "fwGdcmIO/helper/DicomDataTools.hpp" 15 #include <fwData/Boolean.hpp> 16 #include <fwData/PointList.hpp> 17 #include <fwData/String.hpp> 18 #include <fwData/Vector.hpp> 20 #include <fwDataTools/fieldHelper/Image.hpp> 32 const SPTR(::gdcm::Reader)& reader,
33 const ::fwGdcmIO::container::DicomInstance::sptr& instance,
34 const ::fwData::Image::sptr& image,
35 const ::fwLog::Logger::sptr& logger) :
36 ::
fwGdcmIO::reader::tid::TemplateID< ::
fwData::Image >(dicomSeries, reader, instance, image, logger)
42 Measurement::~Measurement()
55 if(subNode->getType() ==
"SCOORD")
59 if(scoordNode && scoordNode->getGraphicType() ==
"POLYLINE")
62 ::fwGdcmIO::container::sr::DicomSRSCoordNode::GraphicDataContainerType coordinates =
65 if(!scoordNode->getSubNodeContainer().empty())
69 *scoordNode->getSubNodeContainer().begin());
74 m_object, frameNumber);
76 auto origin = ::fwData::Point::New(static_cast<double>(coordinates[0]),
77 static_cast<double>(coordinates[1]), zCoordinate);
78 auto destination = ::fwData::Point::New(static_cast<double>(coordinates[2]),
79 static_cast<double>(coordinates[3]), zCoordinate);
80 this->addDistance(origin, destination);
86 else if(subNode->getType() ==
"SCOORD3D")
90 if(scoord3DNode && scoord3DNode->getGraphicType() ==
"POLYLINE")
93 ::fwGdcmIO::container::sr::DicomSRSCoordNode::GraphicDataContainerType coordinates =
95 this->addDistance(::fwData::Point::New(coordinates[0], coordinates[1], coordinates[2]),
96 ::fwData::Point::New(coordinates[3], coordinates[4], coordinates[5]));
108 ::fwData::Vector::sptr distanceVector =
113 distanceVector = ::fwData::Vector::New();
117 ::fwData::PointList::sptr pointList = ::fwData::PointList::New();
118 pointList->getPoints().push_back(point1);
119 pointList->getPoints().push_back(point2);
121 distanceVector->getContainer().push_back(pointList);
122 m_object->setField(
"ShowDistances", ::fwData::Boolean::New(
true));
FWGDCMIO_API Measurement(const std::shared_ptr< const ::fwMedData::DicomSeries > &dicomSeries, const std::shared_ptr< ::gdcm::Reader > &reader, const std::shared_ptr< ::fwGdcmIO::container::DicomInstance > &instance, const ::fwData::Image::sptr &image, const ::fwLog::Logger::sptr &logger)
Constructor.
const SubNodeContainer & getSubNodeContainer() const
Get Sub node container.
This class define a 3D point.
This class defines an IMAGE node in a SR document.
const GraphicDataContainerType & getGraphicDataContainer() const
Get Graphic data container.
The namespace fwGdcmIO contains reader, writer and helper for dicom data.
This class defines a node in a SR document.
const GraphicDataContainerType & getGraphicDataContainer() const
Get Graphic data container.
This class defines a vector of objects.
This class represents a DICOM basic coded entry. It stores the four mains attributes : Code Value...
This class defines a SCOORD node in a SR document.
Contains the representation of the data objects used in the framework.
const int & getFrameNumber() const
Get Frame number.
This class defines a SCOORD3D node in a SR document.
const DicomCodedAttribute & getCodedAttribute() const
Get Coded attribute.