Simple ImgLib2 examples

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Simple ImgLib2 examples

bnorthan
Hi all

I am trying to go through the simple imglib2 examples from the fiji site.  They all seem to fail when calling "ImageLibFunctions.show" with a java.lang.NoSuchMethodError.  

I am using the jars from the latest fiji build and I have the following jars on my build path ij-1.47c.jar, imglib2-2.0.0-beta4.jar and imglib2-ij.jar.   Using Linux-64.

Any idea what I could be doing wrong??  Should I be getting the jars from somewhere else??  

Thanks

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Simple ImgLib2 examples

dscho
Hi Brian,

On Thu, 13 Sep 2012, Brian Northan wrote:

> I am trying to go through the simple imglib2 examples from the fiji
> site.  They all seem to fail when calling "ImageLibFunctions.show" with
> a java.lang.NoSuchMethodError.  
>
> I am using the jars from the latest fiji build and I have the following
> jars on my build path ij-1.47c.jar, imglib2-2.0.0-beta4.jar and
> imglib2-ij.jar.   Using Linux-64.
>
> Any idea what I could be doing wrong??  Should I be getting the jars
> from somewhere else??  

I have a hunch that a new version imglib2-ij needs to be uploaded.
Unfortunately, the core ImgLib2 core developers are traveling or otherwise
busy, so I will have a look in a couple of hours and report back.

Ciao,
Johannes

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Simple ImgLib2 examples

ctrueden
In reply to this post by bnorthan
Hi Brian & everyone,


> I am trying to go through the simple imglib2 examples from the fiji site.
>  They all seem to fail when calling "ImageLibFunctions.show" with a

java.lang.NoSuchMethodError.


For others: the page Brian refers to is here:
http://fiji.sc/ImgLib2_Examples

Brian: First of all, you mean "ImageJFunctions.show", right?

Secondly, from your description, it sounds like you are not using the
development route suggested on the page: paste the code into Fiji's Script
Editor, set the language to Java, tweak code to your liking, save and run.
If you do things this way, Fiji will take care of the classpath for you.
This will allow you to try out the examples easily.

Of course, using the Script Editor does not give you all the power of an
IDE like Eclipse. So I understand why you would want to create e.g. an
Eclipse project with JAR dependencies. A NoSuchMethodError usually
indicates a mismatch between JAR files. You mention that you are using
"imglib2-ij.jar"... shouldn't that be "imglib2-ij-2.0.0-beta4.jar"?

Here are the JAR files of the same version, which all go together:

http://maven.imagej.net/content/repositories/releases/net/imglib2/imglib2-ij/2.0.0-beta4/imglib2-ij-2.0.0-beta4.jar

http://maven.imagej.net/content/repositories/releases/net/imglib2/imglib2/2.0.0-beta4/imglib2-2.0.0-beta4.jar

http://maven.imagej.net/content/repositories/releases/net/imagej/ij/1.47c/ij-1.47c.jar

By the way, if you use Maven (by adding a pom.xml file), you can simply add
these artifacts as dependencies, and Maven will take care of your classpath
issues. You can then also import the project into Eclipse using File >
Import > Existing Maven Project and it will manage your dependencies for
you. For the pom.xml, here is a template you can copy:


https://github.com/imagej/imagej-tutorials/blob/master/load-and-display-dataset/pom.xml

Regards,
Curtis

P.S. We should really get those examples into source control, along side
the rest of ImgLib. I will work on doing that today, and reply back when
it's ready. That way you won't have to copy/paste and set up your own
project just to try them out.


On Thu, Sep 13, 2012 at 10:52 AM, Brian Northan <[hidden email]> wrote:

> Hi all
>
> I am trying to go through the simple imglib2 examples from the fiji site.
>  They all seem to fail when calling "ImageLibFunctions.show" with a
> java.lang.NoSuchMethodError.
>
> I am using the jars from the latest fiji build and I have the following
> jars on my build path ij-1.47c.jar, imglib2-2.0.0-beta4.jar and
> imglib2-ij.jar.   Using Linux-64.
>
> Any idea what I could be doing wrong??  Should I be getting the jars from
> somewhere else??
>
> Thanks
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Simple ImgLib2 examples

bnorthan
Curtis

Yes I meant ImageJFunctions.show.  I replaced imglib2-ij.jar with
imglib2-ij-2.0.0-beta4.jar and it works now.   The version of Fiji I
got this morning came with imglib2-ij.jar (but "beta4" versions for
the other imglib2 related jars).

Thanks for the help

Brian

On Thu, Sep 13, 2012 at 2:25 PM, Curtis Rueden <[hidden email]> wrote:

> Hi Brian & everyone,
>
>
>> I am trying to go through the simple imglib2 examples from the fiji site.
>>  They all seem to fail when calling "ImageLibFunctions.show" with a
>
> java.lang.NoSuchMethodError.
>
>
> For others: the page Brian refers to is here:
> http://fiji.sc/ImgLib2_Examples
>
> Brian: First of all, you mean "ImageJFunctions.show", right?
>
> Secondly, from your description, it sounds like you are not using the
> development route suggested on the page: paste the code into Fiji's Script
> Editor, set the language to Java, tweak code to your liking, save and run.
> If you do things this way, Fiji will take care of the classpath for you.
> This will allow you to try out the examples easily.
>
> Of course, using the Script Editor does not give you all the power of an
> IDE like Eclipse. So I understand why you would want to create e.g. an
> Eclipse project with JAR dependencies. A NoSuchMethodError usually
> indicates a mismatch between JAR files. You mention that you are using
> "imglib2-ij.jar"... shouldn't that be "imglib2-ij-2.0.0-beta4.jar"?
>
> Here are the JAR files of the same version, which all go together:
>
> http://maven.imagej.net/content/repositories/releases/net/imglib2/imglib2-ij/2.0.0-beta4/imglib2-ij-2.0.0-beta4.jar
>
> http://maven.imagej.net/content/repositories/releases/net/imglib2/imglib2/2.0.0-beta4/imglib2-2.0.0-beta4.jar
>
> http://maven.imagej.net/content/repositories/releases/net/imagej/ij/1.47c/ij-1.47c.jar
>
> By the way, if you use Maven (by adding a pom.xml file), you can simply add
> these artifacts as dependencies, and Maven will take care of your classpath
> issues. You can then also import the project into Eclipse using File >
> Import > Existing Maven Project and it will manage your dependencies for
> you. For the pom.xml, here is a template you can copy:
>
>
> https://github.com/imagej/imagej-tutorials/blob/master/load-and-display-dataset/pom.xml
>
> Regards,
> Curtis
>
> P.S. We should really get those examples into source control, along side
> the rest of ImgLib. I will work on doing that today, and reply back when
> it's ready. That way you won't have to copy/paste and set up your own
> project just to try them out.
>
>
> On Thu, Sep 13, 2012 at 10:52 AM, Brian Northan <[hidden email]> wrote:
>
>> Hi all
>>
>> I am trying to go through the simple imglib2 examples from the fiji site.
>>  They all seem to fail when calling "ImageLibFunctions.show" with a
>> java.lang.NoSuchMethodError.
>>
>> I am using the jars from the latest fiji build and I have the following
>> jars on my build path ij-1.47c.jar, imglib2-2.0.0-beta4.jar and
>> imglib2-ij.jar.   Using Linux-64.
>>
>> Any idea what I could be doing wrong??  Should I be getting the jars from
>> somewhere else??
>>
>> Thanks
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Simple ImgLib2 examples

dscho
Hi Brian,

On Thu, 13 Sep 2012, Brian Northan wrote:

> Yes I meant ImageJFunctions.show.  I replaced imglib2-ij.jar with
> imglib2-ij-2.0.0-beta4.jar and it works now.   The version of Fiji I
> got this morning came with imglib2-ij.jar (but "beta4" versions for
> the other imglib2 related jars).

This was an oversight on my part, sorry. Fixed now (your updater will
probably suggest to update the files next time you start Fiji).

Ciao,
Johannes

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Simple ImgLib2 examples

ctrueden
In reply to this post by ctrueden
Hi Brian & everyone,


> P.S. We should really get those examples into source control, along side
> the rest of ImgLib. I will work on doing that today, and reply back when
> it's ready. That way you won't have to copy/paste and set up your own
> project just to try them out.


I just pushed the examples to the master branch of the imglib repository:
    https://github.com/imagej/imglib/commit/554d8316

This includes the image data needed to run the examples, as well as the
code itself.

You can run them by opening up individual .java files in Fiji's Script
Editor, or in Eclipse using File > Import > Existing Maven Projects and
pointing it to the imglib/imglib2/examples directory.

Note that the code on the ImgLib2 Examples wiki page is now slightly out of
date; I will update it to match the Git repository tomorrow. But in the
meantime, I suggest using the code in the repository instead.

Regards,
Curtis


On Thu, Sep 13, 2012 at 1:25 PM, Curtis Rueden <[hidden email]> wrote:

> Hi Brian & everyone,
>
>
>> I am trying to go through the simple imglib2 examples from the fiji site.
>>  They all seem to fail when calling "ImageLibFunctions.show" with a
>
> java.lang.NoSuchMethodError.
>
>
>  For others: the page Brian refers to is here:
> http://fiji.sc/ImgLib2_Examples
>
> Brian: First of all, you mean "ImageJFunctions.show", right?
>
> Secondly, from your description, it sounds like you are not using the
> development route suggested on the page: paste the code into Fiji's Script
> Editor, set the language to Java, tweak code to your liking, save and run.
> If you do things this way, Fiji will take care of the classpath for you.
> This will allow you to try out the examples easily.
>
> Of course, using the Script Editor does not give you all the power of an
> IDE like Eclipse. So I understand why you would want to create e.g. an
> Eclipse project with JAR dependencies. A NoSuchMethodError usually
> indicates a mismatch between JAR files. You mention that you are using
> "imglib2-ij.jar"... shouldn't that be "imglib2-ij-2.0.0-beta4.jar"?
>
> Here are the JAR files of the same version, which all go together:
>
> http://maven.imagej.net/content/repositories/releases/net/imglib2/imglib2-ij/2.0.0-beta4/imglib2-ij-2.0.0-beta4.jar
>
> http://maven.imagej.net/content/repositories/releases/net/imglib2/imglib2/2.0.0-beta4/imglib2-2.0.0-beta4.jar
>
> http://maven.imagej.net/content/repositories/releases/net/imagej/ij/1.47c/ij-1.47c.jar
>
> By the way, if you use Maven (by adding a pom.xml file), you can simply
> add these artifacts as dependencies, and Maven will take care of your
> classpath issues. You can then also import the project into Eclipse using
> File > Import > Existing Maven Project and it will manage your dependencies
> for you. For the pom.xml, here is a template you can copy:
>
>
> https://github.com/imagej/imagej-tutorials/blob/master/load-and-display-dataset/pom.xml
>
> Regards,
> Curtis
>
> P.S. We should really get those examples into source control, along side
> the rest of ImgLib. I will work on doing that today, and reply back when
> it's ready. That way you won't have to copy/paste and set up your own
> project just to try them out.
>
>
> On Thu, Sep 13, 2012 at 10:52 AM, Brian Northan <[hidden email]>wrote:
>
>> Hi all
>>
>> I am trying to go through the simple imglib2 examples from the fiji site.
>>  They all seem to fail when calling "ImageLibFunctions.show" with a
>> java.lang.NoSuchMethodError.
>>
>> I am using the jars from the latest fiji build and I have the following
>> jars on my build path ij-1.47c.jar, imglib2-2.0.0-beta4.jar and
>> imglib2-ij.jar.   Using Linux-64.
>>
>> Any idea what I could be doing wrong??  Should I be getting the jars from
>> somewhere else??
>>
>> Thanks
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
>
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html