Decimal Fractions in ResultsTable

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

Decimal Fractions in ResultsTable

David Webster
All,

I am trying to create/display a ResultsTable containing  or showing
decimal fractions. But, all I get are ints. I am doing something like

ResultsTable rt = new ResultsTable();
double x   = 1.0;
rt.addValue("x", x);
rt.show("My Table");

But, I don't get the x value as 1.0, only 1. How can I get the displayed
and/or "save'ed" table to have doubles in it? I notice that if rt was a
systems result
table created via "ResultsTable rt =
ResultsTable.getResultsTable()", then I get decimals freactions rather
than ints.

David Webster
Reply | Threaded
Open this post in threaded view
|

Re: Decimal Fractions in ResultsTable

Michael Schmid
Hi David,

what about this?

ResultsTable.setPrecision(int precision)
Sets the number of digits to the right of decimal point.

Michael
________________________________________________________________

On 18 Mar 2010, at 03:00, David William Webster wrote:

> All,
>
> I am trying to create/display a ResultsTable containing  or showing
> decimal fractions. But, all I get are ints. I am doing something like
>
> ResultsTable rt = new ResultsTable();
> double x   = 1.0;
> rt.addValue("x", x);
> rt.show("My Table");
>
> But, I don't get the x value as 1.0, only 1. How can I get the  
> displayed
> and/or "save'ed" table to have doubles in it? I notice that if rt  
> was a
> systems result
> table created via "ResultsTable rt =
> ResultsTable.getResultsTable()", then I get decimals freactions rather
> than ints.
>
> David Webster
Reply | Threaded
Open this post in threaded view
|

Binary dilation instead erosion

Norbert Vischer-2
I have a strange behaviour that only appears on one of my computers.
If I run the macro below, only a few of the larger spots will survive erosion - this is what I expect.

However, on one computer (OS X, 32 or 64 bit), the spots are dilated, not eroded. This happens even if I trash ImageJ and install a completely new version 1.43, without  custom plugins.


In all cases, spots are black(=0) on white background(=255).

Anyone who can explain this?

Norbert


                        run("Cell Colony (31K)");
                        run("Duplicate...", "title=tmp");
                        setThreshold(0, 180);
                        run("Make Binary", "thresholded remaining black");
                        run("Erode");
                        run("Erode");
                        run("Erode");
                        run("Erode");
Reply | Threaded
Open this post in threaded view
|

Re: Binary dilation instead erosion

Volker Baecker
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,
could it be possible that in one case "Black Background" is selected in
Process>Binary>Options and in the other not?
Best regards,
Volker

Norbert Vischer wrote:

> I have a strange behaviour that only appears on one of my computers.
> If I run the macro below, only a few of the larger spots will survive erosion - this is what I expect.
>
> However, on one computer (OS X, 32 or 64 bit), the spots are dilated, not eroded. This happens even if I trash ImageJ and install a completely new version 1.43, without  custom plugins.
>
>
> In all cases, spots are black(=0) on white background(=255).
>
> Anyone who can explain this?
>
> Norbert
>
>
> run("Cell Colony (31K)");
> run("Duplicate...", "title=tmp");
> setThreshold(0, 180);
> run("Make Binary", "thresholded remaining black");
> run("Erode");
> run("Erode");
> run("Erode");
> run("Erode");
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkuiI0sACgkQ0gXPLVKexCcs/wCfQDyY52iX7gU6XhpiIzkkDL3u
6fEAnAi1Pc20dODLd8PhRIVgpT1ci2+u
=S0Uw
-----END PGP SIGNATURE-----

--
passerelle antivirus du campus CNRS de Montpellier
--
Reply | Threaded
Open this post in threaded view
|

Re: Binary dilation instead erosion

Gabriel Landini
In reply to this post by Norbert Vischer-2
Hi Norbert,

On Thursday 18 Mar 2010  14:15:31 you wrote:
> I have a strange behaviour that only appears on one of my computers.
> If I run the macro below, only a few of the larger spots will survive
> erosion - this is what I expect.

Here only 1 seems to survive.

> However, on one computer (OS X, 32 or 64 bit), the spots are dilated, not
> eroded. This happens even if I trash ImageJ and install a completely new
> version 1.43, without  custom plugins.
>
> In all cases, spots are black(=0) on white background(=255).
>
> Anyone who can explain this?

What is the setting of:

Process>Binary>Options...>Black background?

Is it the same in both computers?
Cheers

G.
Reply | Threaded
Open this post in threaded view
|

Re: Binary dilation instead erosion

Norbert Vischer-2
> What is the setting of:
>
> Process>Binary>Options...>Black background?
> G.


Thank you for this advice, it solved the problem.
 - where these preferences stored ?

Norbert
Reply | Threaded
Open this post in threaded view
|

Re: Binary dilation instead erosion

Gabriel Landini
On Thursday 18 Mar 2010  16:14:06 you wrote:
> Thank you for this advice, it solved the problem.
>  - where these preferences stored ?

Hi,
I think it is in the IJ_Prefs.txt file. I am not sure in all platforms. In
linux is in the hidden folder ~/.imagej/
By the way, since I like to have black background by default, I added this and
various other options to my startupMacros.txt file, so I am sure that these
are set each time.

Cheers

G.
Reply | Threaded
Open this post in threaded view
|

Re: Decimal Fractions in ResultsTable

David Webster
In reply to this post by Michael Schmid
Micheal,

I am doing that with no luck. Could it be something to do with using a non
system ResultsTable?

David

On Thu, Mar 18, 2010 at 2:58 AM, Michael Schmid <[hidden email]>wrote:

> Hi David,
>
> what about this?
>
> ResultsTable.setPrecision(int precision)
> Sets the number of digits to the right of decimal point.
>
> Michael
> ________________________________________________________________
>
>
> On 18 Mar 2010, at 03:00, David William Webster wrote:
>
> All,
>>
>> I am trying to create/display a ResultsTable containing  or showing
>> decimal fractions. But, all I get are ints. I am doing something like
>>
>> ResultsTable rt = new ResultsTable();
>> double x                = 1.0;
>> rt.addValue("x", x);
>> rt.show("My Table");
>>
>> But, I don't get the x value as 1.0, only 1. How can I get the displayed
>> and/or "save'ed" table to have doubles in it? I notice that if rt was a
>> systems result
>> table created via "ResultsTable rt              =
>> ResultsTable.getResultsTable()", then I get decimals freactions rather
>> than ints.
>>
>> David Webster
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: Decimal Fractions in ResultsTable

David Webster
In reply to this post by Michael Schmid
Micheal/All,

Whoops, problem solved. As it turns out, if the you are writing into the
table has no fractionbalk part, the  it is written as an int. e.g. "1.00" is
entered into the table as "1" while "1.55" is entered as "1.55". I think the
software may be a little to smart for its own good.

David

On Thu, Mar 18, 2010 at 2:58 AM, Michael Schmid <[hidden email]>wrote:

> Hi David,
>
> what about this?
>
> ResultsTable.setPrecision(int precision)
> Sets the number of digits to the right of decimal point.
>
> Michael
> ________________________________________________________________
>
>
> On 18 Mar 2010, at 03:00, David William Webster wrote:
>
> All,
>>
>> I am trying to create/display a ResultsTable containing  or showing
>> decimal fractions. But, all I get are ints. I am doing something like
>>
>> ResultsTable rt = new ResultsTable();
>> double x                = 1.0;
>> rt.addValue("x", x);
>> rt.show("My Table");
>>
>> But, I don't get the x value as 1.0, only 1. How can I get the displayed
>> and/or "save'ed" table to have doubles in it? I notice that if rt was a
>> systems result
>> table created via "ResultsTable rt              =
>> ResultsTable.getResultsTable()", then I get decimals freactions rather
>> than ints.
>>
>> David Webster
>>
>