7 #include "fwGdcmIO/writer/iod/SurfaceSegmentationIOD.hpp" 9 #include "fwGdcmIO/exception/Failed.hpp" 10 #include "fwGdcmIO/helper/FileWriter.hpp" 11 #include "fwGdcmIO/writer/ie/Equipment.hpp" 12 #include "fwGdcmIO/writer/ie/FrameOfReference.hpp" 13 #include "fwGdcmIO/writer/ie/Patient.hpp" 14 #include "fwGdcmIO/writer/ie/Series.hpp" 15 #include "fwGdcmIO/writer/ie/Study.hpp" 16 #include "fwGdcmIO/writer/ie/Surface.hpp" 20 #include <fwMedData/Equipment.hpp> 21 #include <fwMedData/ModelSeries.hpp> 22 #include <fwMedData/Patient.hpp> 23 #include <fwMedData/Study.hpp> 25 #include <fwRuntime/operations.hpp> 27 #include <boost/make_shared.hpp> 29 #include <gdcmSurfaceWriter.h> 42 const ::boost::filesystem::path& destinationPath,
43 const ::fwLog::Logger::sptr& logger,
44 ProgressCallback progress,
45 CancelRequestedCallback cancel) :
47 m_imageInstance(imageInstance)
62 ::fwMedData::ModelSeries::csptr modelSeries = ::fwMedData::ModelSeries::dynamicCast(series);
63 SLM_ASSERT(
"Image series should not be null.", modelSeries);
66 SPTR(::gdcm::SurfaceWriter) writer = std::make_shared< ::gdcm::SurfaceWriter >();
78 const ::boost::filesystem::path filepath = ::fwRuntime::getLibraryResourceFilePath(
79 "fwGdcmIO-" FWGDCMIO_VER
"/SegmentedPropertyRegistry.csv");
81 if(!surfaceIE.loadSegmentedPropertyRegistry(filepath))
83 throw ::fwGdcmIO::exception::Failed(
"Unable to load segmented property registry: '" +
84 filepath.string() +
"'. File does not exist.");
88 patientIE.writePatientModule();
91 studyIE.writeGeneralStudyModule();
94 studyIE.writePatientStudyModule();
97 seriesIE.writeGeneralSeriesModule();
100 seriesIE.writeSegmentationSeriesModule();
106 equipmentIE.writeGeneralEquipmentModule();
109 equipmentIE.writeEnhancedGeneralEquipmentModule();
112 surfaceIE.writeSOPCommonModule();
116 surfaceIE.writeSurfaceSegmentationAndSurfaceMeshModules();
Frame Of Reference Information Entity class.
Equipment Information Entity class.
Surface Information Entity class.
virtual FWGDCMIO_API ~SurfaceSegmentationIOD()
Destructor.
virtual FWGDCMIO_API void writeFrameOfReferenceModule()
Write Frame of Reference Module tags.
This class defines a DICOM SOP instance. It is useful during the whole writing process. This class allows to share data between module writers.
virtual FWGDCMIO_API void write(const ::fwMedData::Series::csptr &series) override
Write DICOM file.
Series Information Entity class.
The namespace fwGdcmIO contains reader, writer and helper for dicom data.
Patient Information Entity class.
Study Information Entity class.
#define SLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...
static FWGDCMIO_API void write(const ::boost::filesystem::path &filename, const std::shared_ptr< ::gdcm::Writer > &writer)
Write a file from the dataset.
std::shared_ptr< ::fwGdcmIO::container::DicomInstance > m_imageInstance
Image instance.
FWGDCMIO_API SurfaceSegmentationIOD(const std::shared_ptr< ::fwGdcmIO::container::DicomInstance > &instance, const std::shared_ptr< ::fwGdcmIO::container::DicomInstance > &imageInstance, const ::boost::filesystem::path &destinationPath, const ::fwLog::Logger::sptr &logger=::fwLog::Logger::New(), ProgressCallback progress=nullptr, CancelRequestedCallback cancel=nullptr)
Constructor.
This file defines SpyLog macros. These macros are used to log messages to a file or to the console du...