7 #include "fwGdcmIO/reader/tid/Fiducial.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> 19 #include <fwDataTools/fieldHelper/Image.hpp> 31 const SPTR(::gdcm::Reader)& reader,
32 const ::fwGdcmIO::container::DicomInstance::sptr& instance,
33 const ::fwData::Image::sptr& image,
34 const ::fwLog::Logger::sptr& logger) :
35 ::
fwGdcmIO::reader::tid::TemplateID< ::
fwData::Image >(dicomSeries, reader, instance, image, logger)
52 std::string label =
"";
54 bool foundLandmark =
false;
58 if(subNode->getCodedAttribute() ==
69 else if(subNode->getType() ==
"SCOORD")
73 if(scoordNode && scoordNode->getGraphicType() ==
"POINT")
76 ::fwGdcmIO::container::sr::DicomSRSCoordNode::GraphicDataContainerType coordinates =
82 if(!scoordNode->getSubNodeContainer().empty())
86 *scoordNode->getSubNodeContainer().begin());
98 else if(subNode->getType() ==
"SCOORD3D")
102 if(scoord3DNode && scoord3DNode->getGraphicType() ==
"POINT")
105 ::fwGdcmIO::container::sr::DicomSRSCoordNode::GraphicDataContainerType coordinates =
110 foundLandmark =
true;
118 this->addLandmark(x, y, z, label);
126 void Fiducial::addLandmark(
double x,
double y,
double z,
const std::string& label)
128 ::fwData::Point::sptr
point = ::fwData::Point::New(x, y, z);
131 ::fwData::PointList::sptr pointList =
136 pointList = ::fwData::PointList::New();
140 pointList->getPoints().push_back(point);
141 m_object->setField(
"ShowLandmarks", ::fwData::Boolean::New(
true));
const SubNodeContainer & getSubNodeContainer() const
Get Sub node container.
This class defines a TEXT node in a SR document.
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 represents a DICOM basic coded entry. It stores the four mains attributes : Code Value...
This class defines a SCOORD node in a SR document.
This class defines a list of points.
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.
FWGDCMIO_API Fiducial(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 DicomCodedAttribute & getCodedAttribute() const
Get Coded attribute.
const std::string & getTextValue() const
Get Text value.