Global scale is reset (BUG)

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

Global scale is reset (BUG)

jumpfunky
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
Reply | Threaded
Open this post in threaded view
|

Re: Global scale is reset (BUG)

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
Reply | Threaded
Open this post in threaded view
|

Re: Global scale is reset (BUG)

jumpfunky
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
Reply | Threaded
Open this post in threaded view
|

Re: Global scale is reset (BUG)

Herbie
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
Reply | Threaded
Open this post in threaded view
|

Re: Global scale is reset (BUG)

Jan Eglinger
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
Reply | Threaded
Open this post in threaded view
|

Re: Global scale is reset (BUG)

jumpfunky
In reply to this post by Herbie
Dear Herbi,
thanks for the information, but this is not what I'm looking for.

I'm looking for a way to determine in a macro if the scale was set
globally or locally. Unfortunately I can't use the title, because
getTitle() does not contain the "(G)" which means there is no way to
detect it by parsing the title. So in short, I want to do the following
in my macro:

if(isGlobalScale){
        do this
}
else{
        do that
}

Any ideas for determining 'isGlobalScale'?


Cheers,
Thorsten

Am Freitag, den 18.03.2016, 10:43 +0100 schrieb Herbie:

> 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
Reply | Threaded
Open this post in threaded view
|

Re: Global scale is reset (BUG)

Herbie
In reply to this post by Jan Eglinger
Jan,

thank you for telling me what to do.

I think that somebody who is using ImageJ since years knows where to
find the User Guide, namely here

<http://rsb.info.nih.gov/ij/docs/index.html>

and even someone who is new to ImageJ will have a look at the ImageJ website

<http://rsb.info.nih.gov/ij/>

and look for it...

Regarding the macro question, I agree that the Boolean appears to be
inaccessible from a macro, but the calibration of course is, e.g. from
the image info.

Greetings

Herbie

::::::::::::::::::::::::::::::::::::::::::
Am 18.03.16 um 11:10 schrieb Jan Eglinger:

> 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
Reply | Threaded
Open this post in threaded view
|

Re: Global scale is reset (BUG)

Herbie
In reply to this post by jumpfunky
Dear Thorsten,

what may help is to set the Boolean from a macro instead of asking for
its state:

run("Set Scale...", "global");
run("Set Scale...", " ");

Best

Herbie

:::::::::::::::::::::::::::::::::::::::::::::
Am 18.03.16 um 11:17 schrieb Thorsten Wagner:

> Dear Herbi,
> thanks for the information, but this is not what I'm looking for.
>
> I'm looking for a way to determine in a macro if the scale was set
> globally or locally. Unfortunately I can't use the title, because
> getTitle() does not contain the "(G)" which means there is no way to
> detect it by parsing the title. So in short, I want to do the following
> in my macro:
>
> if(isGlobalScale){
> do this
> }
> else{
> do that
> }
>
> Any ideas for determining 'isGlobalScale'?
>
>
> Cheers,
> Thorsten
>
> Am Freitag, den 18.03.2016, 10:43 +0100 schrieb Herbie:
>> 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
Reply | Threaded
Open this post in threaded view
|

Re: Global scale is reset (BUG)

Michael Schmid
In reply to this post by jumpfunky
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
 >
Reply | Threaded
Open this post in threaded view
|

Re: Global scale is reset (BUG)

Herbie
In reply to this post by jumpfunky
Dear Thorsten,

to make the situation a bit more concrete, here is a macro that does
what I think you want.

newImage("A", "8-bit ramp", 128, 128, 1);
run("Duplicate...", "title=B");
run("Rotate 90 Degrees Right");
run("Set Scale...", "distance=1 known=5 unit=nm global");
selectWindow("A");
run("Set Scale...", "distance=0 known=0 pixel=1 unit=pixel");

In the end image "B" is scaled (640x640nm) and image "A" is in pixels.

Can you confirm this behaviour?

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
Reply | Threaded
Open this post in threaded view
|

Re: Global scale is reset (BUG)

Rasband, Wayne (NIH/NIMH) [E]
In reply to this post by jumpfunky
> On Mar 18, 2016, at 5:25 AM, Thorsten Wagner <[hidden email]> 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?

Upgrade to the latest ImageJ daily build (1.50i9) and you can use the is("global calibration”) macro function to find out if the current scale is global.

-wayne


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

Re: Global scale is reset (BUG)

jumpfunky
Dear Wayne,

thank you very much for this feature!

@Herbi: Thanks four efforts! Your macro clarified an important point
for me: That I can remove the the scale in B and keep it in A but not
the other way around. However, in my case I do not know which image the
user will choose. What I like to do is shortly remove the scale and
then set it back to original values (which includes the global option).

Thanks again for your help!

Cheers,
Thorsten

Am Sonntag, den 20.03.2016, 03:00 +0000 schrieb Rasband, Wayne
(NIH/NIMH) [E]:

> >
> > On Mar 18, 2016, at 5:25 AM, Thorsten Wagner <wagner@BIOMEDICAL-IMA
> > GING.DE> 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?
> Upgrade to the latest ImageJ daily build (1.50i9) and you can use the
> is("global calibration”) macro function to find out if the current
> scale is global.
>
> -wayne
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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