private SCIFIO scifio() { if (scifio == null) scifio = new SCIFIO(getContext()); return scifio; } }
/** * see isCompressible(ImgPlus) */ @Override public <T extends RealType<T> & NativeType<T>> boolean isCompressible( final Img<T> img) { return isCompressible(ImgPlus.wrap(img)); }
@Override public long[] getConstrainedLengths(final Metadata m, final int imageIndex, final SCIFIOConfig config) { final long[] lengths = getDimLengths(m, imageIndex, config); final ImageRegion r = config.imgOpenerGetRegion(); if (r != null) { // set each dimension length = the number of entries for that axis for (final CalibratedAxis t : m.get(0).getAxes()) { final Range range = r.getRange(t.type()); if (range != null) lengths[m.get(0).getAxisIndex(t)] = range.size(); } } return lengths; }
/** * @param source - the location of the dataset to assess * @return The number of images in the specified dataset. */ @Override public int getImageCount(final String source) throws ImgIOException { try { final Format format = scifio().format().getFormat(source); return format.createParser().parse(source).getImageCount(); } catch (final FormatException e) { throw new ImgIOException(e); } catch (final IOException e) { throw new ImgIOException(e); } }
final String dimOrder = guessDimOrder(axes, oldLengths, axisLengths);
@Override public long[] getConstrainedLengths(final Metadata m, final int imageIndex, final SCIFIOConfig config) { final long[] lengths = getDimLengths(m, imageIndex, config); final ImageRegion r = config.imgOpenerGetRegion(); if (r != null) { // set each dimension length = the number of entries for that axis for (final CalibratedAxis t : m.get(0).getAxes()) { final Range range = r.getRange(t.type()); if (range != null) lengths[m.get(0).getAxisIndex(t)] = range.size(); } } return lengths; }
/** * @param source - the location of the dataset to assess * @return The number of images in the specified dataset. */ @Override public int getImageCount(final String source) throws ImgIOException { try { final Format format = scifio().format().getFormat(source); return format.createParser().parse(source).getImageCount(); } catch (final FormatException e) { throw new ImgIOException(e); } catch (final IOException e) { throw new ImgIOException(e); } }
final String dimOrder = guessDimOrder(axes, oldLengths, axisLengths);
private SCIFIO scifio() { if (scifio == null) scifio = new SCIFIO(getContext()); return scifio; } }
/** * see isCompressible(ImgPlus) */ @Override public <T extends RealType<T> & NativeType<T>> boolean isCompressible( final Img<T> img) { return isCompressible(ImgPlus.wrap(img)); }