7 #include <dcmtk/config/osconfig.h> 9 #include "fwDicomIOFilter/composite/CTImageStorageDefaultComposite.hpp" 10 #include "fwDicomIOFilter/composite/IComposite.hpp" 11 #include "fwDicomIOFilter/custom/DefaultDicomFilter.hpp" 12 #include "fwDicomIOFilter/exceptions/FilterFailure.hpp" 13 #include "fwDicomIOFilter/registry/macros.hpp" 14 #include "fwDicomIOFilter/splitter/SOPClassUIDSplitter.hpp" 16 #include <dcmtk/dcmnet/diutil.h> 17 #include <dcmtk/dcmdata/dcfilefo.h> 18 #include <dcmtk/dcmdata/dcdeftag.h> 19 #include <dcmtk/dcmimgle/dcmimage.h> 60 const ::fwMedData::DicomSeries::sptr& series, const ::fwLog::Logger::sptr& logger)
63 DicomSeriesContainerType result;
66 ::fwDicomIOFilter::splitter::SOPClassUIDSplitter::sptr sopFilter =
67 ::fwDicomIOFilter::splitter::SOPClassUIDSplitter::New();
68 DicomSeriesContainerType seriesContainer = sopFilter->apply(series, logger);
71 for(const ::fwMedData::DicomSeries::sptr& s : seriesContainer)
73 DicomSeriesContainerType tempo;
76 ::fwMedData::DicomSeries::SOPClassUIDContainerType sopClassUIDContainer = s->getSOPClassUIDs();
77 std::string sopClassUID = sopClassUIDContainer.begin()->c_str();
78 if(sopClassUID ==
"1.2.840.10008.5.1.4.1.1.88.34")
80 sopClassUID =
"Comprehensive3DSR";
84 sopClassUID = dcmFindNameOfUID(sopClassUID.c_str());
87 ::fwDicomIOFilter::composite::IComposite::sptr filter;
90 if(sopClassUID ==
"CTImageStorage" || sopClassUID ==
"MRImageStorage" ||
91 sopClassUID ==
"SecondaryCaptureImageStorage")
93 filter = ::fwDicomIOFilter::composite::CTImageStorageDefaultComposite::New();
99 SLM_TRACE(
"Applying default filter for SOPClassUID: \""+sopClassUID+
"\".");
100 tempo = filter->forcedApply(s, logger);
104 logger->information(
"Can't apply any filter : \""+sopClassUID+
"\" SOPClassUID is not supported.");
108 for(::fwMedData::DicomSeries::sptr filteredSeries : tempo)
110 result.push_back(filteredSeries);
virtual FWDICOMIOFILTER_API DicomSeriesContainerType apply(const ::fwMedData::DicomSeries::sptr &series, const ::fwLog::Logger::sptr &logger) const override
Override.
static const std::string s_FILTER_NAME
Filter name.
fwDicomIOFilter contains filters used to pre-process images before reading.
virtual FWDICOMIOFILTER_API std::string getName() const override
Return the name of the filter.
virtual FWDICOMIOFILTER_API std::string getDescription() const override
Return the description of the filter.
Key class used to restrict access to Filter construction. See http://www.drdobbs.com/184402053.
Base class for Dicom instance custom filter.
FWDICOMIOFILTER_API DefaultDicomFilter(::fwDicomIOFilter::IFilter::Key key)
Constructor.
static const std::string s_FILTER_DESCRIPTION
Filter description.
#define SLM_TRACE(message)
virtual FWDICOMIOFILTER_API ~DefaultDicomFilter()
Destructor.