for (int z = 0; z < getSizeZ(); z++) { final int index = frameIndex(sequence, z, t, s); final Frame frame = sequence.getFrame(index); if (frame == null) { warnFrame(sequence, index);
for (int z = 0; z < getSizeZ(); z++) { final int index = frameIndex(sequence, z, t, s); final Frame frame = sequence.getFrame(index); if (frame == null) { warnFrame(sequence, index);
@Test public void testParseOldXML() throws ParserConfigurationException, SAXException, IOException { final Document xml = XMLTools.parseDOM(OLD_XML); final PrairieMetadata meta = new PrairieMetadata(xml, null, null); final Value positionCurrent = meta.getSequence(1).getFrame(1).getValue("positionCurrent"); final Value xAxis = positionCurrent.get("XAxis"); assertEquals("0.95", xAxis.value()); final Value yAxis = positionCurrent.get("YAxis"); assertEquals("-4.45", yAxis.value()); final ValueTable zAxis = (ValueTable) positionCurrent.get("ZAxis"); assertEquals("-9", zAxis.get(0).value()); assertEquals("62.45", zAxis.get(1).value()); }
for (int z = 0; z < getSizeZ(); z++) { final int index = frameIndex(tSequence, z, t, s); final Frame zFrame = tSequence.getFrame(index); if (zFrame == null) { warnFrame(sequence, index);
for (int z = 0; z < getSizeZ(); z++) { final int index = frameIndex(tSequence, z, t, s); final Frame zFrame = tSequence.getFrame(index); if (zFrame == null) { warnFrame(sequence, index);
@Override public byte[] openBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException { FormatTools.checkPlaneParameters(this, no, buf.length, x, y, w, h); if (singleTiffMode) return tiff.openBytes(no, buf, x, y, w, h); // convert 1D index to (sequence, index, channel) coordinates. final int[] zct = getZCTCoords(no); final int z = zct[0], c = zct[1], t = zct[2]; final Sequence sequence = sequence(t, getSeries()); final int index = frameIndex(sequence, z, t, getSeries()); final Frame frame = sequence.getFrame(index); if (frame == null) { warnFrame(sequence, index); return blank(buf); } final int channel = channels[c]; final PFile file = frame.getFile(channel); if (file == null) { warnFile(sequence, index, channel); return blank(buf); } tiff.setId(getPath(file)); return tiff.openBytes(0, buf, x, y, w, h); }
@Override public byte[] openBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException { FormatTools.checkPlaneParameters(this, no, buf.length, x, y, w, h); if (singleTiffMode) return tiff.openBytes(no, buf, x, y, w, h); // convert 1D index to (sequence, index, channel) coordinates. final int[] zct = getZCTCoords(no); final int z = zct[0], c = zct[1], t = zct[2]; final Sequence sequence = sequence(t, getSeries()); final int index = frameIndex(sequence, z, t, getSeries()); final Frame frame = sequence.getFrame(index); if (frame == null) { warnFrame(sequence, index); return blank(buf); } final int channel = channels[c]; final PFile file = frame.getFile(channel); if (file == null) { warnFile(sequence, index, channel); return blank(buf); } tiff.setId(getPath(file)); return tiff.openBytes(0, buf, x, y, w, h); }
@Test public void testParseNewXML() throws ParserConfigurationException, SAXException, IOException { final Document xml = XMLTools.parseDOM(NEW_XML); final PrairieMetadata meta = new PrairieMetadata(xml, null, null); final ValueTable positionCurrent = (ValueTable) meta.getSequence(1).getFrame(1).getValue("positionCurrent"); final ValueTable xAxis = (ValueTable) positionCurrent.get("XAxis"); assertEquals("-621.412879412341", xAxis.value()); final ValueTable yAxis = (ValueTable) positionCurrent.get("YAxis"); assertEquals("255.652372573538", yAxis.value()); final ValueTable zAxis = (ValueTable) positionCurrent.get("ZAxis"); assertEquals("28.15", zAxis.get(0).value()); assertEquals("111.23", zAxis.get(1).value()); } }
/** * Gets the {@code Frame} at the given ({@code cycle}, {@code index}, * {@code channel}). */ public PFile getFile(final int index, final int channel) { final Frame frame = getFrame(index); if (frame == null) return null; return frame.getFile(channel); }
/** Gets the {@code Frame} at the given ({@code cycle} and {@code index}). */ public Frame getFrame(final int cycle, final int index) { final Sequence sequence = getSequence(cycle); if (sequence == null) return null; return sequence.getFrame(index); }
/** * Gets the {@code Frame} at the given ({@code cycle}, {@code index}, * {@code channel}). */ public PFile getFile(final int index, final int channel) { final Frame frame = getFrame(index); if (frame == null) return null; return frame.getFile(channel); }
/** Gets the {@code Frame} at the given ({@code cycle} and {@code index}). */ public Frame getFrame(final int cycle, final int index) { final Sequence sequence = getSequence(cycle); if (sequence == null) return null; return sequence.getFrame(index); }