ImageJ2 used for developing stand alone app?

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

ImageJ2 used for developing stand alone app?

Vera Andrejchenko
Dear ImageJ community,

I would like to ask if ImageJ2 can be used as a library for developing stand alone applications, (not only for plugins)?
What I would like to use it is for is for instance:
- reading, writing, accessing pixel values of multidimensional (multispectral) images,
- FFT, histograms, using the Filters (as they are in the ImageJ app)
- Addition, multiplication etc. of image pixel values as they are in the Image Calculator methods (add, divide, multiply...)

What I tried so far is using the .jars from the ImageJ.app and referenced them as external libraries from my project.
But I keep receive error messages related to some of the Services, for example:
When I try the ImageJ class for instating and object and trying to read and show an image I receive:

 java.lang.UnsupportedOperationException: Cannot instantiate more than one DefaultLegacyService
        at net.imagej.legacy.DefaultLegacyService.checkInstance(DefaultLegacyService.java:514)
and
Invalid service: net.imagej.legacy.DefaultLegacyService
        at org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:279)

So I was wondering if I can use ImageJ as an image processing library for my project...

If it is meant for that purposes as well, could you send me some links I can read some how to install/set it up/configure and some getting started tutorials? (For instance reading and displaying an image).

Thanks a lot in advance!

Greetings,
Vera




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

Re: ImageJ2 used for developing stand alone app?

Mark Hiner-2
Hi Vera,

If it is meant for that purposes as well, could you send me some links I
> can read some how to install/set it up/configure and some getting started
> tutorials? (For instance reading and displaying an image).
>

You should start by looking at imagej-tutorials
<https://github.com/imagej/imagej-tutorials/>. Especially the intro to API
<https://github.com/imagej/imagej-tutorials/blob/master/intro-to-imagej-api/src/main/java/IntroToImageJAPI.java>.
The rest of the tutorials contain further introductions and explanations,
and demonstrate several of the tasks you mentioned.

 java.lang.UnsupportedOperationException: Cannot instantiate more than one
> DefaultLegacyService
> at
> net.imagej.legacy.DefaultLegacyService.checkInstance(DefaultLegacyService.java:514)
>

This looks like a problem that would be easy to diagnose with a full stack
trace and some sample code showing how you are constructing and using the
ImageJ objects. The cause of these exceptions may also be obvious after
studying the tutorial examples (unless, of course, it's actually a bug in
the LegacyService).

What I tried so far is using the .jars from the ImageJ.app and referenced
> them as external libraries from my project.
>

ImageJ2 and its components are fully Mavenized <http://maven.apache.org/>.
If you want to use ImageJ2 as a library, I personally believe your life
will be much easier if your project also uses Maven to manage its
dependencies.

But on a more significant level - what are you trying to accomplish by
creating a completely stand alone application that uses IJ2?

ImageJ2 was designed to be a fully extensible platform.. where any behavior
can be overridden via a robust plugin mechanism. Even the UI is meant to be
pluggable. Using Fiji <http://fiji.sc/Fiji>, these extensions can be easily
distributed to the already-installed user (see update sites
<http://fiji.sc/How_to_set_up_and_populate_an_update_site>).

So you could be saving yourself significant effort by using the existing
ImageJ2 framework. You would also be doing a service to the ImageJ
community, both for users via your eventual product and developers by
helping to test and refine the ImageJ2 API.

At the least, it would help us core IJ2 developers to understand why you
would rather create a new application that uses the API than develop
extensions for the areas relevant to you.

Thanks for the interest,
Mark


On Wed, Jul 30, 2014 at 10:42 AM, Vera Andrejchenko <
[hidden email]> wrote:

> Dear ImageJ community,
>
> I would like to ask if ImageJ2 can be used as a library for developing
> stand alone applications, (not only for plugins)?
> What I would like to use it is for is for instance:
> - reading, writing, accessing pixel values of multidimensional
> (multispectral) images,
> - FFT, histograms, using the Filters (as they are in the ImageJ app)
> - Addition, multiplication etc. of image pixel values as they are in the
> Image Calculator methods (add, divide, multiply...)
>
> What I tried so far is using the .jars from the ImageJ.app and referenced
> them as external libraries from my project.
> But I keep receive error messages related to some of the Services, for
> example:
> When I try the ImageJ class for instating and object and trying to read
> and show an image I receive:
>
>  java.lang.UnsupportedOperationException: Cannot instantiate more than one
> DefaultLegacyService
>         at
> net.imagej.legacy.DefaultLegacyService.checkInstance(DefaultLegacyService.java:514)
> and
> Invalid service: net.imagej.legacy.DefaultLegacyService
>         at
> org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:279)
>
> So I was wondering if I can use ImageJ as an image processing library for
> my project...
>
> If it is meant for that purposes as well, could you send me some links I
> can read some how to install/set it up/configure and some getting started
> tutorials? (For instance reading and displaying an image).
>
> Thanks a lot in advance!
>
> Greetings,
> Vera
>
>
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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