[ome-devel] cellh5 reader for bio-formats
Curtis Rueden
ctrueden at wisc.edu
Thu Apr 25 22:48:46 BST 2013
Hi Christophe,
> I am new to Java and Maven so I followed instructions from
> http://loci.wisc.edu/bio-formats/developing-bio-formats. Using Eclipse
> (3.7 Indigo) I am unable to run the tests. I guess I haven't set up
> the project properly.
Actually, the probelm is that the Eclipse support was recently broken on
the develop branch. There is a PR in progress to make it work again [1].
For stability, you may want to consider developing your reader against the
v4.4.7 release tag [2] instead of using develop.
> Where is the correct place to put a unit test case for the new reader
> class?
The Bio-Formats convention is to use the same package name as the reader
class, but in the test/ subtree rather than src/.
But really, you can develop your own reader however you want outside of the
core Bio-Formats source. You can even instantiate an ImageReader that
includes your reader in addition to the normal ones [4]. What you cannot do
at the moment -- although it is one of the benefits of the SCIFIO
refactoring [3] -- is have your reader get automatically discovered and
used when it is present on the classpath. Of course, if you are planning to
contribute your reader to the core Bio-Formats distribution, this is a
non-issue.
Regards,
Curtis
[1] https://github.com/openmicroscopy/bioformats/pull/480
[2] https://github.com/openmicroscopy/bioformats/tree/v4.4.7
[3] https://github.com/hinerm/bioformats
[4] For example:
import java.io.IOException;
import loci.formats.ClassList;
import loci.formats.FormatException;
import loci.formats.FormatReader;
import loci.formats.IFormatReader;
import loci.formats.ImageReader;
public class CustomReader {
public static void main(final String[] args) throws Exception {
final ClassList<IFormatReader> cl = ImageReader.getDefaultReaderClasses();
cl.addClass(MyReader.class);
final ImageReader reader = new ImageReader(cl);
reader.setId("/path/to/test.data");
// etc.
}
public static class MyReader extends FormatReader {
public MyReader() {
super("My File Format", ".mySuffix");
}
@Override
public byte[] openBytes(final int no, final byte[] buf, final int x,
final int y, final int w, final int h) throws FormatException,
IOException
{
// TODO Auto-generated method stub
return null;
}
}
}
On Thu, Apr 25, 2013 at 8:33 AM, Christoph Sommer <
christoph.sommer at imba.oeaw.ac.at> wrote:
> Dear Melissa,
>
> thanks for the fast reply!
>
> The develop branch of https://github.com/**openmicroscopy/bioformats<https://github.com/openmicroscopy/bioformats>should compile and pass all tests. What sort of development environment are
>> you using? How are you compiling and running tests?
>>
>>> What HDF5 library for Java would you recommend for native hdf5
>>> access? To write these files (currently from Python) I we HDF5 1.8.7
>>>
>> I am new to Java and Maven so I followed instructions from
> http://loci.wisc.edu/bio-**formats/developing-bio-formats<http://loci.wisc.edu/bio-formats/developing-bio-formats>
> **. Using Eclipse (3.7 Indigo) I am unable to run the tests. I guess I
> haven't set up the project properly... I attached the output I get in the
> eclipse console running "maven build" (eclipse_build_output.txt). Somehow
> Eclipse cannot resolve "import loci.formats.meta.**MetadataStore;"
>
> Running Maven from the command line executes the tests and it looks
> promising. Only 4 test in SCIFIO fail. I attached the surefire html
> report... here's the console output.
>
> ------------------------------**-------------------------
>> T E S T S
>> ------------------------------**-------------------------
>> Running TestSuite
>> [Parser] [WARN] Unknown value of attribute 'parallel' at suite level:
>> '@PARALLEL@'.
>> Tests run: 954, Failures: 4, Errors: 0, Skipped: 0, Time elapsed:
>> 1,302.851 sec <<< FAILURE!
>>
>> Results :
>>
>> Failed tests: testIsDirectory(ome.scifio.io.**utests.LocationTest):
>> bio-formats expected:<true> but was:<false>
>> testIsFile(ome.scifio.io.**utests.LocationTest): bio-formats
>> expected:<false> but was:<true>
>> testIsHidden(ome.scifio.io.**utests.LocationTest): .**
>> hiddenTest1218465869181829460.**tmp expected:<false> but was:<true>
>> testToURL(ome.scifio.io.**utests.LocationTest):
>> validTest5911385117004500129.**tmp expected:<file:/C:/Users/**
>> sommerc/AppData/Local/Temp/**1366896587552-locat
>> est5911385117004500129.tmp> but was:<file://C:/Users/sommerc/**
>> AppData/Local/Temp/**1366896587552-location-test/**
>> validTest5911385117004500129.**tmp>
>>
>> Tests run: 954, Failures: 4, Errors: 0, Skipped: 0
>>
>> [INFO] ------------------------------**------------------------------**
>> ------------
>> [INFO] Reactor Summary:
>> [INFO]
>> [INFO] Bio-Formats projects .............................. SUCCESS
>> [1.413s]
>> [INFO] JAI Image I/O Tools ..............................**. SUCCESS
>> [1.720s]
>> [INFO] MDB Tools (Java port) ............................. SUCCESS
>> [0.450s]
>> [INFO] SCIFIO-devel ..............................**........ FAILURE
>> [21:43.630s]
>> [INFO] Loci-Legacy ..............................**......... SKIPPED
>> [INFO] Apache Jakarta POI ..............................**.. SKIPPED
>> [INFO] Luratech LuraWave stubs ........................... SKIPPED
>> [INFO] OME-XML Java library .............................. SKIPPED
>> [INFO] libjpeg-turbo Java bindings ....................... SKIPPED
>> [INFO] SCIFIO ..............................**.............. SKIPPED
>> [INFO] Bio-Formats code generator ........................ SKIPPED
>> [INFO] Metakit ..............................**............. SKIPPED
>> [INFO] Bio-Formats library ..............................**. SKIPPED
>> [INFO] LOCI Common compatibility JAR ..................... SKIPPED
>> [INFO] LOCI Plugins for ImageJ ........................... SKIPPED
>> [INFO] LOCI Tools bundle ..............................**... SKIPPED
>> [INFO] OME I/O ..............................**............. SKIPPED
>> [INFO] OME Plugins for ImageJ ............................ SKIPPED
>> [INFO] OME Tools bundle ..............................**.... SKIPPED
>> [INFO] SCIFIO ..............................**.............. SKIPPED
>> [INFO] LOCI testing framework ............................ SKIPPED
>> [INFO] XSD-FU ..............................**.............. SKIPPED
>> [INFO] ------------------------------**------------------------------**
>> ------------
>> [INFO] BUILD FAILURE
>> [INFO] ------------------------------**------------------------------**
>> ------------
>> [INFO] Total time: 21:48.070s
>> [INFO] Finished at: Thu Apr 25 15:29:48 CEST 2013
>> [INFO] Final Memory: 22M/440M
>> [INFO] ------------------------------**------------------------------**
>> ------------
>> [ERROR] Failed to execute goal org.apache.maven.plugins:**
>> maven-surefire-plugin:2.12:**test (default-test) on project
>> scifio-devel: There are
>> [...]
>>
>> Btw. Where is the correct place to put a unit test case for the new
> reader class?
>
> Cheers,
> Christoph
>
>
> _______________________________________________
> ome-devel mailing list
> ome-devel at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20130425/5af82221/attachment-0001.html>
More information about the ome-devel
mailing list