Re: Global scale is reset (BUG)

Posted by Jan Eglinger on
URL: http://imagej.273.s1.nabble.com/Global-scale-is-reset-BUG-tp5015924p5015928.html

Herbie,

since you are already citing the user guide, why don't you also link to
it? We're in the internet, after all:

http://imagej.net/docs/guide/146-30.html#infobox:GlobalCal


Regarding the original question, I think you're misunderstanding
Thorsten, because he explicitly asked if there is a way to *check* from
a macro whether the global flag is set or not. I don't see how your
citation of the user guide helps answering this question, and I don't
know of a way to read the flag from the macro language.

You can however get the global calibration from the ImagePlus class
using any full-fledged scripting language:

     // @ImagePlus imp
     global = imp.getGlobalCalibration()

According to the javadoc [1], this will return the system-wide
calibration, or null if global calibration is unset.

Best,
Jan

[1]: http://javadoc.imagej.net/ImageJ1/index.html?ij/ImagePlus.html


On 18.03.2016 10:43, Herbie wrote:

> Thorsten,
>
> it's all written in the User-Guide:
>
> "XXIII Global Calibrations
>
> Calibration settings related to spatial (pixel width, height and voxel
> depth), temporal (frame interval) and luminance (brightness) information
> can be set globally, i.e., can be applied to all images opened during
> the current session instead of just the active image. The Global flag
> can be set in three dialog prompts:
>
> 1. Image . Properties. . . [P] (pixel width, height, voxel depth, frame
> interval)
> 2. Analyze . Set Scale. . . (pixel width and height)
> 3. Analyze . Calibrate. . . (pixel intensity)
>
> Once Global calibration is set, a ‘(G)’ is displayed in all image titles
> until ImageJ is closed. A warning message is displayed when a calibrated
> image with conflicting calibration is opened and the Global option is
> enabled.
> Choose Disable Global Calibration to stop using global settings or
> Disable these Messages to keep respecting global settings, ignoring the
> calibration of the newly open image."
>
> HTH
>
> Herbie
>
> :::::::::::::::::::::::::::::::::::::::::::::
> Am 18.03.16 um 10:25 schrieb Thorsten Wagner:
>> 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

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