7 #include "fwDicomIOFilter/composite/IComposite.hpp" 34 const ::fwMedData::DicomSeries::sptr& series, const ::fwLog::Logger::sptr& logger)
const 36 DicomSeriesContainerType result;
37 result.push_back(series);
41 DicomSeriesContainerType filtered;
43 for(const ::fwMedData::DicomSeries::sptr& s : result)
45 DicomSeriesContainerType tempo = filter->apply(s, logger);
46 filtered.reserve(filtered.size() + tempo.size());
47 std::copy(tempo.begin(), tempo.end(), std::back_inserter(filtered));
57 const ::fwMedData::DicomSeries::sptr& series, const ::fwLog::Logger::sptr& logger)
const 59 DicomSeriesContainerType result;
60 result.push_back(series);
64 DicomSeriesContainerType filtered;
66 for(const ::fwMedData::DicomSeries::sptr& s : result)
70 DicomSeriesContainerType tempo = filter->apply(s, logger);
71 filtered.reserve(filtered.size() + tempo.size());
72 std::copy(tempo.begin(), tempo.end(), std::back_inserter(filtered));
76 OSLM_WARN(
"Unable to apply the filter \"" << filter->getName() <<
"\".");
77 filtered.push_back(s);
FWDICOMIOFILTER_API void addChild(const ::fwDicomIOFilter::IFilter::sptr &filter)
Add a filter to the composite.
FWDICOMIOFILTER_API FilterContainerType & getChildren()
Return composite container.
fwDicomIOFilter contains filters used to pre-process images before reading.
FWDICOMIOFILTER_API DicomSeriesContainerType apply(const ::fwMedData::DicomSeries::sptr &series, const ::fwLog::Logger::sptr &logger) const override
Override.
virtual FWDICOMIOFILTER_API ~IComposite()
Destructor.
FWDICOMIOFILTER_API IComposite()
Constructor.
#define OSLM_WARN(message)
FWDICOMIOFILTER_API FilterType getFilterType() const override
Return filter type.
FWDICOMIOFILTER_API DicomSeriesContainerType forcedApply(const ::fwMedData::DicomSeries::sptr &series, const ::fwLog::Logger::sptr &logger) const
Apply every filters without throwing any exceptions. If an exception is thrown, it is ignored and the...
FilterContainerType m_filterContainer
Filter container.
FilterFailure Exceptions.
FWDICOMIOFILTER_API void removeChild(const ::fwDicomIOFilter::IFilter::sptr &filter)
Remove a filter from the composite.