Help: Macros behave differently on different PCs

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

Help: Macros behave differently on different PCs

Straub, Volko A. (Dr.)
Dear All,

I have encountered a slight problem with a macro that I have written to help with some data analysis (mainly thresholding of images, followed by particle analysis). The macro is working fine on a number of PCs both on the 32-bit and 64-bit versions of ImageJ. However, we have one particular PC (Windows XP) on which the macro code appears to behave differently and produces unexpected results. In order to get to the bottom of it, I tried to re-install ImageJ and run it from a USB flash drive, but it still produced the same odd results. It is quite tricky to describe what actually happens, but certain operations appear to produce 'inverted' images. So, in order to get the macro to work as expected on that particular PC I have to 'Invert' (or in some cases 'Invert LUT'  ) the image before certain commands. However, when I then try to use the macro on another PC, it obviously doesn't work anymore.

The version of ImageJ I have installed on my USB flash drive is ImageJ 1.47i with Java 1.6.0_24 (32-bit), and as I said before this works fine one some PCs (running either Windows XP 32-bit, Windows 7 32-bit or Windows 7 64-bit), but not on one PC running Windows XP 32-bit. I don't understand how the same ImageJ version run from a flash drive can produce different behaviours on different PCs. I would very much appreciate it if anybody could shed some light on this issue as even a new installation of ImageJ on the affected PC did not resolve the issue.

Thanks for your help,

Volko

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

Re: Help: Macros behave differently on different PCs

Michael Schmid
Hi Volko,

two possibilities:

(1) Different options:
Especially the 'black background' Process>Binary>Options is important.

If your macros rely on this, it makes sense to have a line like the following in your macros (omit 'black' if binary images should have a white background):
  run("Options...", "iterations=1 count=1 black pad edm=Overwrite");

You can also add this line to StartupMacros.txt, to make sure you always get the same behavior after startup, independent of previous user settings.

There might be also other options that I am not aware of.
If the above does not solve the problem, make sure that the preferences are the same (File IJ_Prefs.txt). With recent versions of ImageJ (1.46q and later), this file is in a .imagej folder in the user directory.

(2) There was a bug in ImageJ until 1.46h that could (in very rare cases) cause a problem with the decision whether an image has an inverted background or not. This is fixed in 1.47i. Use Help>Upgrade ImageJ.

Michael
________________________________________________________________
On Feb 12, 2013, at 17:01, Straub, Volko (Dr.) wrote:

> Dear All,
>
> I have encountered a slight problem with a macro that I have written to help with some data analysis (mainly thresholding of images, followed by particle analysis). The macro is working fine on a number of PCs both on the 32-bit and 64-bit versions of ImageJ. However, we have one particular PC (Windows XP) on which the macro code appears to behave differently and produces unexpected results. In order to get to the bottom of it, I tried to re-install ImageJ and run it from a USB flash drive, but it still produced the same odd results. It is quite tricky to describe what actually happens, but certain operations appear to produce 'inverted' images. So, in order to get the macro to work as expected on that particular PC I have to 'Invert' (or in some cases 'Invert LUT'  ) the image before certain commands. However, when I then try to use the macro on another PC, it obviously doesn't work anymore.
>
> The version of ImageJ I have installed on my USB flash drive is ImageJ 1.47i with Java 1.6.0_24 (32-bit), and as I said before this works fine one some PCs (running either Windows XP 32-bit, Windows 7 32-bit or Windows 7 64-bit), but not on one PC running Windows XP 32-bit. I don't understand how the same ImageJ version run from a flash drive can produce different behaviours on different PCs. I would very much appreciate it if anybody could shed some light on this issue as even a new installation of ImageJ on the affected PC did not resolve the issue.
>
> Thanks for your help,
>
> Volko

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

Re: Help: Macros behave differently on different PCs

dscho
In reply to this post by Straub, Volko A. (Dr.)
Hi Volko,

On Tue, 12 Feb 2013, Straub, Volko (Dr.) wrote:

> I have encountered a slight problem with a macro that I have written to
> help with some data analysis (mainly thresholding of images, followed by
> particle analysis). The macro is working fine on a number of PCs both on
> the 32-bit and 64-bit versions of ImageJ. However, we have one
> particular PC (Windows XP) on which the macro code appears to behave
> differently and produces unexpected results. In order to get to the
> bottom of it, I tried to re-install ImageJ and run it from a USB flash
> drive, but it still produced the same odd results. It is quite tricky to
> describe what actually happens, but certain operations appear to produce
> 'inverted' images. So, in order to get the macro to work as expected on
> that particular PC I have to 'Invert' (or in some cases 'Invert LUT'  )
> the image before certain commands. However, when I then try to use the
> macro on another PC, it obviously doesn't work anymore.

I guess this is the famous Binary options problem:

http://rsbweb.nih.gov/ij/docs/guide/146-29.html#sub:BinaryOptions...

I would assume that that setting differs between your setups, and you need
to record setting it and make that an explicit statement in your macro.

Ciao,
Johannes

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

Re: Help: Macros behave differently on different PCs

Straub, Volko A. (Dr.)
In reply to this post by Michael Schmid
Dear Michael & Johannes,

Thanks for your fast reply. Yes, you were right - changing the binary
option on the affected PC solved the problem. I was just a bit surprised
that the problem still occured when I run ImageJ of a USB flash drive,
but thinking about it I guess the flash drive version was actually
pointing to an ImageJ preference file on the PC rather than the flash
drive, which was used at startup.

Anyway, thanks for your help - it solved my headache.

Best regards,
Volko


On 12/02/2013 16:34, Michael Schmid wrote:

> Hi Volko,
>
> two possibilities:
>
> (1) Different options:
> Especially the 'black background' Process>Binary>Options is important.
>
> If your macros rely on this, it makes sense to have a line like the following in your macros (omit 'black' if binary images should have a white background):
>    run("Options...", "iterations=1 count=1 black pad edm=Overwrite");
>
> You can also add this line to StartupMacros.txt, to make sure you always get the same behavior after startup, independent of previous user settings.
>
> There might be also other options that I am not aware of.
> If the above does not solve the problem, make sure that the preferences are the same (File IJ_Prefs.txt). With recent versions of ImageJ (1.46q and later), this file is in a .imagej folder in the user directory.
>
> (2) There was a bug in ImageJ until 1.46h that could (in very rare cases) cause a problem with the decision whether an image has an inverted background or not. This is fixed in 1.47i. Use Help>Upgrade ImageJ.
>
> Michael
> ________________________________________________________________
> On Feb 12, 2013, at 17:01, Straub, Volko (Dr.) wrote:
>
>> Dear All,
>>
>> I have encountered a slight problem with a macro that I have written to help with some data analysis (mainly thresholding of images, followed by particle analysis). The macro is working fine on a number of PCs both on the 32-bit and 64-bit versions of ImageJ. However, we have one particular PC (Windows XP) on which the macro code appears to behave differently and produces unexpected results. In order to get to the bottom of it, I tried to re-install ImageJ and run it from a USB flash drive, but it still produced the same odd results. It is quite tricky to describe what actually happens, but certain operations appear to produce 'inverted' images. So, in order to get the macro to work as expected on that particular PC I have to 'Invert' (or in some cases 'Invert LUT'  ) the image before certain commands. However, when I then try to use the macro on another PC, it obviously doesn't work anymore.
>>
>> The version of ImageJ I have installed on my USB flash drive is ImageJ 1.47i with Java 1.6.0_24 (32-bit), and as I said before this works fine one some PCs (running either Windows XP 32-bit, Windows 7 32-bit or Windows 7 64-bit), but not on one PC running Windows XP 32-bit. I don't understand how the same ImageJ version run from a flash drive can produce different behaviours on different PCs. I would very much appreciate it if anybody could shed some light on this issue as even a new installation of ImageJ on the affected PC did not resolve the issue.
>>
>> Thanks for your help,
>>
>> Volko
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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