<div dir="ltr"><div><div><div>Hi Michael & all,<br><br>> Or more specific is there a better way than incrementally adding<br>> services to get a "Bioformats" ImgOpener running without discovering<br>> unrelated services like HotdrawService...<br>
<br></div>Just to follow up on this thread: the scifio-0.6.1 and scifio-0.6.2 releases have improved the default io.scif.SCIFIO constructor to behave this way. This constructor creates an application context with all available core SciJava & SCIFIO services using the invocation:<br>
<br> new Context(SciJavaService.class, SCIFIOService.class);<br><br></div>The behavior of the SciJava application context was improved to load all services extending each given type. After some discussion we believe this is the simplest and most consistent way to do things. The SciJavaService interface is extended by all base SciJava services (e.g., PluginService). And the SCIFIOService interface is extended by all SCIFIO-related services. ImageJ2 also has an ImageJService now too for the same reasons. In this way, it is possible to easily restrict which sorts of services get added to the context in an extensible way.<br>
<br></div>Regards,<br><div><div>Curtis<br><br></div><div>P.S. The only slightly unintuitive thing (IMHO) is that non-core services
should *not* extend SciJavaService, because that interface is intended
for use by the org.scijava.* services *only*. (E.g., SCIFIOService does
not extend it.)<br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 13, 2013 at 3:37 PM, Michael Zinsmaier <span dir="ltr"><<a href="mailto:michael.zinsmaier@gmx.de" target="_blank">michael.zinsmaier@gmx.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div>Hi Curtis,<br>
<br>
it does work as minimal setting. <br>
But we discovered that we need more services to get the
functionality that we need within KNIP (opening all the images
that are supported by bioformats). So far we added the following
services to open some test pictures: "FormatService.class,
CodecService.class, TiffService.class, JAIIIOService.class"<br>
<br>
What other services will we need? Or more specific is there a
better way than incrementally adding services to get a
"Bioformats" ImgOpener running without discovering unrelated
services like HotdrawService...<br>
<br>
Best Michael<br>
<br>
</div><div><div class="h5">
<blockquote type="cite">
<div dir="ltr">Hi Michael,
<div><br>
</div>
<div>
<div>> What is the minimal set of Services that we need
just for the opener?</div>
</div>
<div><br>
</div>
<div>The noargs ImgOpener constructor is supposed to give you
exactly that:</div>
<div><br>
</div>
<div><a href="https://github.com/scifio/scifio/blob/8037fd38419030dff000eda84fca9b35909be3a4/scifio/src/main/java/io/scif/img/AbstractImgIOComponent.java#L68" target="_blank">https://github.com/scifio/scifio/blob/8037fd38419030dff000eda84fca9b35909be3a4/scifio/src/main/java/io/scif/img/AbstractImgIOComponent.java#L68</a><br>
</div>
<div><br>
</div>
<div>Please let us know if it doesn't work for you!</div>
<div><br>
</div>
<div>Regards,</div>
<div>Curtis</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Mon, Aug 12, 2013 at 10:39 AM,
Michael Zinsmaier <span dir="ltr"><<a href="mailto:michael.zinsmaier@gmx.de" target="_blank">michael.zinsmaier@gmx.de</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
we try to create a suitable context for the ImgOpener but on
our classpath are several jar files that contain services
which we do not intend to use and which cause problems if
discovered (e.g. HotdrawService is discovered but we do not
include all required libs...). What is the minimal set of
Services that we need just for the opener?<br>
<br>
or more code based:<br>
<br>
given the following methods<br>
<br>
public void foo() {<br>
Context c = new Context(getIOContextServices());<br>
m_scifio = new SCIFIO(c);<br>
FORMATS = m_scifio.format().getAllFormats();<br>
}<br>
<br>
private List<Class<? extends Service>>
getIOContextServices() {<br>
final List services = new ArrayList();<br>
services.add(FormatService.class);<br>
return services;<br>
}<br>
<br>
what would be the minimal list of required services in order
to get a suitable Context for the ImgOpener?<br>
<br>
Regards Michael<br>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</div></div></div>
</blockquote></div><br></div>