We're Hiring!

Migrating to OME

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

Re: Migrating to OME

Postby heg » Tue Sep 08, 2009 9:58 am

If I comment the following lines of my code

Code: Select all
        meta.setLogicalChannelIlluminationType("Epifluorescence", 0, 0);               
        meta.setLogicalChannelSamplesPerPixel(new Integer(1), 0, 0);
        meta.setLogicalChannelContrastMethod("BrightField", 0, 0);


omero.insight does not crash. (meta is an instance of MetadataStore)
heg
 
Posts: 17
Joined: Tue Sep 01, 2009 7:00 pm

Re: Migrating to OME

Postby jburel » Tue Sep 08, 2009 10:03 am

The problem has now been fixed in the next coming release.
jmarie
User avatar
jburel
Team Member
 
Posts: 348
Joined: Thu May 21, 2009 6:38 pm
Location: dundee

Re: Migrating to OME

Postby heg » Tue Sep 08, 2009 11:12 am

An additional comment. When I create an ome.tif the objective metadata in omero.insight gets correctly populated. Using the same program I creata a .ome and only the manufacturer and model gets populated.

I am using
IFormatWriter writer = new ImageWriter();

and changing the extension of the file to write.

Hope it helps.
Regards,

H
heg
 
Posts: 17
Joined: Tue Sep 01, 2009 7:00 pm

Re: Migrating to OME

Postby crueden » Fri Sep 11, 2009 4:02 pm

Hi Heg,

An additional comment. When I create an ome.tif the objective metadata in omero.insight gets correctly populated. Using the same program I creata a .ome and only the manufacturer and model gets populated.

I wrote some code to test the Objective and ObjectiveSettings population, and was unable to duplicate this issue. Everything seems to work fine when writing to either OME-XML or OME-TIFF, using the latest trunk build of Bio-Formats. Try the code below, and let me know if either out.ome or out.ome.tif get produced with missing metadata.

Or did I misunderstand your comment?

Code: Select all
import loci.formats.*;
import loci.formats.meta.*;

public class WriteObjectiveInfo {
  public static void main(String[] args) throws Exception {
    IMetadata meta = MetadataTools.createOMEXMLMetadata();
    meta.createRoot();
    int w = 10, h = 10;
    meta.setPixelsSizeX(new Integer(w), 0, 0);
    meta.setPixelsSizeY(new Integer(h), 0, 0);
    meta.setPixelsSizeZ(new Integer(1), 0, 0);
    meta.setPixelsSizeC(new Integer(1), 0, 0);
    meta.setPixelsSizeT(new Integer(1), 0, 0);
    meta.setPixelsBigEndian(Boolean.TRUE, 0, 0);
    meta.setPixelsDimensionOrder("XYZCT", 0, 0);
    meta.setPixelsPixelType(
      FormatTools.getPixelTypeString(FormatTools.UINT8), 0, 0);
    meta.setObjectiveCalibratedMagnification(new Float(10.00124f), 0, 0);
    meta.setObjectiveCorrection("UV", 0, 0);
    meta.setObjectiveImmersion("Oil", 0, 0);
    meta.setObjectiveIris(Boolean.TRUE, 0, 0);
    meta.setObjectiveLensNA(new Float(2.1f), 0, 0);
    meta.setObjectiveManufacturer("Manufacturer!", 0, 0);
    meta.setObjectiveModel("Model!", 0, 0);
    meta.setObjectiveNominalMagnification(new Integer(10), 0, 0);
    meta.setObjectiveSerialNumber("SerialNumber!", 0, 0);
    meta.setObjectiveWorkingDistance(new Float(9.2f), 0, 0);
    meta.setObjectiveSettingsCorrectionCollar(new Float(3.4f), 0);
    meta.setObjectiveSettingsMedium("Water", 0);
    String objectiveID = meta.getObjectiveID(0, 0);
    meta.setObjectiveSettingsObjective(objectiveID, 0);
    meta.setObjectiveSettingsRefractiveIndex(new Float(7.8f), 0);
    IFormatWriter writer = new ImageWriter();
    writer.setMetadataRetrieve(meta);

    byte[] bytes = new byte[w * h];
    writer.setId("out.ome");
    writer.saveBytes(bytes, true);
    writer.close();

    writer.setId("out.ome.tif");
    writer.saveBytes(bytes, true);
    writer.close();
  }
}
crueden
 
Posts: 13
Joined: Fri May 29, 2009 1:50 pm
Location: UW-Madison LOCI

Previous

Return to Developer Discussion

Who is online

Users browsing this forum: No registered users and 1 guest