public CoreMetadata clone(IFormatReader r, int coreIndex) { return new CoreMetadata(r, coreIndex); }
@Override public Object clone() throws CloneNotSupportedException { return super.clone(); }
public CoreMetadata clone(IFormatReader r, int coreIndex) { return new CoreMetadata(r, coreIndex); }
@Override public Object clone() throws CloneNotSupportedException { return super.clone(); }
public List<CoreMetadata> getSeriesList() { List<CoreMetadata> l = new ArrayList<>(); for (int i = 0; i < size(); ++i) { l.add(new CoreMetadata(get(i, 0))); } for (CoreMetadata c : l) { c.resolutionCount = 1; } return l; }
@Override public List<CoreMetadata> getCoreMetadataList() { // Only used for determining the object type. List<CoreMetadata> oldcore = reader.getCoreMetadataList(); List<CoreMetadata> newcore = new ArrayList<CoreMetadata>(); for (int s=0; s<oldcore.size(); s++) { CoreMetadata newMeta = oldcore.get(s).clone(this, s); newMeta.resolutionCount = oldcore.get(s).resolutionCount; newcore.add(newMeta); } return newcore; }
public List<CoreMetadata> getSeriesList() { List<CoreMetadata> l = new ArrayList<>(); for (int i = 0; i < size(); ++i) { l.add(new CoreMetadata(get(i, 0))); } for (CoreMetadata c : l) { c.resolutionCount = 1; } return l; }
@Override public List<CoreMetadata> getCoreMetadataList() { // Only used for determining the object type. List<CoreMetadata> oldcore = helper.getCoreMetadataList(); List<CoreMetadata> newcore = new ArrayList<CoreMetadata>(); for (int s=0; s<oldcore.size(); s++) { CoreMetadata newMeta = oldcore.get(s).clone(this, s); newMeta.resolutionCount = oldcore.get(s).resolutionCount; newcore.add(newMeta); } return newcore; }
public List<CoreMetadata> getFlattenedList() { List<CoreMetadata> l = new ArrayList<>(); int[] sizes = sizes(); for (int i = 0; i < sizes.length; ++i) { if (sizes[i] > 0) { get(i, 0).resolutionCount = sizes[i]; } for (int j = 0; j < sizes[i]; ++j) { l.add(new CoreMetadata(get(i,j))); } } return l; }
@Override public List<CoreMetadata> getCoreMetadataList() { // Only used for determining the object type. List<CoreMetadata> oldcore = helper.getCoreMetadataList(); List<CoreMetadata> newcore = new ArrayList<CoreMetadata>(); for (int s=0; s<oldcore.size(); s++) { CoreMetadata newMeta = oldcore.get(s).clone(this, s); newMeta.resolutionCount = oldcore.get(s).resolutionCount; newcore.add(newMeta); } return newcore; }
public List<CoreMetadata> getFlattenedList() { List<CoreMetadata> l = new ArrayList<>(); int[] sizes = sizes(); for (int i = 0; i < sizes.length; ++i) { if (sizes[i] > 0) { get(i, 0).resolutionCount = sizes[i]; } for (int j = 0; j < sizes[i]; ++j) { l.add(new CoreMetadata(get(i,j))); } } return l; }
@Override public List<CoreMetadata> getCoreMetadataList() { // Only used for determining the object type. List<CoreMetadata> oldcore = reader.getCoreMetadataList(); List<CoreMetadata> newcore = new ArrayList<CoreMetadata>(); for (int s=0; s<oldcore.size(); s++) { CoreMetadata newMeta = oldcore.get(s).clone(this, s); newMeta.resolutionCount = oldcore.get(s).resolutionCount; newcore.add(newMeta); } return newcore; }
final CoreMetadata info = new CoreMetadata(); info.sizeX = Integer.parseInt(args[1]); info.sizeY = Integer.parseInt(args[2]);
final CoreMetadata info = new CoreMetadata(); info.sizeX = Integer.parseInt(args[1]); info.sizeY = Integer.parseInt(args[2]);
/** * Initializes the given file (parsing header information, etc.). * Most subclasses should override this method to perform * initialization operations such as parsing metadata. * * @throws FormatException if a parsing error occurs processing the file. * @throws IOException if an I/O error occurs processing the file */ protected void initFile(String id) throws FormatException, IOException { LOGGER.debug("{}.initFile({})", this.getClass().getName(), id); if (currentId != null) { String[] s = getUsedFiles(); for (int i=0; i<s.length; i++) { if (id.equals(s[i])) return; } } coreIndex = 0; series = 0; close(); currentId = id; metadata = new Hashtable<String, Object>(); core = new ArrayList<CoreMetadata>(); CoreMetadata core0 = new CoreMetadata(); core.add(core0); core0.orderCertain = true; // reinitialize the MetadataStore // NB: critical for metadata conversion to work properly! getMetadataStore().createRoot(); }
/** * Initializes the given file (parsing header information, etc.). * Most subclasses should override this method to perform * initialization operations such as parsing metadata. * * @throws FormatException if a parsing error occurs processing the file. * @throws IOException if an I/O error occurs processing the file */ protected void initFile(String id) throws FormatException, IOException { LOGGER.debug("{}.initFile({})", this.getClass().getName(), id); if (currentId != null) { String[] s = getUsedFiles(); for (int i=0; i<s.length; i++) { if (id.equals(s[i])) return; } } coreIndex = 0; series = 0; close(); currentId = id; metadata = new Hashtable<String, Object>(); core = new ArrayList<CoreMetadata>(); CoreMetadata core0 = new CoreMetadata(); core.add(core0); core0.orderCertain = true; // reinitialize the MetadataStore // NB: critical for metadata conversion to work properly! getMetadataStore().createRoot(); }
/** * Read and store basic dimensions in model * @param store * @throws FormatException * @throws IOException */ protected void fillMetadataPass6(MetadataStore store) throws FormatException, IOException { CoreMetadata m = core.get(0); if (getSizeX() == 0) { m.sizeX = 1; } if (getSizeY() == 0) { m.sizeY = 1; } if (bpp == 1 || bpp == 3) m.pixelType = FormatTools.UINT8; else if (bpp == 2 || bpp == 6) m.pixelType = FormatTools.UINT16; if (isJPEG) m.pixelType = FormatTools.UINT8; m.bitsPerPixel = FormatTools.getBytesPerPixel(m.pixelType) * 8; m.indexed = !isRGB() && channelColors != null; // We shouldn't need to copy the coremetadata here. This // indicates a need for better ordering of the initialization, or // rather not using the size of core as the series count until // it's filled. for (int i=1; i<core.size(); i++) { core.set(i, new CoreMetadata(core.get(0))); } }
@Override public void setId(String id) throws FormatException, IOException { super.setId(id); // insert a single sub-resolution core.add(new CoreMetadata(core.get(0))); core.get(0).resolutionCount++; core.get(1).sizeX /= 2; core.get(1).sizeY /= 2; } }
/** * Read and store basic dimensions in model * @param store * @throws FormatException * @throws IOException */ protected void fillMetadataPass6(MetadataStore store) throws FormatException, IOException { CoreMetadata m = core.get(0); if (getSizeX() == 0) { m.sizeX = 1; } if (getSizeY() == 0) { m.sizeY = 1; } if (bpp == 1 || bpp == 3) m.pixelType = FormatTools.UINT8; else if (bpp == 2 || bpp == 6) m.pixelType = FormatTools.UINT16; if (isJPEG) m.pixelType = FormatTools.UINT8; m.bitsPerPixel = FormatTools.getBytesPerPixel(m.pixelType) * 8; m.indexed = !isRGB() && channelColors != null; // We shouldn't need to copy the coremetadata here. This // indicates a need for better ordering of the initialization, or // rather not using the size of core as the series count until // it's filled. for (int i=1; i<core.size(); i++) { core.set(i, new CoreMetadata(core.get(0))); } }
public void populateMetadataStore(String[] jsonData) throws FormatException, IOException { FormatTools.assertId(currentId, false, 1); currentId = "in-memory-json"; core.clear(); positions = new Vector<Position>(); for (int pos=0; pos<jsonData.length; pos++) { core.add(new CoreMetadata()); Position p = new Position(); p.metadataFile = "Position #" + (pos + 1); positions.add(p); setSeries(pos); parsePosition(jsonData[pos], pos); } setSeries(0); populateMetadata(); }