Login  Register

Re: a tutorial on a custom image format file reader / writer

Posted by ctrueden on Apr 14, 2008; 5:16pm
URL: http://imagej.273.s1.nabble.com/a-tutorial-on-a-custom-image-format-file-reader-writer-tp3696492p3696509.html

Hi Albert,

Thanks for this guide. I think it is very useful currently, but hopefully in
the future we can improve the ImageJ I/O plugin architecture to reduce the
need for many of these steps. I have some ideas on how to do so, but have
not yet had time to work on them.

LOCI also has a guide to adding new file format readers to Bio-Formats:
https://skyking.microscopy.wisc.edu/svn/java/trunk/loci/formats/doc/reader-guide.txt

The are several advantages to adding a format to Bio-Formats rather than as
a standalone ImageJ plugin:

1) Support for the format in a modularized fashion usable by any software
that uses Bio-Formats (including ImageJ)

2) Ability to extract data plane by plane and in arbitrary order rather than
just sequentially -- for ImageJ this means automatic support for virtual
stacks

3) Standard infrastructure for metadata handling, including adding metadata
mappings from your format to the OME data model

4) No need to edit HandleExtraFileTypes or plugins.config

The main disadvantage is that implementing a Bio-Formats reader is somewhat
more complex than a simple ImageJ reader -- but still less complex than a
complicated ImageJ reader. While there is a learning curve to understanding
the Bio-Formats IFormatReader API, it is not that complicated, and you get
so much out of it -- with an ImageJ reader plugin you must not only code the
pixel extraction, but also manage your own ImagePlus objects, handle your
format's metadata as best you can (if at all), and you don't get any extra
trimmings.

There is no guide to creating format writers yet, but the process is similar
(and it is actually simpler since writers are easier than readers).

-Curtis

On Sat, Apr 12, 2008 at 1:56 PM, Albert Cardona <[hidden email]>
wrote:

> For any interested:
>
> I've written a tutorial on how to create your own image file
> reader/writer, and nicely integrate them with the rest of ImageJ:
>
> - seamless opening from the "File / Open" by editing the
>  HandleExtraFileTypes.java file
>
> - easy writing by placing the plugin under "File / Save As" with a
>  plugins.config packed along with a jar file.
>
>
>
> http://www.mcdb.ucla.edu/research/hartenstein/acardona/imagej_programming_tutorials.html
>
>
> Hope that's useful.
>
> Albert
> --
> Albert Cardona
> http://www.mcdb.ucla.edu/Research/Hartenstein/acardona
>