<div dir="ltr">Hi Michael,<div><br></div><div><div>> The Example6c has not been updated to reflect the new way of doing</div><div>> things.</div></div><div><br></div><div>Indeed. If you end up updating it, a pull request to that effect would be most welcome!</div><div><br></div><div><div>> You previously pointed me at the ImageJ OPS library. Is that th best</div><div>> way of achieving the convolution?</div></div><div><br></div><div>The most future-proof, in that OPS is the direction we are going. However, at this point in time it won't be the smoothest ride, since the OPS library is still in incubation.</div><div><br></div><div>Furthermore, the main OPS convolve routine leans on the ImgLib2 FFTConvolution implementation, so if all you need is the low-level function, then OPS is probably not necessary for you.</div><div><br></div><div><div>> [INFO] Restricted to JDK 1.6 yet com.sun:tools:jar:1.4.2:system</div><div>> contains com/sun/codemodel/internal/ClassType.class targeted to JDK</div><div>> 1.8</div></div><div><br></div><div>This was a bug in the Maven build configuration, addressed earlier this week. Should work with the latest master.</div><div><br></div><div><div>> So what are the minimal hoops I need to jump though to setup ops such</div><div>> that the code below will compile? (I want to avoid dragging in any</div><div>> ImageJ 1 legacy code)</div><div>> </div><div>>         Img<FloatType> result = image.copy();</div><div>>         Op op = ops.op("convolve", result, image, templateInverse);</div></div><div><br></div><div>OPS does not depend on ImageJ1. (The only ImageJ2 component that does is called imagej-legacy, and is expressly for the purpose of backwards compatibility.)</div><div><br></div><div>Easiest would be to start with the "using-ops" tutorial project, and edit the code from there.</div><div><br></div><div><a href="https://github.com/imagej/imagej-tutorials/tree/31a5771277682e5f1ef45112094d147539dc4bc7/using-ops">https://github.com/imagej/imagej-tutorials/tree/31a5771277682e5f1ef45112094d147539dc4bc7/using-ops</a><br></div><div><br></div><div>FTR, you can invoke the routine with something like:</div><div><br></div><div>    Object result = ops.convolve(image, templateInverse);</div><div><br></div><div>However, in attempting a quick test of the convolve routine, I ran into some obstacles with the current code. My advice at the moment is to just use FFTConvolution directly for your needs.<br></div><div><br></div><div>> <span style="font-size:13px">For the record, I am suspicious about Java annotations!</span></div><div><br></div><div>I agree with your concerns: they do unfortunately obfuscate the execution flow. However, they also bring many advantages. In particular, the way we are using them provides: 1) a dependency injection mechanism without the need for any external configuration files; and 2) a very succinct syntax for parameterized commands. We are shooting for DRY ("Don't Repeat Yourself") code here [1], not just in the core, but particularly for plugin developers [2].</div><div><br></div><div>I think the best way to counter the mystery surrounding the inner workings is to thoroughly document how things work.</div><div><br></div><div>Regards,</div><div>Curtis</div><div><br></div><div>P.S. Related to FFTConvolution, see also these issues:</div><div>* <a href="https://github.com/imglib/imglib2-algorithm-fft/pull/1">https://github.com/imglib/imglib2-algorithm-fft/pull/1</a><br></div><div>* <a href="https://github.com/imglib/imglib2/issues/61">https://github.com/imglib/imglib2/issues/61</a><br></div><div>* <a href="https://github.com/imagej/imagej-ops/issues/12">https://github.com/imagej/imagej-ops/issues/12</a><br></div><div><br></div><div>[1] <a href="http://imagej.net/Philosophy#Convention_over_configuration">http://imagej.net/Philosophy#Convention_over_configuration</a></div><div>[2] Example: <a href="http://curtis.imagej.net/2013-03-15-imagej-research-paper/plugin-comparison.png">http://curtis.imagej.net/2013-03-15-imagej-research-paper/plugin-comparison.png</a></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 10, 2014 at 1:09 PM, Michael Ellis <span dir="ltr"><<a href="mailto:michael.ellis@dsuk.biz" target="_blank">michael.ellis@dsuk.biz</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Curtis,<div><br></div><div>Thanks for this reply and I am now turning my attention to use of the FFT. </div><div><br></div><div>It seems the FFT was moved from imglib2-algorithm to imglib2-algorithm-fft (due I think to licensing issues).</div><div><br></div><div>I need to achieve what is done in <a href="https://github.com/imglib/imglib2-tutorials/blob/master/src/main/java/Example6c.java" target="_blank">imglib2-tutorials/Example6c.java at master · imglib/imglib2-tutorials</a></div><div><br></div><div><span style="line-height:16px;white-space:pre-wrap">The Example6c has not been updated to reflect the new way of doing things. If I clone the </span><a href="https://github.com/imglib/imglib2-tutorials" target="_blank">imglib/imglib2-tutorials</a> project I see the following are all deprecated.</div><div><br></div><div><span style="line-height:16px;white-space:pre-wrap">import net.imglib2.algorithm.fft.FourierConvolution;<br>import net.imglib2.algorithm.fft.FourierTransform;<br>import net.imglib2.algorithm.fft.InverseFourierTransform;</span></div><div><br></div><div><span style="line-height:16px;white-space:pre-wrap">I have managed to make progress and think I have got fourier and inverse fourier transforms working. So that just leaves the convolution.</span></div><div><br></div><div><span style="line-height:16px;white-space:pre-wrap">You previously pointed me at the </span>ImageJ OPS library. Is that th best way of achieving the convolution?</div><div><br></div><div>The ImageJ OPS example however depends on ImageJ. The ImageJ OPS test programs don’t help me either since the test classes do some magic wizardry that I do not understand at all i.e. with Contexts, Java annotations and some injection stuff.</div><div><br></div><div>So what are the minimal hoops I need to jump though to setup ops such that the code below will compile? (I want to avoid dragging in any ImageJ 1 legacy code)</div><div><span style="line-height:16px;white-space:pre-wrap"><br></span></div><div><span style="line-height:16px;white-space:pre-wrap">        Img<FloatType> result = image.copy(); 
        Op op = ops.op("convolve", result, image, templateInverse);
</span></div><div><span style="line-height:16px;white-space:pre-wrap"><br></span></div><div><span style="line-height:16px;white-space:pre-wrap">Also in downloading the ImageJ-Ops project and running maven compile, I get the following. I realise that I am at Java8 and that might be jumping the gun a bit, but Java 6 </span><span style="line-height:16px;white-space:pre-wrap">is well past its sell by date and if you are on a new Apple Mac, Java 6 is not a comfortable option.</span></div><div><span style="line-height:16px;white-space:pre-wrap"><br></span></div><div><div style="margin:0px">[INFO] Restricted to JDK 1.6 yet com.sun:tools:jar:1.4.2:system contains com/sun/codemodel/internal/ClassType.class targeted to JDK 1.8</div><div style="margin:0px">[WARNING] Rule 1: org.apache.maven.plugins.enforcer.EnforceBytecodeVersion failed with message:</div><div style="margin:0px">Found Banned Dependency: com.sun:tools:jar:1.4.2</div></div><div style="margin:0px"><br></div><div style="margin:0px">For the record, I am suspicious about Java annotations! *For me at least* They fro not help with trying to understand code as I cannot make out how to call the code in question. The feel rather like something layered on top of a language rather than an intrinsic built in.  They give me that uncomfortable feeling that C++ Standard Template Library did - and that gave me nightmares when it came time to debug code.</div><div style="margin:0px"><br></div><div style="margin:0px">Thanks in anticipation of any light you can throw into my darkness!</div><div style="margin:0px"><br></div><div style="margin:0px">— Michael Ellis</div><div style="margin:0px"><br></div><div><br></div><div> </div><div><br></div><div><span style="line-height:16px;white-space:pre-wrap"><br></span></div><div><span style="line-height:16px;white-space:pre-wrap"><br></span><br></div><div><div><div>On 5 Dec 2014, at 18:31, Curtis Rueden <<a href="mailto:ctrueden@WISC.EDU" target="_blank">ctrueden@WISC.EDU</a>> wrote:</div><br><blockquote type="cite"><div dir="ltr"><font color="#000000">Hi Michael,</font><div><font color="#000000"><br></font></div><div><div><font color="#000000">> It looks like there is a new FFT but the tutorials use the older</font></div><div><font color="#000000">> version. </font></div><div><font color="#000000">> </font></div><div><font color="#000000">> What should I go with?</font></div></div><div><font color="#000000"><br></font></div><div><font color="#000000">The library for doing FFT is imglib2-algorithm-fft:</font></div><div><font color="#000000">    <a href="https://github.com/imglib/imglib2-algorithm-fft" target="_blank">https://github.com/imglib/imglib2-algorithm-fft</a><br></font></div><div><font color="#000000"><br></font></div><div><font color="#000000">Regarding the "new FFT", perhaps you refer to this?</font></div><div><font color="#000000">    <a href="https://github.com/imglib/imglib2-algorithm-fft/pull/1" target="_blank">https://github.com/imglib/imglib2-algorithm-fft/pull/1</a></font></div><div><font color="#000000"><br></font></div><div><font color="#000000">At the moment there are licensing issues with imglib2-algorithm-fft (it depends on the Mines JTK library which has a license incompatible with GPL). That PR addresses the issues by using the JTransforms library instead.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">You also might want to consider using the higher level ImageJ OPS library:</font></div><div><font color="#000000">    <a href="https://github.com/imagej/imagej-ops" target="_blank">https://github.com/imagej/imagej-ops</a></font></div><div><font color="#000000"><br></font></div><div><font color="#000000">Thanks to the efforts of Brian Northan, we are about to merge an OP wrapper for FFT:</font></div><div><font color="#000000">    <a href="https://github.com/imagej/imagej-ops/pull/76" target="_blank">https://github.com/imagej/imagej-ops/pull/76</a></font></div><div><font color="#000000"><br></font></div><div><font color="#000000">Note that these components are still in the 0.x incubation phase, meaning they do not have stable APIs. That said, we would really appreciate early adopters who can try out the code and help drive things in the right direction.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">We will be reviewing and merging these improvements over the next few days, then cutting new releases of imglib2-algorithm-fft and imagej-ops. At that point, it should be easier for you to try them out.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">The relevant tutorials are based on imglib2-algorithm-fft:</font></div><div><font color="#000000">    <a href="https://github.com/imglib/imglib2-tutorials/blob/929de9b7482c312ff9c51ab52aa632779ef058f3/src/main/java/Example6b.java" target="_blank">https://github.com/imglib/imglib2-tutorials/blob/929de9b7482c312ff9c51ab52aa632779ef058f3/src/main/java/Example6b.java</a></font></div><div><font color="#000000">    <a href="https://github.com/imglib/imglib2-tutorials/blob/929de9b7482c312ff9c51ab52aa632779ef058f3/src/main/java/Example6c.java" target="_blank">https://github.com/imglib/imglib2-tutorials/blob/929de9b7482c312ff9c51ab52aa632779ef058f3/src/main/java/Example6c.java</a></font></div><div><font color="#000000"><br></font></div><div><font color="#000000">And IIUC the changes above are internal so the tutorial code should not requiring updating (beyond an update to the version of imglib2-algorithm-fft in the POM, of course).</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">Regards,<br></font></div><div><font color="#000000">Curtis</font></div></div><div class="gmail_extra"><font color="#000000"><br></font><div class="gmail_quote"><font color="#000000">On Fri, Dec 5, 2014 at 12:21 PM, Michael Ellis <span dir="ltr"><<a href="mailto:michael.ellis@dsuk.biz" target="_blank">michael.ellis@dsuk.biz</a>></span> wrote:<br></font><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><font color="#000000">Once again, Curtis</font><div><font color="#000000"><br></font></div><div><font color="#000000">I really appreciate your help with this.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">Next questions on the horizon will involve the ImgLib2 algorithm FFT classes. It looks like there is a new FFT but the tutorials use the older version. </font></div><div><font color="#000000"><br></font></div><div><font color="#000000">What should I go with?</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">My aim is build an application, which as part of it will be doing image alignment using FFT phase correlation.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">Regards — Michael Ellis</font></div><div><div><div><font color="#000000"><br></font></div><div><font color="#000000"><br></font><div><div><font color="#000000">On 5 Dec 2014, at 18:13, Curtis Rueden <<a href="mailto:ctrueden@wisc.edu" target="_blank">ctrueden@wisc.edu</a>> wrote:</font></div><font color="#000000"><br></font><blockquote type="cite"><div dir="ltr"><div><font color="#000000">Hi Michael,</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">> gives me a self contained runnable jar. Progress! I’m learning.</font></div><div><font color="#000000">> </font></div><div><font color="#000000">> BUT as before when I run the jar, I get the Exception: No compatible</font></div><div><font color="#000000">> service: org.scijava.service.SciJavaService</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">Self contained runnable JARs (i.e., uber-jars) are convenient in some ways, but come with a host of problems.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">1) If you do not shade your dependencies (i.e., rename their packages), then you may ship duplicate and/or incompatible classes with other libraries. This makes your library much harder to reuse in a shared system such as an ImageJ installation.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">2) You cannot ship piecemeal updates to individual dependencies -- i.e., every time your code changes, you must ship a new (possibly very large) new JAR file to your users.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">3) The SciJava annotation processor, responsible for indexing the @Plugin annotations that drive SciJava/ImageJ2/etc. plugins, writes the metadata into a resource file at META-INF/json/org.scijava.plugin.Plugin within the JAR. If you try to create an uber-jar via the assembly or shade plugin, the default combination algorithm will overwrite those files, stomping the annotations.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">We wrote some code which offers one way around this:</font></div><div><font color="#000000">   <a href="https://github.com/imagej/imagej/blob/imagej-2.0.0-rc-17/pom.xml#L614-L631" target="_blank">https://github.com/imagej/imagej/blob/imagej-2.0.0-rc-17/pom.xml#L614-L631</a></font></div><div><font color="#000000"><br></font></div><div><font color="#000000">For more on uber-jars, see also:</font></div><div><font color="#000000">   <a href="http://imagej.net/Frequently_Asked_Questions#How_can_I_call_ImageJ_from_my_software.3F" target="_blank">http://imagej.net/Frequently_Asked_Questions#How_can_I_call_ImageJ_from_my_software.3F</a></font></div><div><font color="#000000"><br></font></div><div><font color="#000000">The gist is: avoid using an uber-jar unless you really need it.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">> I’ve got it working with your help!</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">Awesome, congratulations. Let us know if you encounter any more roadblocks.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">Regards,</font></div><div><font color="#000000">Curtis</font></div></div><div class="gmail_extra"><font color="#000000"><br></font><div class="gmail_quote"><font color="#000000">On Fri, Dec 5, 2014 at 12:03 PM, Michael Ellis <span dir="ltr"><<a href="mailto:michael.ellis@dsuk.biz" target="_blank">michael.ellis@dsuk.biz</a>></span> wrote:<br></font><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><font color="#000000">Adding a build section to the POM:</font><div><font color="#000000"><br></font></div><div><div><font color="#000000">  <build></font></div><div><font color="#000000">    <plugins></font></div><div><font color="#000000">      <plugin></font></div><div><font color="#000000">        <groupId>org.apache.maven.plugins</groupId></font></div><div><font color="#000000">        <artifactId>maven-shade-plugin</artifactId></font></div><div><font color="#000000">        <version>2.3</version></font></div><div><font color="#000000">        <executions></font></div><div><font color="#000000">          <execution></font></div><div><font color="#000000">            <phase>package</phase></font></div><div><font color="#000000">            <goals></font></div><div><font color="#000000">              <goal>shade</goal></font></div><div><font color="#000000">            </goals></font></div><div><font color="#000000">            <configuration></font></div><div><font color="#000000">              <transformers></font></div><div><font color="#000000">                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"></font></div><div><font color="#000000">                  <manifestEntries></font></div><div><font color="#000000">                    <Main-Class>com.mycompany.app.App</Main-Class></font></div><div><font color="#000000">                    <Build-Number>123</Build-Number></font></div><div><font color="#000000">                  </manifestEntries></font></div><div><font color="#000000">                </transformer></font></div><div><font color="#000000">              </transformers></font></div><div><font color="#000000">            </configuration></font></div><div><font color="#000000">          </execution></font></div><div><font color="#000000">        </executions></font></div><div><font color="#000000">      </plugin></font></div><div><font color="#000000">    </plugins></font></div><div><font color="#000000">  </build></font></div><div><font color="#000000"><br></font></div><div><font color="#000000">To the POM gives me a self contained runnable jar. Progress! I’m learning.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">BUT as before when I run the jar, I get the Exception: No compatible service: org.scijava.service.SciJavaService</font></div><div><font color="#000000">=================================================================</font></div><div><font color="#000000"><br></font></div><div><div style="margin:0px"><div style="margin:0px"><font color="#000000">[Michaels-Retina:~/temp/deleteme/my-app] michaelellis% java -jar target/my-app-1.0-SNAPSHOT.jar </font></div><div style="margin:0px"><font color="#000000">Hello World!</font></div><div style="margin:0px"><font color="#000000">Exception: No compatible service: org.scijava.service.SciJavaService</font></div><div><div><font color="#000000">=================================================================</font></div></div><div><font color="#000000"><br></font></div><div><font color="#000000">Still vexed!</font></div><div><font color="#000000"><br></font></div><div><font color="#000000"><br></font></div></div></div></div><div><div><div><font color="#000000">On 5 Dec 2014, at 17:17, Curtis Rueden <<a href="mailto:ctrueden@wisc.edu" target="_blank">ctrueden@wisc.edu</a>> wrote:</font></div><font color="#000000"><br></font><blockquote type="cite"><div dir="ltr"><font color="#000000">Hi Michael,</font><div><font color="#000000"><br></font></div><div><font color="#000000">> mvn claims to build everything OK</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">Yep, it did build successfully.</font></div><div><font color="#000000"><br></font></div><div><div><div><font color="#000000">> % java -cp target/my-app-1.0-SNAPSHOT.jar com.mycompany.app.App</font></div><div><font color="#000000">> Error: A JNI error has occurred, please check your installation and try again</font></div><div><font color="#000000">> Exception in thread "main" java.lang.NoClassDefFoundError: io/scif/SCIFIO</font></div><div><font color="#000000"><br></font></div></div><div><font color="#000000">Maven is primarily a build tool. It puts the correct JARs on your classpath at compile time. In your case, that is scifio-0.17.1.jar and its dependencies.</font></div></div><div><font color="#000000"><br></font></div><div><font color="#000000">However, the way you are launching your program is not putting the required dependencies on the classpath. You put only my-app-1.0-SNAPSHOT.jar on the classpath, and its dependencies are missing. So of course Java cannot find the needed classes.</font></div><div><font color="#000000"><br></font></div><div><div><font color="#000000">The gist is: it is your responsibility to assemble the dependencies and ensure they are on the classpath somehow when you launch your application.</font></div><div><font color="#000000"><br></font></div><font color="#000000">There are several ways to accomplish this. Here is one generally useful way using Maven, which does not assume you are doing anything ImageJ-related:</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">    $ mvn dependency:copy-dependencies</font></div><div><font color="#000000">    $ java -cp 'target/my-app-1.0-SNAPSHOT.jar:target/dependency/*' com.mycompany.app.App</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">The "copy-dependencies" goal copies all the JAR files needed by your program into the target/dependency folder, for easy subsequent consumption.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">Alternately, the "ImageJ way" of dealing with deployment is to ship all needed dependencies in the "jars" folder of your ImageJ application. We created a Maven goal for this too, which you can use as follows:</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">    $ mvn -Dimagej.app.directory=/Applications/ImageJ.app -Ddelete.other.versions=true</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">Which will copy your JAR and its dependencies into your ImageJ installation at /Applications/ImageJ.app. But note that in order for this goal to work, you must extend the pom-imagej parent (see <a href="https://github.com/imagej/minimal-ij1-plugin" target="_blank">https://github.com/imagej/minimal-ij1-plugin</a> for an example).</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">A third solution is to use the exec-maven-plugin to launch your application directly using Maven. E.g.: <a href="https://github.com/imagej/imagej/blob/imagej-2.0.0-rc-17/pom.xml#L255-L278" target="_blank">https://github.com/imagej/imagej/blob/imagej-2.0.0-rc-17/pom.xml#L255-L278</a></font></div><div><font color="#000000"><br></font></div><div><font color="#000000">Regards,<br></font></div><div><font color="#000000">Curtis</font></div></div><div class="gmail_extra"><font color="#000000"><br></font><div class="gmail_quote"><font color="#000000">On Fri, Dec 5, 2014 at 11:03 AM, Michael Ellis <span dir="ltr"><<a href="mailto:michael.ellis@dsuk.biz" target="_blank">michael.ellis@dsuk.biz</a>></span> wrote:<br></font><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><font color="#000000">Curtis,</font><div><font color="#000000"><br></font></div><div><font color="#000000">Thanks but it is still not working.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">I have cut out using NetBeans and am now just using the CLI and a text editor. </font></div><div><font color="#000000"><br></font></div><div><font color="#000000">POM as follows:</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">========================================================</font></div><div><div><font color="#000000"><project xmlns="<a href="http://maven.apache.org/POM/4.0.0" target="_blank">http://maven.apache.org/POM/4.0.0</a>" xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>"</font></div><div><font color="#000000">  xsi:schemaLocation="<a href="http://maven.apache.org/POM/4.0.0" target="_blank">http://maven.apache.org/POM/4.0.0</a> <a href="http://maven.apache.org/xsd/maven-4.0.0.xsd" target="_blank">http://maven.apache.org/xsd/maven-4.0.0.xsd</a>"></font></div><div><font color="#000000">  <modelVersion>4.0.0</modelVersion></font></div><div><font color="#000000"><br></font></div><div><font color="#000000">  <groupId>com.mycompany.app</groupId></font></div><div><font color="#000000">  <artifactId>my-app</artifactId></font></div><div><font color="#000000">  <version>1.0-SNAPSHOT</version></font></div><div><font color="#000000">  <packaging>jar</packaging></font></div><div><font color="#000000"><br></font></div><div><font color="#000000">  <name>my-app</name></font></div><div><font color="#000000">  <url><a>http://maven.apache.org</url></a></font></div><div><font color="#000000"><br></font></div><div><font color="#000000">  <properties></font></div><div><font color="#000000">    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding></font></div><div><font color="#000000">  </properties></font></div><span><font color="#000000"><div>  </div><div><span style="white-space:pre-wrap"> </span><repositories></div><div><span style="white-space:pre-wrap">             </span><repository></div><div><span style="white-space:pre-wrap">                       </span><id>imagej.public</id></div><div><span style="white-space:pre-wrap">                       </span><url><a href="http://maven.imagej.net/content/groups/public%3C/url%3E" target="_blank">http://maven.imagej.net/content/groups/public</url></a></div><div><span style="white-space:pre-wrap">               </span></repository></div><div><span style="white-space:pre-wrap">      </span></repositories></div><div><br></div></font></span><div><font color="#000000">  <dependencies></font></div><div><font color="#000000">    <dependency></font></div><div><font color="#000000">      <groupId>junit</groupId></font></div><div><font color="#000000">      <artifactId>junit</artifactId></font></div><div><font color="#000000">      <version>3.8.1</version></font></div><div><font color="#000000">      <scope>test</scope></font></div><span><font color="#000000"><div>    </dependency></div><div>    </div><div><span style="white-space:pre-wrap"> </span><dependency></div><div><span style="white-space:pre-wrap">       </span>  <groupId>io.scif</groupId></div><div><span style="white-space:pre-wrap">        </span>  <artifactId>scifio</artifactId></div><div><span style="white-space:pre-wrap">   </span>  <version>0.17.1</version></div></font></span><div><font color="#000000"><span style="white-space:pre-wrap"> </span></dependency></font></div><div><font color="#000000">    </font></div><div><font color="#000000">  </dependencies></font></div><div><font color="#000000"></project></font></div></div><div><font color="#000000">========================================================</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">File hierarchy:</font></div><div><font color="#000000"><br></font></div><div><div style="margin:0px"><font color="#000000">.</font></div><div style="margin:0px"><font color="#000000">./.DS_Store</font></div><div style="margin:0px"><font color="#000000">./pom.xml</font></div><div style="margin:0px"><font color="#000000">./src</font></div><div style="margin:0px"><font color="#000000">./src/main</font></div><div style="margin:0px"><font color="#000000">./src/main/java</font></div><div style="margin:0px"><font color="#000000">./src/main/java/com</font></div><div style="margin:0px"><font color="#000000">./src/main/java/com/mycompany</font></div><div style="margin:0px"><font color="#000000">./src/main/java/com/mycompany/app</font></div><div style="margin:0px"><font color="#000000">./src/main/java/com/mycompany/app/App.java</font></div><div style="margin:0px"><font color="#000000">./src/test</font></div><div style="margin:0px"><font color="#000000">./src/test/java</font></div><div style="margin:0px"><font color="#000000">./src/test/java/com</font></div><div style="margin:0px"><font color="#000000">./src/test/java/com/mycompany</font></div><div style="margin:0px"><font color="#000000">./src/test/java/com/mycompany/app</font></div><div style="margin:0px"><font color="#000000">./src/test/java/com/mycompany/app/AppTest.java</font></div></div><div><font color="#000000">========================================================</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">App.java as follows:</font></div><div><font color="#000000"><br></font></div><div><div><font color="#000000">package com.mycompany.app;</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">import io.scif.FormatException;</font></div><div><font color="#000000">import io.scif.ImageMetadata;</font></div><div><font color="#000000">import io.scif.Plane;</font></div><div><font color="#000000">import io.scif.Reader;</font></div><div><font color="#000000">import io.scif.SCIFIO;</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">public class App </font></div><div><font color="#000000">{</font></div><div><font color="#000000">    public static void main( String[] args )</font></div><div><font color="#000000">    {</font></div><div><font color="#000000"><span style="white-space:pre-wrap">            </span>try {</font></div><div><font color="#000000">    <span style="white-space:pre-wrap">   </span>    System.out.println( "Hello World!" );</font></div><span><font color="#000000"><span style="white-space:pre-wrap">                        </span>SCIFIO scifio = new SCIFIO();</font></span><div><font color="#000000"><span style="white-space:pre-wrap">                        </span>String sampleImage</font></div><div><font color="#000000"><span style="white-space:pre-wrap">                                    </span>= "8bit-signed&pixelType=int8&lengths=50,50,3,5,7&axes=X,Y,Z,Channel,Time.fake";</font></div><div><font color="#000000"><span style="white-space:pre-wrap">                        </span>final Reader reader = scifio.initializer().initializeReader(sampleImage);</font></div><div><font color="#000000"><span style="white-space:pre-wrap">                     </span>System.out.printf("reader=%s%n", reader );</font></div><div><font color="#000000">        } catch (Exception e) {</font></div><div><font color="#000000"><span style="white-space:pre-wrap">     </span>        System.out.printf("Exception: %s%n", e.getMessage() );</font></div><div><font color="#000000">        }</font></div><div><font color="#000000">    }</font></div><div><font color="#000000">}</font></div></div><div><font color="#000000"><br></font></div><div><font color="#000000">========================================================</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">mvm -U install</font></div><div><font color="#000000"><br></font></div><div><div style="margin:0px"><font color="#000000">[Michaels-Retina:~/temp/deleteme/my-app] michaelellis% mvn -U install</font></div><div style="margin:0px"><font color="#000000">[INFO] Scanning for projects...</font></div><div style="margin:0px"><font color="#000000">[INFO]                                                                         </font></div><div style="margin:0px"><font color="#000000">[INFO] ------------------------------------------------------------------------</font></div><div style="margin:0px"><font color="#000000">[INFO] Building my-app 1.0-SNAPSHOT</font></div><div style="margin:0px"><font color="#000000">[INFO] ------------------------------------------------------------------------</font></div><div style="margin:0px"><font color="#000000">[INFO] </font></div><div style="margin:0px"><font color="#000000">[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ my-app ---</font></div><div style="margin:0px"><font color="#000000">[INFO] Using 'UTF-8' encoding to copy filtered resources.</font></div><div style="margin:0px"><font color="#000000">[INFO] skip non existing resourceDirectory /Users/michaelellis/temp/deleteme/my-app/src/main/resources</font></div><div style="margin:0px"><font color="#000000">[INFO] </font></div><div style="margin:0px"><font color="#000000">[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ my-app ---</font></div><div style="margin:0px"><font color="#000000">[INFO] Changes detected - recompiling the module!</font></div><div style="margin:0px"><font color="#000000">[INFO] Compiling 1 source file to /Users/michaelellis/temp/deleteme/my-app/target/classes</font></div><div style="margin:0px"><font color="#000000">[INFO] </font></div><div style="margin:0px"><font color="#000000">[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ my-app ---</font></div><div style="margin:0px"><font color="#000000">[INFO] Using 'UTF-8' encoding to copy filtered resources.</font></div><div style="margin:0px"><font color="#000000">[INFO] skip non existing resourceDirectory /Users/michaelellis/temp/deleteme/my-app/src/test/resources</font></div><div style="margin:0px"><font color="#000000">[INFO] </font></div><div style="margin:0px"><font color="#000000">[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ my-app ---</font></div><div style="margin:0px"><font color="#000000">[INFO] Changes detected - recompiling the module!</font></div><div style="margin:0px"><font color="#000000">[INFO] Compiling 1 source file to /Users/michaelellis/temp/deleteme/my-app/target/test-classes</font></div><div style="margin:0px"><font color="#000000">[INFO] </font></div><div style="margin:0px"><font color="#000000">[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ my-app ---</font></div><div style="margin:0px"><font color="#000000">[INFO] Surefire report directory: /Users/michaelellis/temp/deleteme/my-app/target/surefire-reports</font></div><div style="margin:0px;min-height:14px"><font color="#000000"><br></font></div><div style="margin:0px"><font color="#000000">-------------------------------------------------------</font></div><div style="margin:0px"><font color="#000000"> T E S T S</font></div><div style="margin:0px"><font color="#000000">-------------------------------------------------------</font></div><div style="margin:0px"><font color="#000000">Running com.mycompany.app.AppTest</font></div><div style="margin:0px"><font color="#000000">Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 sec</font></div><div style="margin:0px;min-height:14px"><font color="#000000"><br></font></div><div style="margin:0px"><font color="#000000">Results :</font></div><div style="margin:0px;min-height:14px"><font color="#000000"><br></font></div><div style="margin:0px"><font color="#000000">Tests run: 1, Failures: 0, Errors: 0, Skipped: 0</font></div><div style="margin:0px;min-height:14px"><font color="#000000"><br></font></div><div style="margin:0px"><font color="#000000">[INFO] </font></div><div style="margin:0px"><font color="#000000">[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ my-app ---</font></div><div style="margin:0px"><font color="#000000">[INFO] Building jar: /Users/michaelellis/temp/deleteme/my-app/target/my-app-1.0-SNAPSHOT.jar</font></div><div style="margin:0px"><font color="#000000">[INFO] </font></div><div style="margin:0px"><font color="#000000">[INFO] --- maven-install-plugin:2.4:install (default-install) @ my-app ---</font></div><div style="margin:0px"><font color="#000000">[INFO] Installing /Users/michaelellis/temp/deleteme/my-app/target/my-app-1.0-SNAPSHOT.jar to /Users/michaelellis/.m2/repository/com/mycompany/app/my-app/1.0-SNAPSHOT/my-app-1.0-SNAPSHOT.jar</font></div><div style="margin:0px"><font color="#000000">[INFO] Installing /Users/michaelellis/temp/deleteme/my-app/pom.xml to /Users/michaelellis/.m2/repository/com/mycompany/app/my-app/1.0-SNAPSHOT/my-app-1.0-SNAPSHOT.pom</font></div><div style="margin:0px"><font color="#000000">[INFO] ------------------------------------------------------------------------</font></div><div style="margin:0px"><font color="#000000">[INFO] BUILD SUCCESS</font></div><div style="margin:0px"><font color="#000000">[INFO] ------------------------------------------------------------------------</font></div><div style="margin:0px"><font color="#000000">[INFO] Total time: 1.962 s</font></div><div style="margin:0px"><font color="#000000">[INFO] Finished at: 2014-12-05T16:59:50+00:00</font></div><div style="margin:0px"><font color="#000000">[INFO] Final Memory: 18M/242M</font></div><div style="margin:0px"><font color="#000000">[INFO] ————————————————————————————————————</font></div></div><div style="margin:0px"><font color="#000000"><br></font></div><div style="margin:0px"><div><font color="#000000">========================================================</font></div><div><font color="#000000"><br></font></div></div><div><font color="#000000">mvn claims to build everything OK there seems to be no inclusion of any scif libraries or class files.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000"><br></font></div><div><font color="#000000">When I run it I get:</font></div><div><font color="#000000"><br></font></div><div><div style="margin:0px"><font color="#000000">[Michaels-Retina:~/temp/deleteme/my-app] michaelellis% java -cp target/my-app-1.0-SNAPSHOT.jar com.mycompany.app.App</font></div><div style="margin:0px"><font color="#000000">Error: A JNI error has occurred, please check your installation and try again</font></div><div style="margin:0px"><font color="#000000">Exception in thread "main" java.lang.NoClassDefFoundError: io/scif/SCIFIO</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">      </span>at java.lang.Class.getDeclaredMethods0(Native Method)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">    </span>at java.lang.Class.privateGetDeclaredMethods(Class.java:2699)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">    </span>at java.lang.Class.privateGetMethodRecursive(Class.java:3046)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">    </span>at java.lang.Class.getMethod0(Class.java:3016)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">   </span>at java.lang.Class.getMethod(Class.java:1782)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">    </span>at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">        </span>at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)</font></div><div style="margin:0px"><font color="#000000">Caused by: java.lang.ClassNotFoundException: io.scif.SCIFIO</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">       </span>at java.net.URLClassLoader.findClass(URLClassLoader.java:381)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">    </span>at java.lang.ClassLoader.loadClass(ClassLoader.java:424)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap"> </span>at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap"> </span>at java.lang.ClassLoader.loadClass(ClassLoader.java:357)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap"> </span>... 7 more</font></div></div><div><font color="#000000"><br></font></div><div><font color="#000000"><br></font></div><div><font color="#000000">========================================================</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">I’ve been banging my head against this for two days now. </font></div><div><font color="#000000"><br></font></div><div><font color="#000000">So any help appreciated</font></div><div><div><font color="#000000"><br></font></div><div><font color="#000000"><br></font><div><div><font color="#000000">On 5 Dec 2014, at 16:35, Curtis Rueden <<a href="mailto:ctrueden@WISC.EDU" target="_blank">ctrueden@WISC.EDU</a>> wrote:</font></div><font color="#000000"><br></font><blockquote type="cite"><div dir="ltr"><font color="#000000">Hi Michael,</font><div><font color="#000000"><br></font></div><div><div><font color="#000000">> The POM for io.scif:scifio:jar:0.17.1 is missing, no dependency</font></div><div><font color="#000000">> information available</font></div></div><div><font color="#000000"><br></font></div><div><font color="#000000">Make sure you have the following <repositories> block in your POM:</font></div><div><font color="#000000"><br></font></div><div><div><font color="#000000"><span style="white-space:pre-wrap"> </span><repositories></font></div><div><font color="#000000"><span style="white-space:pre-wrap">          </span><repository></font></div><div><font color="#000000"><span style="white-space:pre-wrap">                    </span><id>imagej.public</id></font></div><div><font color="#000000"><span style="white-space:pre-wrap">                    </span><url><a href="http://maven.imagej.net/content/groups/public" target="_blank">http://maven.imagej.net/content/groups/public</a></url></font></div><div><font color="#000000"><span style="white-space:pre-wrap">              </span></repository></font></div><div><font color="#000000"><span style="white-space:pre-wrap">   </span></repositories></font></div></div><div><font color="#000000"><br></font></div><div><font color="#000000">Then rebuild with the "-U" flag. I don't know how to do this from NetBeans, but you only need to do it once from the CLI -- then you can return to NetBeans and it should work.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">Regards,</font></div><div><font color="#000000">Curtis</font></div></div><div class="gmail_extra"><font color="#000000"><br></font><div class="gmail_quote"><font color="#000000">On Fri, Dec 5, 2014 at 6:07 AM, Michael Ellis <span dir="ltr"><<a href="mailto:michael.ellis@dsuk.biz" target="_blank">michael.ellis@dsuk.biz</a>></span> wrote:<br></font><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><font color="#000000">I have followed the advice offered by Curtis regarding adding the io.scif: scifio dependency to my POM</font><div><font color="#000000"><br></font></div><div><font color="#000000">The dependency part of my POM looks like this:</font></div><div><font color="#000000"><br></font></div><div><div><font color="#000000">    <dependencies></font></div><div><font color="#000000">        <dependency></font></div><div><font color="#000000">            <groupId>net.imglib2</groupId></font></div><div><font color="#000000">            <artifactId>imglib2</artifactId></font></div><div><font color="#000000">            <version>2.2.1-SNAPSHOT</version></font></div><div><font color="#000000">            <type>jar</type></font></div><div><font color="#000000">        </dependency></font></div><span><font color="#000000"><div>        <dependency></div><div>            <groupId>io.scif</groupId></div><div>            <artifactId>scifio</artifactId></div><div>            <version>0.17.1</version></div></font></span><div><font color="#000000">            <type>jar</type></font></div><div><font color="#000000">        </dependency></font></div><div><font color="#000000">    </dependencies></font></div></div><div><font color="#000000"><br></font></div><div><font color="#000000">I am using NetBeans IDE, configured for use with maven project (I am slo using Java 8 and JavaFX)</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">However when I attempt to Build (or Build with Dependencies)  within NetBeans, I get the following error message:</font></div><div><font color="#000000">============================================================</font></div><div><font color="#000000"><br></font></div><div><div><font color="#000000">cd /Users/michaelellis/Documents/Development/MavenImgLib2FX; JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home "/Applications/NetBeans/NetBeans 8.0.app/Contents/Resources/NetBeans/java/maven/bin/mvn" install</font></div><div><font color="#000000">Scanning for projects...</font></div><div><font color="#000000">                                                                        </font></div><div><font color="#000000">------------------------------------------------------------------------</font></div><div><font color="#000000">Building MavenImgLib2FX 1.0-SNAPSHOT</font></div><div><font color="#000000">------------------------------------------------------------------------</font></div><div><font color="#000000">The POM for io.scif:scifio:jar:0.17.1 is missing, no dependency information available</font></div><div><font color="#000000">------------------------------------------------------------------------</font></div><div><font color="#000000">BUILD FAILURE</font></div><div><font color="#000000">------------------------------------------------------------------------</font></div><div><font color="#000000">Total time: 0.341s</font></div><div><font color="#000000">Finished at: Fri Dec 05 10:34:41 GMT 2014</font></div><div><font color="#000000">Final Memory: 7M/245M</font></div><div><font color="#000000">------------------------------------------------------------------------</font></div><div><font color="#000000">Failed to execute goal on project MavenImgLib2FX: Could not resolve dependencies for project biz.dsuk:MavenImgLib2FX:jar:1.0-SNAPSHOT: Failure to find io.scif:scifio:jar:0.17.1 in <a href="http://repo.maven.apache.org/maven2" target="_blank">http://repo.maven.apache.org/maven2</a> was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">To see the full stack trace of the errors, re-run Maven with the -e switch.</font></div><div><font color="#000000">Re-run Maven using the -X switch to enable full debug logging.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">For more information about the errors and possible solutions, please read the following articles:</font></div><div><font color="#000000">[Help 1] <a href="http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException" target="_blank">http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException</a></font></div><div><font color="#000000"><br></font></div><div><font color="#000000">============================================================</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">If I open a terminal window and cd into the project directory and:</font></div><div><font color="#000000"><br></font></div><div><font color="#000000"><span style="white-space:pre-wrap">        </span>mvn clean package</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">It succeeds.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">However, when I then attempt to run the project with:</font></div><div><font color="#000000"><br></font></div><div><font color="#000000"><span style="white-space:pre-wrap">    </span>java -cp MavenImgLib2FX-1.0-SNAPSHOT.jar biz.dsuk.mavenimglib2fx.MainApp</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">The application starts to execute but throws “No compatible service: io.scif.SCIFIOService” exception.</font></div><div><font color="#000000">============================================================</font></div><div><font color="#000000"><br></font></div><div><div style="margin:0px"><font color="#000000">img1=CellImg [20x30]</font></div><div style="margin:0px"><font color="#000000">BufferedImage=BufferedImage@3137c585: type = 10 ColorModel: #pixelBits = 8 numComponents = 1 color space = java.awt.color.ICC_ColorSpace@134d9d5f transparency = 1 has alpha = false isAlphaPre = false ByteInterleavedRaster: width = 707 height = 699 #numDataElements 1 dataOff[0] = 0</font></div><div style="margin:0px"><font color="#000000">Loading image...</font></div><div style="margin:0px"><font color="#000000">Exception in Application start method</font></div><div style="margin:0px"><font color="#000000">java.lang.reflect.InvocationTargetException</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">   </span>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">   </span>at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap"> </span>at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap"> </span>at java.lang.reflect.Method.invoke(Method.java:497)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">      </span>at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:363)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">      </span>at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:303)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">      </span>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">   </span>at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap"> </span>at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap"> </span>at java.lang.reflect.Method.invoke(Method.java:497)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">      </span>at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)</font></div><div style="margin:0px"><font color="#000000">Caused by: java.lang.RuntimeException: Exception in Application start method</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap"> </span>at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:875)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">     </span>at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$150(LauncherImpl.java:157)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">   </span>at com.sun.javafx.application.LauncherImpl$$Lambda$50/553264065.run(Unknown Source)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">      </span>at java.lang.Thread.run(Thread.java:745)</font></div><div style="margin:0px"><font color="#000000">Caused by: java.lang.IllegalArgumentException: No compatible service: io.scif.SCIFIOService</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">       </span>at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:243)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap"> </span>at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:194)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap"> </span>at org.scijava.service.ServiceHelper.loadServices(ServiceHelper.java:170)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">        </span>at org.scijava.Context.<init>(Context.java:244)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">    </span>at org.scijava.Context.<init>(Context.java:203)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">    </span>at org.scijava.Context.<init>(Context.java:142)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">    </span>at org.scijava.Context.<init>(Context.java:128)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">    </span>at io.scif.SCIFIO.<init>(SCIFIO.java:81)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">   </span>at biz.dsuk.mavenimglib2fx.MainApp.start(MainApp.java:38)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">        </span>at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$156(LauncherImpl.java:821)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">  </span>at com.sun.javafx.application.LauncherImpl$$Lambda$53/681110827.run(Unknown Source)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">      </span>at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$169(PlatformImpl.java:326)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">  </span>at com.sun.javafx.application.PlatformImpl$$Lambda$47/693632176.run(Unknown Source)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">      </span>at com.sun.javafx.application.PlatformImpl.lambda$null$167(PlatformImpl.java:295)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">        </span>at com.sun.javafx.application.PlatformImpl$$Lambda$49/1260282780.run(Unknown Source)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">     </span>at java.security.AccessController.doPrivileged(Native Method)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">    </span>at com.sun.javafx.application.PlatformImpl.lambda$runLater$168(PlatformImpl.java:294)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">    </span>at com.sun.javafx.application.PlatformImpl$$Lambda$48/1364335809.run(Unknown Source)</font></div><div style="margin:0px"><font color="#000000"><span style="white-space:pre-wrap">     </span>at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)</font></div><div style="margin:0px"><font color="#000000">Exception running application biz.dsuk.mavenimglib2fx.MainApp</font></div></div><div><font color="#000000">============================================================</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">If I remove the calls to the SCIO code and build and run from the command line, all works well.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">The SCIO source code that I am using is lifted/amended from one of the tutorials and is as follows:</font></div><div><font color="#000000"><br></font></div><div><div><font color="#000000">============================================================</font></div><div><font color="#000000">            imagePath = "8bit-signed&pixelType=int8&lengths=50,50,3,5,7&axes=X,Y,Z,Channel,Time.fake";</font></div><div><font color="#000000">            System.out.println("Loading image... '" + imagePath + "'");</font></div><div><font color="#000000">            SCIFIO scifio = new SCIFIO();</font></div><div><font color="#000000">            final Reader reader = scifio.initializer().initializeReader(imagePath);</font></div><div><font color="#000000">============================================================</font></div></div><div><font color="#000000"><br></font></div><div><font color="#000000">This source code works file in the SCIFIO tutorial.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">Any help gratefully appreciated!!!!!</font></div><span><font color="#000000"><div><br></div><div>— Michael Ellis</div></font></span><div><div><font color="#000000"><br></font></div><div><font color="#000000"><br></font></div><div><font color="#000000"><br></font></div><div><font color="#000000"><br></font></div><div><div><font color="#000000">On 3 Dec 2014, at 19:31, Curtis Rueden <<a href="mailto:ctrueden@WISC.EDU" target="_blank">ctrueden@WISC.EDU</a>> wrote:</font></div><font color="#000000"><br></font><blockquote type="cite"><div dir="ltr"><font color="#000000">Hi Michael,</font><div><font color="#000000"><br></font></div><div><font color="#000000">> How do I establish what Maven projects I need to include? </font></div><div><font color="#000000"><br></font></div><div><font color="#000000">One way to check is using the dependency-maven-plugin like so:</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">    mvn dependency:analyze</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">This will tell you:</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">A) Dependencies you declared but do not actually use; and</font></div><div><font color="#000000">B) Dependencies you did not declare directly, but actually need.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">Note that this will only work if your project compiles successfully. In other words, it is easier to start with "too many" dependencies and pare down, rather than trying to "build up" from zero.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">So in your case, you can start with the ImgLib2 Examples dependencies block, run dependency:analyze, and adjust the POM according to its recommendations.</font></div><div><font color="#000000"><br></font></div><div><div><font color="#000000">> When I go to my NetBeans project dependence, select Add dependency,</font></div><div><font color="#000000">> then type SCIF to the query text box, I get a huge list of</font></div><div><font color="#000000">> possibilities.</font></div></div><div><font color="#000000"><br></font></div><div><font color="#000000">The dependency you probably want is io.scif:scifio (i.e.: a groupId of io.scif, and an artifactId of scifio). Presumably at the latest version. You can search for that here:</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">   <a href="http://maven.imagej.net/index.html#nexus-search;gav~io.scif~scifio~~~" target="_blank">http://maven.imagej.net/index.html#nexus-search;gav~io.scif~scifio~~~</a><br></font></div><div><font color="#000000"><br></font></div><div><font color="#000000">So your dependency block in this case would be:</font></div><div><font color="#000000"><br></font></div><div><div><font color="#000000">    <dependency></font></div><div><font color="#000000">      <groupId>io.scif</groupId></font></div><div><font color="#000000">      <artifactId>scifio</artifactId></font></div><div><font color="#000000">      <version>0.17.1</version></font></div><div><font color="#000000">    </dependency></font></div></div><div><font color="#000000"><br></font></div><div><font color="#000000">Note that that block of XML is available for copy-pasting from the link above.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">> I am completely new to maven</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">For more information, see:</font></div><div><font color="#000000">    <a href="http://imagej.net/Maven" target="_blank">http://imagej.net/Maven</a></font></div><div><font color="#000000"><br></font></div><div><font color="#000000">Regards,</font></div><div><font color="#000000">Curtis</font></div></div><div class="gmail_extra"><font color="#000000"><br></font><div class="gmail_quote"><font color="#000000">On Tue, Dec 2, 2014 at 6:05 PM, Michael Ellis <span dir="ltr"><<a href="mailto:michael.ellis@dsuk.biz" target="_blank">michael.ellis@dsuk.biz</a>></span> wrote:<br></font><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><font color="#000000">I am investigating the using ImgLib2 for a project.</font><div><font color="#000000"><br></font></div><div><font color="#000000">I am using NetBeans and have managed to create a NetBeans Mavern project and have  added a dependency for ImgLib2 Core Library and that seems to be working OK.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">I now want to add the least possible requirements for the purpose of opening some image files.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">How do I establish what Maven projects I need to include? </font></div><div><font color="#000000"><br></font></div><div><font color="#000000">I have cloned  the ImgLib2 Examples project and got that working but that seems to include all manner of things that I suspect I do not need.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">When I go to my NetBeans project dependence, select Add dependency, then type SCIF to the query text box, I get a huge list of possibilities.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">I am completely new to maven and so do not know what I am doing with it!</font></div><span><font color="#000000"><div><br></div><div>— Michael Ellis</div><div>Digital Scientific UK Ltd.</div><div><span style="border-collapse:separate;font-variant:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></span><br>
</div>
<br></font></span></div><font color="#000000"><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>
<br></font></blockquote></div><font color="#000000"><br></font></div>
</blockquote></div><font color="#000000"><br></font></div></div></div><font color="#000000"><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>
<br></font></blockquote></div><font color="#000000"><br></font></div>
</blockquote></div><font color="#000000"><br></font></div></div></div><font color="#000000"><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>
<br></font></blockquote></div><font color="#000000"><br></font></div>
</blockquote></div><font color="#000000"><br></font></div></div><font color="#000000"><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>
<br></font></blockquote></div><font color="#000000"><br></font></div>
</blockquote></div><font color="#000000"><br></font></div></div></div></div></blockquote></div><font color="#000000"><br></font></div>
</blockquote></div><br></div></div><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>
<br></blockquote></div></div>