@Override public void setId(String id) throws FormatException, IOException { if (id.equals(currentId)) return; super.setId(id); if (imageLocations == null) { MetadataRetrieve r = getMetadataRetrieve(); imageLocations = new String[r.getImageCount()][]; for (int i=0; i<imageLocations.length; i++) { setSeries(i); imageLocations[i] = new String[planeCount()]; } setSeries(0); } }
@Override public void setId(String id) throws FormatException, IOException { if (id.equals(currentId)) return; super.setId(id); if (imageLocations == null) { MetadataRetrieve r = getMetadataRetrieve(); imageLocations = new String[r.getImageCount()][]; for (int i=0; i<imageLocations.length; i++) { setSeries(i); imageLocations[i] = new String[planeCount()]; } setSeries(0); } }
private int planeCount() { MetadataRetrieve r = getMetadataRetrieve(); int z = r.getPixelsSizeZ(series).getValue().intValue(); int t = r.getPixelsSizeT(series).getValue().intValue(); int c = r.getChannelCount(series); String pixelType = r.getPixelsType(series).getValue(); int bytes = FormatTools.getBytesPerPixel(pixelType); if (bytes > 1 && c == 1) { c = r.getChannelSamplesPerPixel(series, 0).getValue(); } return z * c * t; }
private int planeCount() { MetadataRetrieve r = getMetadataRetrieve(); int z = r.getPixelsSizeZ(series).getValue().intValue(); int t = r.getPixelsSizeT(series).getValue().intValue(); int c = r.getChannelCount(series); String pixelType = r.getPixelsType(series).getValue(); int bytes = FormatTools.getBytesPerPixel(pixelType); if (bytes > 1 && c == 1) { c = r.getChannelSamplesPerPixel(series, 0).getValue(); } return z * c * t; }
private void setupServiceAndMetadata() throws DependencyException, ServiceException { // extract OME-XML string from metadata object MetadataRetrieve retrieve = getMetadataRetrieve(); ServiceFactory factory = new ServiceFactory(); service = factory.getInstance(OMEXMLService.class); OMEXMLMetadata originalOMEMeta = service.getOMEMetadata(retrieve); originalOMEMeta.resolveReferences(); String omexml = service.getOMEXML(originalOMEMeta); omeMeta = service.createOMEXMLMetadata(omexml); }
private void setupServiceAndMetadata() throws DependencyException, ServiceException { // extract OME-XML string from metadata object MetadataRetrieve retrieve = getMetadataRetrieve(); ServiceFactory factory = new ServiceFactory(); service = factory.getInstance(OMEXMLService.class); OMEXMLMetadata originalOMEMeta = service.getOMEMetadata(retrieve); originalOMEMeta.resolveReferences(); String omexml = service.getOMEXML(originalOMEMeta); omeMeta = service.createOMEXMLMetadata(omexml); }