suggestion needed: macros or plugins?

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

suggestion needed: macros or plugins?

Mario Faretta
Hi all,
I have written a macro code to perform image analysis (particle counting
and measurement, foci identification, measurement and assignment to
single cells,..) on images in batch. It worked fine till 1.43 ImageJ
release but then troubles started. The feeling is that the strange
behaviour is associated to the setBatchMode mode of operation in some way.
Are there big changes in the structure of ImageJ from 1.44 on?
  At this point however the macro is composed of thousands of lines and
it is not so easy to find exactly where the strange behaviour originate
from...I am not a programmer and no expertise in writing plugins but at
this point I have the suspect that the only way to remove the risk of
getting into the same troubles is to translate the macro into a
plugin...is it correct? I also noticed that macros language can present
different results when run on different platforms (e.g. Mac Os X versus
Windows), is it correct in your experience?
Is there any tool or trick to translate macros into plugins?
Sorry for boring with a so general question
any comment will be very useful, thanks
Mario

--
---PLEASE Note the change in telephone number---

--
Mario Faretta
Department of Experimental Oncology
European Institute of Oncology
c/o IFOM-IEO Campus for Oncogenomics
via Adamello 16 20139 Milan Italy
Phone: ++39-0294375027
email: [hidden email]
http://www.ifom-ieo-campus.it
Reply | Threaded
Open this post in threaded view
|

Re: suggestion needed: macros or plugins?

Gabriel Landini
On Monday 06 Jun 2011 10:04:12 Mario Faretta wrote:
> I have written a macro code to perform image analysis (particle counting
> and measurement, foci identification, measurement and assignment to
> single cells,..) on images in batch. It worked fine till 1.43 ImageJ
> release but then troubles started. The feeling is that the strange
> behaviour is associated to the setBatchMode mode of operation in some way.

Why don't you switch batch mode off and run the plugin. It might be slower,
but you will be able to see if there are any errors reported.

One candidate for macros behaving bad is that the wrong image gets processed.
Can you go through the macro checking that the right image is being used?

> plugin...is it correct? I also noticed that macros language can present
> different results when run on different platforms (e.g. Mac Os X versus
> Windows), is it correct in your experience?

Do you have a simple macro example to show this?
I would start:
Are the various platforms using the same version of the ij.jar?
Are the Options settings the same (specially the Black background in the
Binary Options?)


Cheers
Gabriel
Reply | Threaded
Open this post in threaded view
|

Re: suggestion needed: macros or plugins?

Nathaniel Ryckman
In reply to this post by Mario Faretta
SOLUTION:

Download an old copy of imageJ and keep it on a DVD or somewhere safe just in case someone accidentally updates the imageJ software.

http://imagej.nih.gov/ij/download/osx/
http://imagej.nih.gov/ij/download/win32/
http://imagej.nih.gov/ij/download/linux/


EXPLANATION & RECOMMENDATION:

In general, I have noticed that plugins are more reliable and personally would not trust the Macro language unless you were doing something relatively simple.

You see, programmers start with very tiny building blocks and attempt to create higher level building blocks from those tiny building blocks.

For example, this is the hierarchy when it comes to the plugin language:

Machine Code -> Assembly Language -> Java

On the other hand, here is the hierarchy when it comes to the macro language:

Machine Code -> Assembly Language -> Java -> Macro Language

As you can see the Macro language is created from Java; thus, the macro language is more complex and consequently has the opportunity to introduce more error into the system.

Mario Faretta wrote
Hi all,
I have written a macro code to perform image analysis (particle counting
and measurement, foci identification, measurement and assignment to
single cells,..) on images in batch. It worked fine till 1.43 ImageJ
release but then troubles started. The feeling is that the strange
behaviour is associated to the setBatchMode mode of operation in some way.
Are there big changes in the structure of ImageJ from 1.44 on?
  At this point however the macro is composed of thousands of lines and
it is not so easy to find exactly where the strange behaviour originate
from...I am not a programmer and no expertise in writing plugins but at
this point I have the suspect that the only way to remove the risk of
getting into the same troubles is to translate the macro into a
plugin...is it correct? I also noticed that macros language can present
different results when run on different platforms (e.g. Mac Os X versus
Windows), is it correct in your experience?
Is there any tool or trick to translate macros into plugins?
Sorry for boring with a so general question
any comment will be very useful, thanks
Mario

--
---PLEASE Note the change in telephone number---

--
Mario Faretta
Department of Experimental Oncology
European Institute of Oncology
c/o IFOM-IEO Campus for Oncogenomics
via Adamello 16 20139 Milan Italy
Phone: ++39-0294375027
email: [hidden email]
http://www.ifom-ieo-campus.it