protected void initImage() throws IOException, FormatException { ; try (RandomAccessInputStream ras = new RandomAccessInputStream(currentId); DataInputStream dis = new DataInputStream(ras)) { img = ImageIO.read(dis); } if (img == null) throw new FormatException("Invalid image stream"); }
String s = strLine; List<String> myList = Arrays.asList(s.split(" ")); List<Integer> intList = new ArrayList<>(); for (int i=0;i<myList.size();i++) { //Check if all the values are integers try { /*Problem area----->*/ intList.add(Integer.parseInt( (String) myList.get(i))); } catch (Exception e) { throw new FormatException(); } }
@Override protected void initFile(String id) throws FormatException, IOException { super.initFile(id); in = new RandomAccessInputStream(id); in.order(false); throw new FormatException("Invalid MNG file."); seriesInfo.get(0).offsets.add(fp - 8); seriesInfo.get(0).offsets.add(fp); seriesInfo.get(0).lengths.add(fp + len + 4); throw new FormatException("Pixel data not found."); MetadataTools.populatePixels(store, this); for (int i=0; i<getSeriesCount(); i++) { store.setImageName("Series " + (i + 1), i);
headerFile = id.substring(0, id.lastIndexOf(".")) + ".HDR"; if (!new Location(headerFile).exists()) { throw new FormatException("Could not find matching .hdr file."); String date = null; CoreMetadata m = core.get(0); MetadataTools.populatePixels(store, this, !minimumMetadata);
id = base + ".pcoraw"; if (!new Location(id).exists()) { throw new FormatException("Could not find image file."); metadata = reader.getGlobalMetadata(); in = new RandomAccessInputStream(id); try { if (in.length() >= Math.pow(2, 32)) { MetadataTools.populatePixels(store, this, true);
throw new FormatException("Could not find 'SemImageFile' table."); MetadataTools.populatePixels(store, this, getMetadataOptions().getMetadataLevel() != MetadataLevel.MINIMUM);
@Override protected void initFile(String id) throws FormatException, IOException { super.initFile(id); in = new RandomAccessInputStream(id); in.order(false); throw new FormatException("Invalid MNG file."); seriesInfo.get(0).offsets.add(fp - 8); seriesInfo.get(0).offsets.add(fp); seriesInfo.get(0).lengths.add(fp + len + 4); throw new FormatException("Pixel data not found."); MetadataTools.populatePixels(store, this); for (int i=0; i<getSeriesCount(); i++) { store.setImageName("Series " + (i + 1), i);
private void populatePixelType(int dataType) throws FormatException { CoreMetadata m = core.get(0); m.sizeC = 4; default: throw new FormatException("Unsupported data type: " + dataType);
headerFile = id.substring(0, id.lastIndexOf(".")) + ".HDR"; if (!new Location(headerFile).exists()) { throw new FormatException("Could not find matching .hdr file."); String date = null; CoreMetadata m = core.get(0); MetadataTools.populatePixels(store, this, !minimumMetadata);
protected void initImage() throws IOException, FormatException { ; try (RandomAccessInputStream ras = new RandomAccessInputStream(currentId); DataInputStream dis = new DataInputStream(ras)) { img = ImageIO.read(dis); } if (img == null) throw new FormatException("Invalid image stream"); }
id = base + ".pcoraw"; if (!new Location(id).exists()) { throw new FormatException("Could not find image file."); metadata = reader.getGlobalMetadata(); in = new RandomAccessInputStream(id); try { if (in.length() >= Math.pow(2, 32)) { MetadataTools.populatePixels(store, this, true);
throw new FormatException("Could not find 'SemImageFile' table."); MetadataTools.populatePixels(store, this, getMetadataOptions().getMetadataLevel() != MetadataLevel.MINIMUM);
@Override protected void initFile(String id) throws FormatException, IOException { super.initFile(id); in = new RandomAccessInputStream(id); CoreMetadata m = core.get(0); throw new FormatException("Unsupported FITS file."); MetadataTools.populatePixels(store, this);
private void populatePixelType(int dataType) throws FormatException { CoreMetadata m = core.get(0); m.sizeC = 4; default: throw new FormatException("Unsupported data type: " + dataType);
protected void initFile(String id) throws FormatException, IOException { super.initFile(id); CoreMetadata m = core.get(0); throw new FormatException("No image data found"); throw new FormatException("Could not retrieve image data", e); MetadataTools.populatePixels(store, this);
protected void readFile(String path) throws FormatException { try { readFile(new RandomAccessInputStream(path)); } catch (IOException e) { throw new FormatException("read error: " + path); } }
super.initFile(id); in = new RandomAccessInputStream(id); in.setEncoding("ASCII"); binData = new ArrayList<BinData>(); try (RandomAccessInputStream s = new RandomAccessInputStream(id)) { XMLTools.parseXML(s, handler); throw new FormatException("Malformed OME-XML", e); throw new FormatException(se); Integer c = omexmlMeta.getPixelsSizeC(i).getValue(); if (w == null || h == null || t == null || z == null | c == null) { throw new FormatException("Image dimensions not found"); MetadataTools.populatePixels(store, this, false, false);
@Override protected void initFile(String id) throws FormatException, IOException { super.initFile(id); in = new RandomAccessInputStream(id); CoreMetadata m = core.get(0); throw new FormatException("Unsupported FITS file."); MetadataTools.populatePixels(store, this);
offset = 0; for (int i=0; i<result.length; i++) { int percent = percentOffsets.get(i).intValue(); if (!string.regionMatches(offset, pattern, patternOffset, percent - patternOffset)) throw new FormatException("String '" + string + "' does not match format '" + pattern + "'"); !string.regionMatches(offset, pattern, patternOffset, remaining)) throw new FormatException("String '" + string + "' does not match format '" + pattern + "'");
throw new FormatException( "Unsupported handle type" + ira.getClass().getName()); throw new FormatException(exc); throw new FormatException("Invalid page count: " + numPages); if (img == null) throw new FormatException("Invalid image stream"); CoreMetadata m = core.get(0); MetadataTools.populatePixels(store, this);