Using Image J to create a double clickable application

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

Using Image J to create a double clickable application

otills
Hi,  I am trying to use Image J to develop an educational resource whereby students will be presented with a GUI which allows them to choose a treatment, this will then call up appropriate images sequences which they will then perform measurements (size/count) using. These measurements will be entered into a table and a plot facility will allow them to visualise the results of their experiment.

I had originally intended to do this using plugins (and have made good progress doing so thanks to help from people on this list), however ideally I really need a stand-alone double clickable application with only my GUI visible. For this reason I guess I have to try and make my own application as opposed to plugins within Image J. I'm quite inexperienced with programming and therefore I am in need of some guidance about how best to achieve this.

I have imported ij.jar into my Netbeans application which contains my application classes, however I am unsure about what else I need to do in order to get the same ij functionality I get from running my classes as a plugin (currently my call to open an Image Stack isn't working - I'm getting a blank window). I have found information online about the main ij class and how to modify this for use in a stand-alone application, but I don't understand how to incorporate this into my application.

So specifically - what do I need to do to get ij functionality inside my own stand-alone application?

Any and all advice appreciated,

Oli

Dr Oliver Tills
Post-doctoral researcher
614 Davy Building, Marine Biology and Ecology Research Centre,
Plymouth University, Devon, PL4 8AA, UK
Tel. +44(0)1752 584598
e-mail: [hidden email]<mailto:[hidden email]>

www.vimeo.com/channels/embryonicdevelopment<http://www.vimeo.com/channels/embryonicdevelopment>
Video of aquatic animals developing in our lab


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

Re: Using Image J to create a double clickable application

otills
An update on this question - I can open a single image using:

 
Opener opener = new Opener();
ImagePlus imp = opener.openImage("/Users/otills/Desktop/Two/1.tif");
imp.show();

But how can I open a stack? I've spent ages trying to figure this out but
have got no where so am in desperate need of advice..

Cheers,
Oli




On 28/02/2013 17:49, "Oliver Tills" <[hidden email]> wrote:

>Hi,  I am trying to use Image J to develop an educational resource
>whereby students will be presented with a GUI which allows them to choose
>a treatment, this will then call up appropriate images sequences which
>they will then perform measurements (size/count) using. These
>measurements will be entered into a table and a plot facility will allow
>them to visualise the results of their experiment.
>
>I had originally intended to do this using plugins (and have made good
>progress doing so thanks to help from people on this list), however
>ideally I really need a stand-alone double clickable application with
>only my GUI visible. For this reason I guess I have to try and make my
>own application as opposed to plugins within Image J. I'm quite
>inexperienced with programming and therefore I am in need of some
>guidance about how best to achieve this.
>
>I have imported ij.jar into my Netbeans application which contains my
>application classes, however I am unsure about what else I need to do in
>order to get the same ij functionality I get from running my classes as a
>plugin (currently my call to open an Image Stack isn't working - I'm
>getting a blank window). I have found information online about the main
>ij class and how to modify this for use in a stand-alone application, but
>I don't understand how to incorporate this into my application.
>
>So specifically - what do I need to do to get ij functionality inside my
>own stand-alone application?
>
>Any and all advice appreciated,
>
>Oli
>
>Dr Oliver Tills
>Post-doctoral researcher
>614 Davy Building, Marine Biology and Ecology Research Centre,
>Plymouth University, Devon, PL4 8AA, UK
>Tel. +44(0)1752 584598
>e-mail: [hidden email]<mailto:[hidden email]>
>
>www.vimeo.com/channels/embryonicdevelopment<http://www.vimeo.com/channels/
>embryonicdevelopment>
>Video of aquatic animals developing in our lab
>
>
>--
>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: Using Image J to create a double clickable application

Michael Schmid
Hi Oli,

you can try Plugins>Macros>Record, with 'Plugin' set in the title bar.
This will usually tell you the code that you execute by a command in the
menu.
Sometimes, you will get some code that does more than what you want (e.g.
display the image), so you will have to dig into the source code of that
function to extract what you need.

Part 2 of the answer: opener.openImage should be able to open stacks that
have been saved as tiff. If it's a stack, the ImagePlus will have several
slices numbered 1... nSlices.
If you want to open an image sequence as a stack, Plugins>Utilities>Find
Commands will show you that ij.plugin.FolderOpener is a good starting
point.

Michael
___________________________________________________________________

On Fri, March 1, 2013 19:31, Oliver Tills wrote:

> An update on this question - I can open a single image using:
>
>
> Opener opener = new Opener();
> ImagePlus imp = opener.openImage("/Users/otills/Desktop/Two/1.tif");
> imp.show();
>
> But how can I open a stack? I've spent ages trying to figure this out but
> have got no where so am in desperate need of advice..
>
> Cheers,
> Oli
>
>
>
>
> On 28/02/2013 17:49, "Oliver Tills" <[hidden email]> wrote:
>
>>Hi,  I am trying to use Image J to develop an educational resource
>>whereby students will be presented with a GUI which allows them to choose
>>a treatment, this will then call up appropriate images sequences which
>>they will then perform measurements (size/count) using. These
>>measurements will be entered into a table and a plot facility will allow
>>them to visualise the results of their experiment.
>>
>>I had originally intended to do this using plugins (and have made good
>>progress doing so thanks to help from people on this list), however
>>ideally I really need a stand-alone double clickable application with
>>only my GUI visible. For this reason I guess I have to try and make my
>>own application as opposed to plugins within Image J. I'm quite
>>inexperienced with programming and therefore I am in need of some
>>guidance about how best to achieve this.
>>
>>I have imported ij.jar into my Netbeans application which contains my
>>application classes, however I am unsure about what else I need to do in
>>order to get the same ij functionality I get from running my classes as a
>>plugin (currently my call to open an Image Stack isn't working - I'm
>>getting a blank window). I have found information online about the main
>>ij class and how to modify this for use in a stand-alone application, but
>>I don't understand how to incorporate this into my application.
>>
>>So specifically - what do I need to do to get ij functionality inside my
>>own stand-alone application?
>>
>>Any and all advice appreciated,
>>
>>Oli
>>
>>Dr Oliver Tills
>>Post-doctoral researcher
>>614 Davy Building, Marine Biology and Ecology Research Centre,
>>Plymouth University, Devon, PL4 8AA, UK
>>Tel. +44(0)1752 584598
>>e-mail: [hidden email]<mailto:[hidden email]>
>>
>>www.vimeo.com/channels/embryonicdevelopment<http://www.vimeo.com/channels/
>>embryonicdevelopment>
>>Video of aquatic animals developing in our lab
>>
>>
>>--
>>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: Using Image J to create a double clickable application

otills
Hi Michael,

> Hi Oli,
>
> you can try Plugins>Macros>Record, with 'Plugin' set in the title bar.
> This will usually tell you the code that you execute by a command in the
> menu.
> Sometimes, you will get some code that does more than what you want (e.g.
> display the image), so you will have to dig into the source code of that
> function to extract what you need.
>

> Part 2 of the answer: opener.openImage should be able to open stacks that
> have been saved as tiff. If it's a stack, the ImagePlus will have several
> slices numbered 1... nSlices.
> If you want to open an image sequence as a stack, Plugins>Utilities>Find
> Commands will show you that ij.plugin.FolderOpener is a good starting
> point.
>
Thanks for this advice.

For my project it would make much more sense for me to use plugins rather than develop an application using Image j libraries as I think the latter is probably beyond my grasp. However, i want Image j to effectively be hidden. I've read about hiding the Image J window, but would also want the parts of the program visible to the user e.g installer and icons to be renamed as something unique to the project (potentially with different icon also). I'm using a Netbeans free form project and was wondering firstly whether what I describe is possible and if so whether someone can provide me some guidance.

> Michael

Thanks again,
Oli

> ___________________________________________________________________
>
> On Fri, March 1, 2013 19:31, Oliver Tills wrote:
>> An update on this question - I can open a single image using:
>>
>>
>> Opener opener = new Opener();
>> ImagePlus imp = opener.openImage("/Users/otills/Desktop/Two/1.tif");
>> imp.show();
>>
>> But how can I open a stack? I've spent ages trying to figure this out but
>> have got no where so am in desperate need of advice..
>>
>> Cheers,
>> Oli
>>
>>
>>
>>
>> On 28/02/2013 17:49, "Oliver Tills" <[hidden email]> wrote:
>>
>>> Hi,  I am trying to use Image J to develop an educational resource
>>> whereby students will be presented with a GUI which allows them to choose
>>> a treatment, this will then call up appropriate images sequences which
>>> they will then perform measurements (size/count) using. These
>>> measurements will be entered into a table and a plot facility will allow
>>> them to visualise the results of their experiment.
>>>
>>> I had originally intended to do this using plugins (and have made good
>>> progress doing so thanks to help from people on this list), however
>>> ideally I really need a stand-alone double clickable application with
>>> only my GUI visible. For this reason I guess I have to try and make my
>>> own application as opposed to plugins within Image J. I'm quite
>>> inexperienced with programming and therefore I am in need of some
>>> guidance about how best to achieve this.
>>>
>>> I have imported ij.jar into my Netbeans application which contains my
>>> application classes, however I am unsure about what else I need to do in
>>> order to get the same ij functionality I get from running my classes as a
>>> plugin (currently my call to open an Image Stack isn't working - I'm
>>> getting a blank window). I have found information online about the main
>>> ij class and how to modify this for use in a stand-alone application, but
>>> I don't understand how to incorporate this into my application.
>>>
>>> So specifically - what do I need to do to get ij functionality inside my
>>> own stand-alone application?
>>>
>>> Any and all advice appreciated,
>>>
>>> Oli
>>>
>>> Dr Oliver Tills
>>> Post-doctoral researcher
>>> 614 Davy Building, Marine Biology and Ecology Research Centre,
>>> Plymouth University, Devon, PL4 8AA, UK
>>> Tel. +44(0)1752 584598
>>> e-mail: [hidden email]<mailto:[hidden email]>
>>>
>>> www.vimeo.com/channels/embryonicdevelopment<http://www.vimeo.com/channels/
>>> embryonicdevelopment>
>>> Video of aquatic animals developing in our lab
>>>
>>>
>>> --
>>> 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

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

Re: Using Image J to create a double clickable application

gerrit
In reply to this post by otills
Hi Oliver,

I recommend you to use Jerome Mutterers Action Bar plugin (http://imagejdocu.tudor.lu/doku.php?id=plugin:utilities:action_bar:start).
By calling this plugin from the startupmacros.txt using macro "AutoRun" it automatically starts  when you open ImageJ.
You also can hide the ImageJ menu using IJ.getInstance().setVisible(false);
I used this myself in my phenotyping application, including a toggle button to show/hide the ImageJ menu, and a quit button.
(http://www.wageningenur.nl/en/show/An-ImageJ-plugin-for-plant-variety-testing.htm)

kindly,
Gerrit.

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