7 #include "fwDicomIOFilter/composite/IComposite.hpp" 9 #include "fwDicomIOFilter/helper/Filter.hpp" 17 bool Filter::applyFilter(DicomSeriesContainerType& dicomSeriesContainer, ::fwDicomIOFilter::IFilter::sptr filter,
18 bool forcedApply, const ::fwLog::Logger::sptr& logger)
20 bool ignoredError =
false;
21 DicomSeriesContainerType result;
24 for(const ::fwMedData::DicomSeries::sptr& dicomSeries : dicomSeriesContainer)
27 DicomSeriesContainerType tempo;
33 tempo = filter->apply(dicomSeries, logger);
44 tempo.push_back(dicomSeries);
51 ::fwDicomIOFilter::composite::IComposite::sptr composite =
52 ::fwDicomIOFilter::composite::IComposite::dynamicCast(filter);
53 tempo = composite->forcedApply(dicomSeries, logger);
55 result.reserve(result.size() + tempo.size());
56 std::copy(tempo.begin(), tempo.end(), std::back_inserter(result));
60 dicomSeriesContainer = result;
fwDicomIOFilter contains filters used to pre-process images before reading.
static FWDICOMIOFILTER_API bool applyFilter(DicomSeriesContainerType &dicomSeriesContainer,::fwDicomIOFilter::IFilter::sptr filter, bool forcedApply=false, const ::fwLog::Logger::sptr &logger=::fwLog::Logger::New())
Apply a filter to the DicomSeries.
FilterFailure Exceptions.