From a89981b4026530e4a0f6abc0bc29b4cbf4d71a10 Mon Sep 17 00:00:00 2001 From: Christian Dietz Date: Sat, 28 Dec 2013 15:54:40 +0100 Subject: [PATCH] updated SCIFIOImageSource updated according to: https://github.com/scifio/scifio-bf-compat/issues/1 now it works with scifio 0.8.1 and all tests pass. we need to review this code whether it solves the group files issue. --- .../src/org/knime/knip/io/ScifioImgSource.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/org.knime.knip.io/src/org/knime/knip/io/ScifioImgSource.java b/org.knime.knip.io/src/org/knime/knip/io/ScifioImgSource.java index 58b97d98..68f8bdfe 100644 --- a/org.knime.knip.io/src/org/knime/knip/io/ScifioImgSource.java +++ b/org.knime.knip.io/src/org/knime/knip/io/ScifioImgSource.java @@ -48,8 +48,10 @@ */ package org.knime.knip.io; +import io.scif.Format; import io.scif.FormatException; import io.scif.Metadata; +import io.scif.Parser; import io.scif.Plane; import io.scif.Reader; import io.scif.filters.PlaneSeparator; @@ -292,11 +294,15 @@ private Reader getReader(final String imgRef) throws FormatException, IOException { if (m_reader == null || (!m_reader.getCurrentFile().equals(imgRef) && m_checkFileFormat)) { - ReaderFilter r = ScifioGateway.getSCIFIO().initializer() - .initializeReader(imgRef, true); + + + Format format = ScifioGateway.getSCIFIO().format().getFormat(imgRef, true); + ReaderFilter r = new ReaderFilter(format.createReader()); + Parser p = format.createParser(); + p.setGroupFiles(m_isGroupFiles); + r.setMetadata(p.parse(imgRef)); r.enable(PlaneSeparator.class); - r.setGroupFiles(m_isGroupFiles); if (m_reader != null && !(m_reader.getFormat().getClass().equals(r.getFormat()