<div dir="ltr">Hi Bill,<div><br></div><div><br></div><div class="gmail_extra"><div class="gmail_quote">On Thu, Aug 22, 2013 at 4:38 AM, Bill Hill <span dir="ltr"><<a href="mailto:Bill.Hill@igmm.ed.ac.uk" target="_blank">Bill.Hill@igmm.ed.ac.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Many thanks for all your help. I now have a Woolz reader/writer<br>
written which has all the Woolz stuff encapsulated in a service<br>
using a service factory. I've a few small bits to tidy up before<br>
I push it out my branch to an external git repository.<br>
<br>
*Q* I've not been able to find an example of reading a specific<br>
stage label, which following discussions here I'm using to record<br>
the origin of the Woolz object. I'm using this code to save the<br>
origin in WlzWriter.java:<br>
<br>
CoreMetadata md = core.get(0);<br>
MetadataStore store = makeFilterMetadata();<br>
md.rgb = wlz.isRGB();<br>
...<br>
store.setStageLabelName("<u></u>WoolzOrigin", 0);<br>
store.setStageLabelX((double )(wlz.getOrgX()), 0);<br>
store.setStageLabelY((double )(wlz.getOrgY()), 0);<br>
store.setStageLabelZ((double )(wlz.getOrgZ()), 0);<br>
MetadataTools.populatePixels(<u></u>store, this);<br>
<br>
In WlzReader.java I have:<br>
<br>
MetadataRetrieve meta = getMetadataRetrieve();<br>
MetadataTools.<u></u>verifyMinimumPopulated(meta, series);<br>
wlz.open(id, "w");<br>
int oX = 0; // HACK TODO use WoolzOrigin<br>
int oY = 0; // HACK TODO use WoolzOrigin<br>
int oZ = 0; // HACK TODO use WoolzOrigin<br>
int nX = meta.getPixelsSizeX(series).<u></u>getValue().intValue();<br>
...<br>
if(meta.<u></u>getPixelsPhysicalSizeX(0) != null) {<br>
vX = meta.getPixelsPhysicalSizeX(0)<u></u>.getValue();<br>
}<br>
...<br>
int gType = FormatTools.<u></u>pixelTypeFromString(<br>
meta.getPixelsType(series).<u></u>toString());<br>
wlz.setupWrite(oX, oY, oZ, nX, nY, nZ, nC, nT, vX, vY, vZ, gType);<br>
<br>
Is there example code anywhere of reading a specific stage label?<br>
<br></blockquote><div><br></div><div>The stage label retrieval methods are analogous to the saving methods, so something like this should work:</div><div><br></div><div>String stageLabelName = meta.getStageLabelName(0);</div>
<div>Double stageLabelX = meta.getStageLabelX(0);</div><div>Double stageLabelY = meta.getStageLabelY(0);</div><div>Double stageLabelZ = meta.getStageLabelZ(0);</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
*Q* I'd like to save the Woolz object's background value, ie the image<br>
value assumed to hold for the rest of the universe outside of the<br>
Woolz object's domain. Any suggestions on the appropriate metadata<br>
options for this?<br>
<br></blockquote><div><br></div><div>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.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
*Q* How should the service fail when there's no native library?<br>
At the moment I have:<br>
<br>
bill@bill-lt% ./tools/showinf qwe.wlz<br>
...<div class="im"><br>
Checking file format [Woolz]<br>
Initializing reader<br></div>
WlzReader initializing qwe.wlz<br>
Exception in thread "main" loci.formats.<u></u>MissingLibraryException:<br>
Woolz is required to read and write Woolz objects.<br>
Please obtain the necessary JAR and native library files from:<br>
<br>
<a href="http://www.emouseatlas.org/emap/analysis_tools_resources/software/woolz.html" target="_blank">http://www.emouseatlas.org/<u></u>emap/analysis_tools_resources/<u></u>software/woolz.html</a>.<br>
The source code for these is also available from:<br>
<a href="https://github.com/ma-tech/Woolz" target="_blank">https://github.com/ma-tech/<u></u>Woolz</a>.<br>
at<br>
loci.formats.services.<u></u>WlzServiceImpl.open(<u></u>WlzServiceImpl.java:126)<br>
at loci.formats.in.WlzReader.<u></u>initFile(WlzReader.java:111)<br>
at loci.formats.FormatReader.<u></u>setId(FormatReader.java:1333)<br>
at loci.formats.ImageReader.<u></u>setId(ImageReader.java:762)<br>
at loci.formats.ReaderWrapper.<u></u>setId(ReaderWrapper.java:564)<br>
at loci.formats.tools.ImageInfo.<u></u>testRead(ImageInfo.java:1017)<br>
at loci.formats.tools.ImageInfo.<u></u>main(ImageInfo.java:1062)<br>
Caused by: java.lang.<u></u>UnsatisfiedLinkError: no JWlz in java.library.path<br>
at java.lang.ClassLoader.<u></u>loadLibrary(ClassLoader.java:<u></u>1734)<br>
at java.lang.Runtime.<u></u>loadLibrary0(Runtime.java:823)<br>
at java.lang.System.loadLibrary(<u></u>System.java:1028)<br>
at uk.ac.mrc.hgu.Wlz.WlzBase.<<u></u>clinit>(WlzBase.java:46)<br>
at<br>
loci.formats.services.<u></u>WlzServiceImpl.open(<u></u>WlzServiceImpl.java:122)<br>
... 6 more</blockquote><div><br></div><div>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).</div>
<div><br></div><div>Regards,</div><div>-Melissa</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
<br>
Cheers,<br>
Bill<br>
-- <br>
Bill Hill : <a href="http://www.hgu.mrc.ac.uk" target="_blank">http://www.hgu.mrc.ac.uk</a><br>
MRC Human Genetics Unit : <a href="http://www.emouseatlas.org" target="_blank">http://www.emouseatlas.org</a><br>
MRC IGMM, University of Edinburgh : <a href="mailto:Bill.Hill@igmm.ed.ac.uk" target="_blank">Bill.Hill@igmm.ed.ac.uk</a><br>
Western General Hospital : <a href="tel:%2B44-131-3322471x2119" value="+441313322471" target="_blank">+44-131-3322471x2119</a><br>
Crewe Road, Edinburgh EH4 2XU, UK. : <a href="tel:%2B44-131-4678456" value="+441314678456" target="_blank">+44-131-4678456</a><br>
<br>
The University of Edinburgh is a charitable body, registered in<br>
Scotland, with registration number SC005336.<br>
<br>
______________________________<u></u>_________________<br>
ome-devel mailing list<br>
<a href="mailto:ome-devel@lists.openmicroscopy.org.uk" target="_blank">ome-devel@lists.<u></u>openmicroscopy.org.uk</a><br>
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel" target="_blank">http://lists.openmicroscopy.<u></u>org.uk/mailman/listinfo/ome-<u></u>devel</a><br>
</div></div></blockquote></div><br></div></div>