/** * Entry {@link #writeImg} method. Gathers necessary metadata, creates default * configuration options if needed, and delegates to the appropriate * intermediate {@link #writeImg} method if able. */ private Metadata writeImg(final String id, final Writer w, final SCIFIOImgPlus<?> img, final int imageIndex, SCIFIOConfig config) throws ImgIOException, IncompatibleTypeException { // Create the SCIFIOConfig if needed if (config == null) { config = new SCIFIOConfig(); } final int sliceCount = countSlices(img); if (w == null) { if (id == null || id.length() == 0) { throw new ImgIOException( "No output destination or pre-configured Writer was provided, and" + " no way to determine the desired output path. Default value:" + " ImgPlus's source."); } return writeImg(id, img, imageIndex, config, sliceCount); } return writeImg(w, id, img, imageIndex, config, sliceCount); }
/** * Entry {@link #writeImg} method. Gathers necessary metadata, creates default * configuration options if needed, and delegates to the appropriate * intermediate {@link #writeImg} method if able. */ private Metadata writeImg(final String id, final Writer w, final SCIFIOImgPlus<?> img, final int imageIndex, SCIFIOConfig config) throws ImgIOException, IncompatibleTypeException { // Create the SCIFIOConfig if needed if (config == null) { config = new SCIFIOConfig(); } final int sliceCount = countSlices(img); if (w == null) { if (id == null || id.length() == 0) { throw new ImgIOException( "No output destination or pre-configured Writer was provided, and" + " no way to determine the desired output path. Default value:" + " ImgPlus's source."); } return writeImg(id, img, imageIndex, config, sliceCount); } return writeImg(w, id, img, imageIndex, config, sliceCount); }