[ImageJ-devel] IOService changed
Johannes Schindelin
schindelin at wisc.edu
Fri Jul 19 10:54:04 CDT 2013
Hi Mohamed,
On Fri, 19 Jul 2013, Mohamed Tleis wrote:
> In you last update, you changed the IOService, and now it is not
> possible to use the ij.io().loadDataset method. the new ij.io().open
> method returns an object that cannot be cast into Dataset. Would you
> show us a little example on how to open a Dataset now?
Please note that the I/O part of ImageJ2 in particular is still in heavy
development mode. You need to expect it to change a lot.
Now, to the IOService in particular: if you expect it to load only Dataset
instances, you use the wrong service. Remember, ImageJ2 also wants to open
macros and scripts, and result tables, and basically a *lot* on top of
images. That is why the open() method now returns an object.
If you *know* that you want to open an image (and you need to open it
yourself rather than being nice and asking the user to open the image or
create it or obtain in any way they want rather than the way you want them
to) use the ImgOpener class of SCIFIO:
http://jenkins.imagej.net/view/SCIFIO/job/SCIFIO-javadoc/javadoc/io/scif/img/ImgOpener.html
However, I strongly suggest that you try to make your plugin as flexible
as possible by stating that you want a Dataset as a @Parameter instead of
forcing the user to store the image as a file and then read it back.
Ciao,
Johannes
More information about the ImageJ-devel
mailing list