<div dir="ltr">Hi Mohamed,<div><br></div><div><div>> I was wondering if I can search the ij2 source for all methods that</div><div>> returns "Dataset" variable for example. If so, that would make things</div>
<div>> easier whenever I face a similar problem, currently I can only search</div><div>> for Class names.</div></div><div><br></div><div>I do not know if this is possible using an IDE. (You can search for all Dataset references but that would be too many hits, here.)</div>
<div><br></div><div>However, Unix command line tools are your friend. I highly advise learning them, as they will give your productivity a big boost. The git command line tool also has a lot of nice things built in; especially on Windows that may work well for you.</div>
<div><br></div><div>Here's how I found a list of places in the code that return a Dataset:</div><div><br></div><div> git grep 'public Dataset '<br></div><div><br></div><div>Note the space after "Dataset" to ensure it doesn't match e.g. DatasetService.</div>
<div><br></div><div>This returns 43 hits, which is a lot to wade through. But in your case, you probably knew you wanted a *Service* with a method that returns a Dataset, so you can chain them:</div><div><br></div><div> git grep 'public Dataset ' | grep Service.java</div>
<div><br></div><div>Now we're down to 9 hits, which is promising. If we also limit ourselves to the name of the method we want (in this case, "open"):</div><div><br></div><div> git grep 'public Dataset ' | grep Service.java | grep open</div>
<div><br></div><div>We are down to a single hit! Success!</div><div><br></div><div>Of course, this does not search for any methods that return sub-types of Dataset; that gets more complicated and IDE support for that would be most welcome. Perhaps there is a plugin for it, but it is not something I personally have needed much in the past.</div>
<div><br></div><div>Regards,</div><div>Curtis</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jul 20, 2013 at 11:53 AM, Mohamed Tleis <span dir="ltr"><<a href="mailto:mohammedtleis@hotmail.com" target="_blank">mohammedtleis@hotmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
<div text="#000000" bgcolor="#FFFFFF">
<br>
<div><br>
<div>Thank you Johannes and Curtis,<br>
<br>
</div>
<blockquote type="cite">
<div dir="ltr">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>
</div>
</blockquote>
That is good news. <br>
Off-topic question: I was wondering if I can search the ij2 source
for all methods that returns "Dataset" variable for example. If
so, that would make things easier whenever I face a similar
problem, currently I can only search for Class names.<br>
<blockquote type="cite">
<div dir="ltr">
<div>
<div class="gmail_extra"><br>
</div>
I have also updated the tutorials accordingly, in case that
helps. Please let us know of any problems with it!
<div class="gmail_extra"><br>
</div>
</div>
</div>
</blockquote>
Thanks again, these are wonderful tutorials, and I hope you would
have time to release some more in the future.<br>
<blockquote type="cite">
<div dir="ltr">
<div>
<div class="gmail_extra"> Regards,</div>
<div class="gmail_extra">Curtis<br>
<br>
</div>
</div>
</div>
</blockquote>
<br>
<blockquote type="cite">
<div dir="ltr">
<div>
<div class="gmail_extra">
<div class="gmail_quote">
<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">
<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>
</blockquote>
</div>
</div>
</div>
</div>
</blockquote>
I will try the ImgOpener later, but for now I will just use the
dataset().open from the dataset() service as I am already testing
with Dataset.<br>
<blockquote type="cite">
<div dir="ltr">
<div>
<div class="gmail_extra">
<div class="gmail_quote">
<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">
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>
</blockquote>
</div>
</div>
</div>
</div>
</blockquote>
In this regard I am loading the image directly for two benefits,
first when I am testing my code I don't have to choose manually
the image each time. Second, to load and process a set of images
automatically.<br>
<br>
<blockquote type="cite">
<div dir="ltr">
<div>
<div class="gmail_extra">
<div class="gmail_quote">
<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">
Ciao,<br>
Johannes<br>
<div>
<div><br>
_______________________________________________<br>
ImageJ-devel mailing list<br>
<a href="mailto:ImageJ-devel@imagej.net" target="_blank">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>
</blockquote>
Thank you again, keep the good work going on :)<br>
<br>
Best Regards,<br>
Mohamed Tleis<br>
<br>
</div>
<br>
</div>
</div></div></blockquote></div><br></div>