[ome-devel] adding woolz to bioformats

Melissa Linkert melissa at glencoesoftware.com
Tue Aug 27 22:24:06 BST 2013


Hi Bill,

> Thanks for all your help. I've just pushed my changes for Woolz
> (, WlzIIPSrv) and bioformats out to github.
> 
> I know that you can find the changes from git but this brief
> summary is partly for us here:
> 
> add dir components/bio-formats/src/loci/formats/out
> 
> add components/bio-formats/src/loci/formats/in/WlzReader.java
> add components/bio-formats/src/loci/formats/out/WlzWriter.java
> add components/bio-formats/src/loci/formats/services/WlzService.java
> add components/bio-formats/src/loci/formats/services/WlzServiceImpl.java
> 
> mod components/scifio/src/loci/formats/readers.txt
> mod components/bio-formats/build.properties
> mod components/bio-formats/pom.xml b/components/bio-formats/pom.xml
> mod components/loci-legacy/src/loci/common/services/services.properties
> mod components/scifio/src/loci/formats/writers.txt
> 
> With this we can now read/write 2 and 3D Woolz objects which
> correspond to images (WLZ_2D_DOMAINOBJ and WLZ_3D_DOMAINOBJ).
> The origin is preserved but spatial domains become rectangular.
> Domains without (image) values become unsigned byte images with
> image values 0 (outside domain) and 255 (inside domain).
> Background values are not preserved, compound and all other
> object types are unsupported.
> 
> All in https://github.com/ma-tech/bioformats/tree/develop-bill
> and locally as git at mahost:bioformats.git

That all sounds great.  If you're ready for that to be included in the
official Bio-Formats repository, then feel free to open a pull request
against the develop branch of openmicroscopy/bioformats.  Your changes
can then be included in all of our automated testing, and once we're
sure that everything passes it can be included in the develop branch
(and thus the next release in the 5.x.x line).

Regards,
-Melissa

On Mon, Aug 26, 2013 at 06:14:01PM +0100, Bill Hill wrote:
> Melissa,
> 
> Thanks for all your help. I've just pushed my changes for Woolz
> (, WlzIIPSrv) and bioformats out to github.
> 
> I know that you can find the changes from git but this brief
> summary is partly for us here:
> 
> add dir components/bio-formats/src/loci/formats/out
> 
> add components/bio-formats/src/loci/formats/in/WlzReader.java
> add components/bio-formats/src/loci/formats/out/WlzWriter.java
> add components/bio-formats/src/loci/formats/services/WlzService.java
> add components/bio-formats/src/loci/formats/services/WlzServiceImpl.java
> 
> mod components/scifio/src/loci/formats/readers.txt
> mod components/bio-formats/build.properties
> mod components/bio-formats/pom.xml b/components/bio-formats/pom.xml
> mod components/loci-legacy/src/loci/common/services/services.properties
> mod components/scifio/src/loci/formats/writers.txt
> 
> With this we can now read/write 2 and 3D Woolz objects which
> correspond to images (WLZ_2D_DOMAINOBJ and WLZ_3D_DOMAINOBJ).
> The origin is preserved but spatial domains become rectangular.
> Domains without (image) values become unsigned byte images with
> image values 0 (outside domain) and 255 (inside domain).
> Background values are not preserved, compound and all other
> object types are unsupported.
> 
> All in https://github.com/ma-tech/bioformats/tree/develop-bill
> and locally as git at mahost:bioformats.git
> 
> At some point soon I'll add dynamic libs for something other than
> just recent 64 bit Linux's with libc.so.6.
> 
> Cheers,
> Bill
> 
> >Hi Bill,
> >
> >
> >On Thu, Aug 22, 2013 at 4:38 AM, Bill Hill <Bill.Hill at igmm.ed.ac.uk
> ><mailto:Bill.Hill at igmm.ed.ac.uk>> wrote:
> >
> >    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?
> >
> >
> >The stage label retrieval methods are analogous to the saving methods,
> >so something like this should work:
> >
> >String stageLabelName = meta.getStageLabelName(0);
> >Double stageLabelX = meta.getStageLabelX(0);
> >Double stageLabelY = meta.getStageLabelY(0);
> >Double stageLabelZ = meta.getStageLabelZ(0);
> >
> >    *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?
> >
> >
> >I can't think of a good place to put that at the moment - most likely
> >we'd need to add that to the schema.
> >
> >    *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
> >    <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 <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
> >
> >
> >I would override the 'checkClassDependency(Class)' method in
> >AbstractService and have it throw MissingLibraryException, as you are
> >now.  checkClassDependency can then be called from the constructor
> >and/or open methods in your WlzServiceImpl (see for example
> >loci.formats.service.OMEXMLServiceImpl).
> >
> >Regards,
> >-Melissa
> >
> >
> >
> >    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
> >    <mailto:Bill.Hill at igmm.ed.ac.uk>
> >    Western General Hospital               : +44-131-3322471x2119
> >    <tel:%2B44-131-3322471x2119>
> >    Crewe Road, Edinburgh EH4 2XU, UK.     : +44-131-4678456
> >    <tel:%2B44-131-4678456>
> >
> >    The University of Edinburgh is a charitable body, registered in
> >    Scotland, with registration number SC005336.
> >
> >    _________________________________________________
> >    ome-devel mailing list
> >    ome-devel at lists.__openmicroscopy.org.uk
> >    <mailto:ome-devel at lists.openmicroscopy.org.uk>
> >    http://lists.openmicroscopy.__org.uk/mailman/listinfo/ome-__devel
> >    <http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel>
> >
> >
> 
> -- 
> 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.
> 
> _______________________________________________
> ome-devel mailing list
> ome-devel at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel


More information about the ome-devel mailing list