[ome-devel] adding woolz to bioformats

Bill Hill Bill.Hill at igmm.ed.ac.uk
Thu Aug 22 09:38:47 BST 2013


Many thanks for all your help. I now have a Woolz reader/writer
written which has all the Woolz stuff encapsulated in a service
using a service factory. I've a few small bits to tidy up before
I push it out my branch to an external git repository.

*Q* I've not been able to find an example of reading a specific
stage label, which following discussions here I'm using to record
the origin of the Woolz object. I'm using this code to save the
origin in WlzWriter.java:

       CoreMetadata md = core.get(0);
       MetadataStore store = makeFilterMetadata();
       md.rgb = wlz.isRGB();
       ...
       store.setStageLabelName("WoolzOrigin", 0);
       store.setStageLabelX((double )(wlz.getOrgX()), 0);
       store.setStageLabelY((double )(wlz.getOrgY()), 0);
       store.setStageLabelZ((double )(wlz.getOrgZ()), 0);
       MetadataTools.populatePixels(store, this);

In WlzReader.java I have:

       MetadataRetrieve meta = getMetadataRetrieve();
       MetadataTools.verifyMinimumPopulated(meta, series);
       wlz.open(id, "w");
       int oX = 0; // HACK TODO use WoolzOrigin
       int oY = 0; // HACK TODO use WoolzOrigin
       int oZ = 0; // HACK TODO use WoolzOrigin
       int nX = meta.getPixelsSizeX(series).getValue().intValue();
       ...
       if(meta.getPixelsPhysicalSizeX(0) != null) {
         vX = meta.getPixelsPhysicalSizeX(0).getValue();
       }
       ...
       int gType = FormatTools.pixelTypeFromString(
                   meta.getPixelsType(series).toString());
       wlz.setupWrite(oX, oY, oZ, nX, nY, nZ, nC, nT, vX, vY, vZ, gType);

Is there example code anywhere of reading a specific stage label?

*Q* I'd like to save the Woolz object's background value, ie the image
value assumed to hold for the rest of the universe outside of the
Woolz object's domain. Any suggestions on the appropriate metadata
options for this?

*Q* How should the service fail when there's no native library?
At the moment I have:

   bill at bill-lt% ./tools/showinf qwe.wlz
   ...
   Checking file format [Woolz]
   Initializing reader
   WlzReader initializing qwe.wlz
   Exception in thread "main" loci.formats.MissingLibraryException:
   Woolz is required to read and write Woolz objects.
   Please obtain the necessary JAR and native library files from:
 
http://www.emouseatlas.org/emap/analysis_tools_resources/software/woolz.html.
   The source code for these is also available from:
   https://github.com/ma-tech/Woolz.
         at
   loci.formats.services.WlzServiceImpl.open(WlzServiceImpl.java:126)
         at loci.formats.in.WlzReader.initFile(WlzReader.java:111)
         at loci.formats.FormatReader.setId(FormatReader.java:1333)
         at loci.formats.ImageReader.setId(ImageReader.java:762)
         at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:564)
         at loci.formats.tools.ImageInfo.testRead(ImageInfo.java:1017)
         at loci.formats.tools.ImageInfo.main(ImageInfo.java:1062)
    Caused by: java.lang.UnsatisfiedLinkError: no JWlz in java.library.path
         at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734)
         at java.lang.Runtime.loadLibrary0(Runtime.java:823)
         at java.lang.System.loadLibrary(System.java:1028)
         at uk.ac.mrc.hgu.Wlz.WlzBase.<clinit>(WlzBase.java:46)
         at
   loci.formats.services.WlzServiceImpl.open(WlzServiceImpl.java:122)
         ... 6 more

Cheers,
Bill
-- 
Bill Hill                              : http://www.hgu.mrc.ac.uk
MRC Human Genetics Unit                : http://www.emouseatlas.org
MRC IGMM, University of Edinburgh      : Bill.Hill at igmm.ed.ac.uk
Western General Hospital               : +44-131-3322471x2119
Crewe Road, Edinburgh EH4 2XU, UK.     : +44-131-4678456

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



More information about the ome-devel mailing list