Re: Global scale is reset (BUG)

Posted by Michael Schmid on
URL: http://imagej.273.s1.nabble.com/Global-scale-is-reset-BUG-tp5015924p5015933.html

Hi Thorsten,

currently there is no way to determine in a macro whether there is a
global Calibration. You would need a script language (JavaScript,
Python) that can access Java methods, to test whether
getGlobalCalibration() of the ImagePlus returns null.

[Note that Plots have their own calibration, independent of any global
calibration (they call setIgnoreGlobalCalibration of the ImagePlus class).]

Michael
________________________________________________________________
On 2016-03-18 10:25, Thorsten Wagner wrote:
 > Dear Herbie,
 >
 > thank you for your fast response.
 >
 > Is there a way to find out in a macro if the current scale is global?
 > I have seen that in the title a (G) is added, but is this the only way
 > I can check it?
 >
 > Cheers,
 > Thorsten
 > Am Freitag, den 18.03.2016, 09:59 +0100 schrieb Herbie:
 >> Thorsten,
 >>
 >> The User-Guide tells us:
 >>
 >> "When Global is checked, the scale defined in this dialog is used
 >> for
 >> all opened images during the current session instead of just the
 >> active
 >> image, see XXIII Global Calibrations."
 >>
 >> "current session" is what matters here...
 >>
 >> Best
 >>
 >> Herbie
 >>
 >> :::::::::::::::::::::::::::::::::::::::::::::
 >> Am 18.03.16 um 09:18 schrieb Thorsten Wagner:
 >>>
 >>> Dear List,
 >>>
 >>> given the images A and B.
 >>>
 >>> When I set the global scale for an image A via
 >>>
 >>> run("Set Scale...", "known=5 unit=nm global");
 >>>
 >>> and then reset the scale only for A via
 >>> selectWindow("A");
 >>> run("Set Scale...", "distance=0 known=0 pixel=1 unit=pixel");
 >>>
 >>> then the scale is also reset for B.
 >>>
 >>> This is not what I've expected.
 >>>
 >>> Is that for purpose or a bug?
 >>>
 >>> Cheers,
 >>> Thorsten
 >>>
 >>> --
 >>> 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
 >
--
Michael
________________________________________________________________

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


Hi Thorsten,

currently there is no way to determine in a macro whether there is a
global Calibration. You would need a script language (JavaScript,
Python) that can access Java methods, to test whether
getGlobalCalibration() of the ImagePlus returns null.

[Note that Plots have their own calibration, independent of any global
calibration (they call setIgnoreGlobalCalibration of the ImagePlus class).]

Michael
________________________________________________________________
On 2016-03-18 10:25, Thorsten Wagner wrote:
 > Dear Herbie,
 >
 > thank you for your fast response.
 >
 > Is there a way to find out in a macro if the current scale is global?
 > I have seen that in the title a (G) is added, but is this the only way
 > I can check it?
 >
 > Cheers,
 > Thorsten
 > Am Freitag, den 18.03.2016, 09:59 +0100 schrieb Herbie:
 >> Thorsten,
 >>
 >> The User-Guide tells us:
 >>
 >> "When Global is checked, the scale defined in this dialog is used
 >> for
 >> all opened images during the current session instead of just the
 >> active
 >> image, see XXIII Global Calibrations."
 >>
 >> "current session" is what matters here...
 >>
 >> Best
 >>
 >> Herbie
 >>
 >> :::::::::::::::::::::::::::::::::::::::::::::
 >> Am 18.03.16 um 09:18 schrieb Thorsten Wagner:
 >>>
 >>> Dear List,
 >>>
 >>> given the images A and B.
 >>>
 >>> When I set the global scale for an image A via
 >>>
 >>> run("Set Scale...", "known=5 unit=nm global");
 >>>
 >>> and then reset the scale only for A via
 >>> selectWindow("A");
 >>> run("Set Scale...", "distance=0 known=0 pixel=1 unit=pixel");
 >>>
 >>> then the scale is also reset for B.
 >>>
 >>> This is not what I've expected.
 >>>
 >>> Is that for purpose or a bug?
 >>>
 >>> Cheers,
 >>> Thorsten
 >>>
 >>> --
 >>> 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
 >