<div dir="ltr"><div><span style="color:rgb(80,0,80)">Hi Mohamed,</span></div><div><br></div><span style="color:rgb(80,0,80)">> In you last update, you changed the IOService, and now it is not</span><br style="color:rgb(80,0,80)">

<span style="color:rgb(80,0,80)">> possible to use the </span><a href="http://ij.io/" target="_blank">ij.io</a><span style="color:rgb(80,0,80)">().loadDataset method. the new </span><a href="http://ij.io/" target="_blank">ij.io</a><span style="color:rgb(80,0,80)">().open</span><br style="color:rgb(80,0,80)">

<span style="color:rgb(80,0,80)">> method returns an object that cannot be cast into Dataset. Would you</span><br style="color:rgb(80,0,80)"><div><span style="color:rgb(80,0,80)">> show us a little example on how to open a Dataset now?</span><br style="color:rgb(80,0,80)">

<div class="gmail_extra"><br></div><div class="gmail_extra">The method does still exist, but moved to DatasetService:</div><div class="gmail_extra"><br></div><div class="gmail_extra">    ij.dataset().open(String)</div><div class="gmail_extra">

<br></div><div class="gmail_extra">It still returns a Dataset (so no casting is necessary), but now throws only IOException instead of those ImgLib2-specific exceptions.</div><div class="gmail_extra"><br></div><div class="gmail_extra">

As Johannes said, the idea is that <a href="http://ij.io">ij.io</a>().open is now more general purpose ("open something") whereas other individual services are used to open their specific things. So of course DatasetService can open Datasets. And the LUTService can open ColorTables (method "loadLUT" probably needs to be renamed to "open" there), and the TextService can open text files.</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">I have also updated the tutorials accordingly, in case that helps. Please let us know of any problems with it!</div><div class="gmail_extra"><br></div><div class="gmail_extra">

Regards,</div><div class="gmail_extra">Curtis<br><br><div class="gmail_quote">On Fri, Jul 19, 2013 at 10:54 AM, Johannes Schindelin <span dir="ltr"><<a href="mailto:schindelin@wisc.edu" target="_blank">schindelin@wisc.edu</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi Mohamed,<br>
<div class="im"><br>
On Fri, 19 Jul 2013, Mohamed Tleis wrote:<br>
<br>
> In you last update, you changed the IOService, and now it is not<br>
> possible to use the <a href="http://ij.io" target="_blank">ij.io</a>().loadDataset method. the new <a href="http://ij.io" target="_blank">ij.io</a>().open<br>
> method returns an object that cannot be cast into Dataset. Would you<br>
> show us a little example on how to open a Dataset now?<br>
<br>
</div>Please note that the I/O part of ImageJ2 in particular is still in heavy<br>
development mode. You need to expect it to change a lot.<br>
<br>
Now, to the IOService in particular: if you expect it to load only Dataset<br>
instances, you use the wrong service. Remember, ImageJ2 also wants to open<br>
macros and scripts, and result tables, and basically a *lot* on top of<br>
images. That is why the open() method now returns an object.<br>
<br>
If you *know* that you want to open an image (and you need to open it<br>
yourself rather than being nice and asking the user to open the image or<br>
create it or obtain in any way they want rather than the way you want them<br>
to) use the ImgOpener class of SCIFIO:<br>
<a href="http://jenkins.imagej.net/view/SCIFIO/job/SCIFIO-javadoc/javadoc/io/scif/img/ImgOpener.html" target="_blank">http://jenkins.imagej.net/view/SCIFIO/job/SCIFIO-javadoc/javadoc/io/scif/img/ImgOpener.html</a><br>
<br>
However, I strongly suggest that you try to make your plugin as flexible<br>
as possible by stating that you want a Dataset as a @Parameter instead of<br>
forcing the user to store the image as a file and then read it back.<br>
<br>
Ciao,<br>
Johannes<br>
<div class=""><div class="h5"><br>
_______________________________________________<br>
ImageJ-devel mailing list<br>
<a href="mailto:ImageJ-devel@imagej.net">ImageJ-devel@imagej.net</a><br>
<a href="http://imagej.net/mailman/listinfo/imagej-devel" target="_blank">http://imagej.net/mailman/listinfo/imagej-devel</a><br>
</div></div></blockquote></div><br></div></div></div>