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.

Migrating to OME

Postby heg » Tue Sep 01, 2009 7:35 pm

Hello,

We have a microscopy screening pipeline in place. Images are acquired by the microscope, saved in png with metadata, uploaded to a file server and scanned and the metadata dumped into a database. We are studying the possibility of migrating to OME. I have several questions:
1.- I would like to automatically upload files and their metadata to OME. What would be the suggested way of doing this?
2.- We might also migrate to OME-TIFF. Is there any available windows dll to do this?

Regards,

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

Re: Migrating to OME

Postby jmoore » Wed Sep 02, 2009 6:48 am

If I understand correctly, there are two possible solutions. You can either use OME-TIFF and automatic upload, or you could write directly to the OMERO server API.

For using OME-TIFF, you'll first want to look into bioformats. It's a Java library for reading and writing OME-XML and OME-TIFF. If a DLL is a requirement, you can look into using the new C++ version (feedback welcome!) . Then you'll need to configure OMERO.fs, or more specifically the DropBox, for automatically uploading the OME-TIFFs.

For writing directly to OMERO, you'll need to get either the omero_client.jar or build a omero_client.dll. With those you can connect to the OMERO server directly. For a tutorial on writing an omero client, see http://trac.openmicroscopy.org.uk/omero ... eroClients

Hope that helps,
~Josh

Note: For both solutions, you will need to install the OMERO server
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Migrating to OME

Postby heg » Thu Sep 03, 2009 10:32 am

Hello,

Thanks for the quick response. I am trying to write to OME-TIFF. One simple way will be to write a normal tiff with the XML in the description and convert it using ConvertToOmeTiff. However I cannot make the code to work. The error is:

ConvertToOmeTiff.java:7: cannot find symbol
symbol : class BufferedImageReader
location: package loci.formats.gui
import loci.formats.gui.BufferedImageReader;


Any ideas?

Additionally, I would like to write OME-TIFF in Matlab. However, the following simple code does not work.

Code: Select all
im = uint16(repmat( 1:256, 256,1));
writer = loci.formats.out.TiffWriter();
rr = loci.formats.MetadataTools.createOMEXMLMetadata();
rr.createRoot();
imj = im2java2d(im);
writer.setMetadataRetrieve(rr);
writer.setId('test.ome.tif');
writer.saveImage(imj, 1);
writer.close;


loci.formats.FormatException: BigEndian #0 is null
at loci.formats.MetadataTools.verifyMinimumPopulated(MetadataTools.java:317)
at loci.formats.out.TiffWriter.saveBytes(TiffWriter.java:111)
at loci.formats.out.TiffWriter.saveBytes(TiffWriter.java:190)
at loci.formats.out.OMETiffWriter.saveBytes(OMETiffWriter.java:171)
at loci.formats.FormatWriter.saveImage(FormatWriter.java:130)
at loci.formats.FormatWriter.saveImage(FormatWriter.java:95)



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

Re: Migrating to OME

Postby cxallan » Thu Sep 03, 2009 11:04 am

From loci.formats.MetadataTools:

Code: Select all
  /**
   * Checks whether the given metadata object has the minimum metadata
   * populated to successfully describe the nth Image.
   *
   * @throws FormatException if there is a missing metadata field,
   *   or the metadata object is uninitialized
   */
  public static void verifyMinimumPopulated(MetadataRetrieve src, int n)
    throws FormatException
  {
    if (src == null) {
      throw new FormatException("Metadata object is null; " +
          "call IFormatWriter.setMetadataRetrieve() first");
    }
    MetadataStore store = asStore(src);
    if (store != null && store.getRoot() == null) {
      throw new FormatException("Metadata object has null root; " +
        "call IMetadata.createRoot() first");
    }
    if (src.getPixelsBigEndian(n, 0) == null) {
      throw new FormatException("BigEndian #" + n + " is null");
    }
    if (src.getPixelsDimensionOrder(n, 0) == null) {
      throw new FormatException("DimensionOrder #" + n + " is null");
    }
    if (src.getPixelsPixelType(n, 0) == null) {
      throw new FormatException("PixelType #" + n + " is null");
    }
    if (src.getPixelsSizeC(n, 0) == null) {
      throw new FormatException("SizeC #" + n + " is null");
    }
    if (src.getPixelsSizeT(n, 0) == null) {
      throw new FormatException("SizeT #" + n + " is null");
    }
    if (src.getPixelsSizeX(n, 0) == null) {
      throw new FormatException("SizeX #" + n + " is null");
    }
    if (src.getPixelsSizeY(n, 0) == null) {
      throw new FormatException("SizeY #" + n + " is null");
    }
    if (src.getPixelsSizeZ(n, 0) == null) {
      throw new FormatException("SizeZ #" + n + " is null");
    }
    if (src.getLogicalChannelSamplesPerPixel(n, 0) == null) {
      throw new FormatException("SamplesPerPixel #" + n + " is null");
    }
  }


So, as a minimum you must populate:
  • sizeX
  • sizeY
  • sizeC
  • sizeZ
  • sizeT
  • pixelType
  • dimensionOrder
  • bigEndian
  • samplePerPixel

You can see what this minimum specification looks like here:

http://www.ome-xml.org/wiki/MinimumSpecification
cxallan
Site Admin
 
Posts: 509
Joined: Fri May 01, 2009 8:07 am

Re: Migrating to OME

Postby mlinkert » Thu Sep 03, 2009 1:27 pm

heg wrote:Hello,

One simple way will be to write a normal tiff with the XML in the description and convert it using ConvertToOmeTiff. However I cannot make the code to work. The error is:

ConvertToOmeTiff.java:7: cannot find symbol
symbol : class BufferedImageReader
location: package loci.formats.gui
import loci.formats.gui.BufferedImageReader;


Any ideas?



The ConvertToOmeTiff example that is posted on the LOCI website (http://loci.wisc.edu/ome/ome-tiff-code.html#convert) requires that you use a trunk or daily build of Bio-Formats. I apologize if this was not clear from the website.

heg wrote:
Additionally, I would like to write OME-TIFF in Matlab. However, the following simple code does not work.

Code: Select all
im = uint16(repmat( 1:256, 256,1));
writer = loci.formats.out.TiffWriter();
rr = loci.formats.MetadataTools.createOMEXMLMetadata();
rr.createRoot();
imj = im2java2d(im);
writer.setMetadataRetrieve(rr);
writer.setId('test.ome.tif');
writer.saveImage(imj, 1);
writer.close;


loci.formats.FormatException: BigEndian #0 is null
at loci.formats.MetadataTools.verifyMinimumPopulated(MetadataTools.java:317)
at loci.formats.out.TiffWriter.saveBytes(TiffWriter.java:111)
at loci.formats.out.TiffWriter.saveBytes(TiffWriter.java:190)
at loci.formats.out.OMETiffWriter.saveBytes(OMETiffWriter.java:171)
at loci.formats.FormatWriter.saveImage(FormatWriter.java:130)
at loci.formats.FormatWriter.saveImage(FormatWriter.java:95)




As Chris mentioned, there is a minimum amount of OME-XML metadata that you must populate. An example of how to populate this metadata is available at:

https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/utils/MinimumWriter.java

Hope that helps,
-Melissa
User avatar
mlinkert
Team Member
 
Posts: 353
Joined: Fri May 29, 2009 2:12 pm
Location: Southwest Wisconsin

Re: Migrating to OME

Postby heg » Mon Sep 07, 2009 6:58 am

Thanks for all the support. I have in place a program to write in OME-TIFF. I am now trying to fill all relevant metadata. I have a question related to the Experimenter part (ID, Name, Last Name, etc). Is any of this fields (such as the id) linked to profiles existing in my omero Server installation or this values are completely unrelated?

Regards,

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

Re: Migrating to OME

Postby cxallan » Mon Sep 07, 2009 11:32 am

heg wrote:Thanks for all the support. I have in place a program to write in OME-TIFF. I am now trying to fill all relevant metadata. I have a question related to the Experimenter part (ID, Name, Last Name, etc). Is any of this fields (such as the id) linked to profiles existing in my omero Server installation or this values are completely unrelated?

Regards,

H


For the obvious security reasons, as far as import is concerned, OMERO ignores experimenter details placed in an OME-TIFF or OME-XML file. All metadata present in an imported OME-TIFF or OME-XML becomes "linked" to the user who initiated the import.
cxallan
Site Admin
 
Posts: 509
Joined: Fri May 01, 2009 8:07 am

Re: Migrating to OME

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

I am having problems to create a properly formatted metadata. I am using the set methods of MetadataStore. As soon as I start to add information about the channels I get the following error message in omero.insight when I try to display the metadata. Afterwards the omero.insight crashes.

omero.UnloadedEntityException: Object unloaded:omero.model.IlluminationI@210563
at omero.model.IlluminationI.errorIfUnloaded(IlluminationI.java:18)
at omero.model.IlluminationI.getValue(IlluminationI.java:124)
at omero.model.Illumination.getValue(Illumination.java:81)
at pojos.ChannelData.getIllumination(ChannelData.java:249)


is there any demo (like MinimumWritter) to write a random multi channel image with full metadata?

Regards,

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

Re: Migrating to OME

Postby jburel » Tue Sep 08, 2009 9:40 am

Which version of insight are you using?
Beta 4.0.3?

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 9:43 am

omero.insight 4.0.3
and loci_tools.jar daily build.
heg
 
Posts: 17
Joined: Tue Sep 01, 2009 7:00 pm

Next

Return to Developer Discussion

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron