Two result tables, possible?

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

Two result tables, possible?

NatashaW
Dear list,

Is it possible to create two different result tables in the same macro?
For example I'm working with two stacks, applying some measurements on the nuclei and then on the fluorescent particles in every nucleus.
So I need one result table for the nuclei and the other for the included particles, because every one has its own measurements.
Is it possible in imagej?

Thank you..
Reply | Threaded
Open this post in threaded view
|

Re: Two result tables, possible?

Rasband, Wayne (NIH/NIMH) [E]
> Dear list,
>
> Is it possible to create two different result tables in the same macro?
> For example I'm working with two stacks, applying some measurements
> on the nuclei and then on the fluorescent particles in every nucleus.
> So I need one result table for the nuclei and the other for the included
> particles, because every one has its own measurements.
> Is it possible in imagej?

You can create multiple result tables in the 1.44c4 daily build by using the new "Rename" command, available in the File menu of Results windows. Here is an example macro that uses the corresponding IJ.renameResults() macro function to create two result tables.

   run("Blobs (25K)");
   setAutoThreshold("Default");
   run("Analyze Particles...", "display clear");
   IJ.renameResults("Unsmoothed");
   run("Gaussian Blur...", "sigma=2");
   setAutoThreshold("Default");
   run("Analyze Particles...", "display clear");
   IJ.renameResults("Smoothed");

-wayne
Reply | Threaded
Open this post in threaded view
|

Re: Two result tables, possible?

Aryeh Weiss
Rasband, Wayne (NIH/NIMH) [E] wrote:

>> Dear list,
>>
>> Is it possible to create two different result tables in the same macro?
>> For example I'm working with two stacks, applying some measurements
>> on the nuclei and then on the fluorescent particles in every nucleus.
>> So I need one result table for the nuclei and the other for the included
>> particles, because every one has its own measurements.
>> Is it possible in imagej?
>
> You can create multiple result tables in the 1.44c4 daily build by using the new "Rename" command, available in the File menu of Results windows. Here is an example macro that uses the corresponding IJ.renameResults() macro function to create two result tables.
>
>    run("Blobs (25K)");
>    setAutoThreshold("Default");
>    run("Analyze Particles...", "display clear");
>    IJ.renameResults("Unsmoothed");
>    run("Gaussian Blur...", "sigma=2");
>    setAutoThreshold("Default");
>    run("Analyze Particles...", "display clear");
>    IJ.renameResults("Smoothed");
>
> -wayne
>

This is great!

Can the functions that access the results table (getResults, etc) select
which result table to use?

--aryeh
--
Aryeh Weiss
School of Engineering
Bar Ilan University
Ramat Gan 52900 Israel

Ph:  972-3-5317638
FAX: 972-3-7384051
Reply | Threaded
Open this post in threaded view
|

Re: Two result tables, possible?

Rasband, Wayne (NIH/NIMH) [E]
On Jun 7, 2010, at 2:21 AM, Aryeh Weiss wrote:

> Rasband, Wayne (NIH/NIMH) [E] wrote:
>>> Dear list,
>>>
>>> Is it possible to create two different result tables in the same macro?
>>> For example I'm working with two stacks, applying some measurements
>>> on the nuclei and then on the fluorescent particles in every nucleus.
>>> So I need one result table for the nuclei and the other for the included
>>> particles, because every one has its own measurements.
>>> Is it possible in imagej?
>>
>> You can create multiple result tables in the 1.44c4 daily build by using the new "Rename" command, available in the File menu of Results windows. Here is an example macro that uses the corresponding IJ.renameResults() macro function to create two result tables.
>>
>>   run("Blobs (25K)");
>>   setAutoThreshold("Default");
>>   run("Analyze Particles...", "display clear");
>>   IJ.renameResults("Unsmoothed");
>>   run("Gaussian Blur...", "sigma=2");
>>   setAutoThreshold("Default");
>>   run("Analyze Particles...", "display clear");
>>   IJ.renameResults("Smoothed");
>>
>> -wayne
>>
>
> This is great!
>
> Can the functions that access the results table (getResults, etc) select
> which result table to use?

Macro functions like getResults() only work with the primary results table so you have to rename the table you want to access to "Results". I have included an example. Plugins and scripts can get a reference to the underlining ResultsTable object and use the rt.getValue() method.

-wayne

   setBatchMode(true);
   run("Blobs (25K)");
   run("Set Measurements...", "area mean min decimal=2");
   setAutoThreshold("Default");
   run("Analyze Particles...", "display clear add");
   IJ.renameResults("Unsmoothed");
   run("Gaussian Blur...", "sigma=2");
   n = roiManager("count");
   for (i=0; i<n; i++) {
       roiManager("select", i)
       run("Measure");
   }
   mean1 = newArray(n);
   mean2 = newArray(n);
   IJ.renameResults("Smoothed");
   selectWindow("Unsmoothed");
   IJ.renameResults("Results");
   for (i=0; i<n; i++)
       mean1[i] = getResult("Mean", i);
   selectWindow("Smoothed");
   IJ.renameResults("Results");
   for (i=0; i<n; i++)
       mean2[i] = getResult("Mean", i);
   run("Clear Results");
   for (i=0; i<n; i++) {
       setResult("Mean1", i, mean1[i]);
       setResult("Mean2", i, mean2[i]);
       setResult("%Difference", i, (mean1[i]-mean2[i])*100/mean1[i]);
   }
   updateResults();
Reply | Threaded
Open this post in threaded view
|

Measurement window please help

Tobias Baskin
In reply to this post by Rasband, Wayne (NIH/NIMH) [E]
Image J experts,
                Last week, I posted a question about controlling the
measurement window  so as to have multiple columns of the same type
of measurement (ie, several columns of measured lengths, instead of
one long single column). I received not one reply. Is my ask really
so impossible? I truly hope some one out there can take a moment to
reply. Thanks in advance,
                                                Tobias
--
       _      ____          __   ____
      /  \   /          / \    /   \ \        Tobias I. Baskin
     /   /  /          /   \   \      \         Biology Department
    /_ /   __      /__ \   \       \__    611 N. Pleasant St.
   /      /          /       \   \       \        University of Massachusetts
  /      /          /         \   \       \    Amherst, MA, 01003
/      / ___   /           \   \__/  \ ____
www.bio.umass.edu/biology/baskin
Voice: 413 - 545 - 1533 Fax: 413 - 545 - 3243
Reply | Threaded
Open this post in threaded view
|

Re: Measurement window please help

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

I don't think that this is directly possible, but using plugin
programming or scripts or macros everything is possible of course. I
don't understand why you want this. If you could explain the reason
maybe someone could help you to get what you want.

Volker

On 11/06/10 13:42, Tobias Baskin wrote:
> Image J experts,
>         Last week, I posted a question about controlling the measurement
> window  so as to have multiple columns of the same type of measurement
> (ie, several columns of measured lengths, instead of one long single
> column). I received not one reply. Is my ask really so impossible? I
> truly hope some one out there can take a moment to reply. Thanks in
> advance,
>                         Tobias
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwSJ8IACgkQ0gXPLVKexCdfDgCcD00iNu1OiZ0IzcRlHG5SDV/X
NPUAnRoqvufqx2VspT+EFHKdikIAO+Dq
=CxEq
-----END PGP SIGNATURE-----

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

Re: Measurement window please help

Tobias Baskin
Dear Volker and Community,
                          Thank you for your reply. Sure, let me
explain further. I have been measuring root elongation by means of a
xerox machine and a digitizing tablet. It is time to replace this
with a scanner and computer.  A typical experiment will have three or
four treatments, each with three plates of seedlings and each
seedling root might have one, two, or more segments to measure. There
is no problem about measuring the segment lengths with Image J. But
the measurement window gives me only a single column of length data.
What would be far more convenient would be to write the lengths for
plant one in column one, the lengths for plant two in column two, and
so on. And then perhaps when getting to treatment two, go back to
column one.

        I agree that this is not 'directly possible' but I was hoping
that someone had written some script to do this. Even if it is not
exactly that, it would be a useful starting place to modify.

        Hope this helps, and thank you for your time.

        Tobias


>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>I don't think that this is directly possible, but using plugin
>programming or scripts or macros everything is possible of course. I
>don't understand why you want this. If you could explain the reason
>maybe someone could help you to get what you want.
>
>Volker
>
>On 11/06/10 13:42, Tobias Baskin wrote:
>>  Image J experts,
>>          Last week, I posted a question about controlling the measurement
>>  window  so as to have multiple columns of the same type of measurement
>>  (ie, several columns of measured lengths, instead of one long single
>>  column). I received not one reply. Is my ask really so impossible? I
>>  truly hope some one out there can take a moment to reply. Thanks in
>>  advance,
>>                          Tobias
>-----BEGIN PGP SIGNATURE-----
>Version: GnuPG v1.4.10 (GNU/Linux)
>Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
>iEYEARECAAYFAkwSJ8IACgkQ0gXPLVKexCdfDgCcD00iNu1OiZ0IzcRlHG5SDV/X
>NPUAnRoqvufqx2VspT+EFHKdikIAO+Dq
>=CxEq
>-----END PGP SIGNATURE-----
>
>--
>passerelle antivirus du campus CNRS de Montpellier
>--


--
       _      ____          __   ____  
      /  \   /          / \    /   \ \        Tobias I. Baskin
     /   /  /          /   \   \      \         Biology Department
    /_ /   __      /__ \   \       \__    611 N. Pleasant St.
   /      /          /       \   \       \        University of Massachusetts
  /      /          /         \   \       \    Amherst, MA, 01003
/      / ___   /           \   \__/  \ ____
www.bio.umass.edu/biology/baskin
Voice: 413 - 545 - 1533 Fax: 413 - 545 - 3243
Reply | Threaded
Open this post in threaded view
|

Re: Measurement window please help

Gluender-4
Good day Tobias,

why not start a new measurement table for each
treatment and combine the various tables in a
dedicated spread-sheet application.

Please note that ImageJ is for image processing
and analysis and not for spread-sheet
manipulations.

>Dear Volker and Community,
>          Thank you for your
>reply. Sure, let me explain further. I have been
>measuring root elongation by means of a xerox
>machine and a digitizing tablet. It is time to
>replace this with a scanner and computer.  A
>typical experiment will have three or four
>treatments, each with three plates of seedlings
>and each seedling root might have one, two, or
>more segments to measure. There is no problem
>about measuring the segment lengths with Image
>J. But the measurement window gives me only a
>single column of length data. What would be far
>more convenient would be to write the lengths
>for plant one in column one, the lengths for
>plant two in column two, and so on. And then
>perhaps when getting to treatment two, go back
>to column one.
>
> I agree that this is not 'directly
>possible' but I was hoping that someone had
>written some script to do this. Even if it is
>not exactly that, it would be a useful starting
>place to modify.
>
> Hope this helps, and thank you for your time.
>
> Tobias

HTH
--


                 H. Glünder

          ------------------------

          <http://www.gluender.de>
Reply | Threaded
Open this post in threaded view
|

Re: How to batch convert ND2 to individual TIFF files

Pang, Zhengyu (GE Global Research)
In reply to this post by Volker Baecker
Dear all,

I have hundreds of ND2 images acquired by Nikon Microscope using Element
software, and I have to convert to tiff file for each channel. I could
use plugin ND to Image6D to open each ND2 file, and Export TIFF file,
but is there any way that I could batch convert images. I found the
Export to TIFF can't be recorded by ImageJ's record macro. Could anyone
help me on this?

Thanks!


Dr. Zhengyu Pang
Biochemistry and Biological Engineering Laboratory
General Electric Company Global Research
 
GE Imagination at work
Reply | Threaded
Open this post in threaded view
|

Re: Measurement window please help

Tobias Baskin
In reply to this post by Gluender-4
Thank you H. Glünder,
                The reason is simply convenience.
There would be a lot (dozens) of separate
measurement windows that would all need to be
saved and then opened and combined. Doable
certainly but awkward.

        Yes I am aware that ImageJ is for image
processing. But quantification is never far
behind. There are   many hundreds of ImageJ
plugins for measuring this or that -- I was
hoping that someone had figured out how to make
the measurement window behave a little more like
a spreadsheet. But perhaps not?

        As ever
                Tobias

>Good day Tobias,
>
>why not start a new measurement table for each
>treatment and combine the various tables in a
>dedicated spread-sheet application.
>
>Please note that ImageJ is for image processing
>and analysis and not for spread-sheet
>manipulations.
>
>>Dear Volker and Community,
>>          Thank you for your
>>reply. Sure, let me explain further. I have
>>been measuring root elongation by means of a
>>xerox machine and a digitizing tablet. It is
>>time to replace this with a scanner and
>>computer.  A typical experiment will have three
>>or four treatments, each with three plates of
>>seedlings and each seedling root might have
>>one, two, or more segments to measure. There is
>>no problem about measuring the segment lengths
>>with Image J. But the measurement window gives
>>me only a single column of length data. What
>>would be far more convenient would be to write
>>the lengths for plant one in column one, the
>>lengths for plant two in column two, and so on.
>>And then perhaps when getting to treatment two,
>>go back to column one.
>>
>> I agree that this is not 'directly
>>possible' but I was hoping that someone had
>>written some script to do this. Even if it is
>>not exactly that, it would be a useful starting
>>place to modify.
>>
>> Hope this helps, and thank you for your time.
>>
>> Tobias
>
>HTH
>--
>
>
>                 H. Glünder
>
>          ------------------------
>
>          <http://www.gluender.de>


--
       _      ____          __   ____
      /  \   /          / \    /   \ \        Tobias I. Baskin
     /   /  /          /   \   \      \         Biology Department
    /_ /   __      /__ \   \       \__    611 N. Pleasant St.
   /      /          /       \   \       \        University of Massachusetts
  /      /          /         \   \       \    Amherst, MA, 01003
/      / ___   /           \   \__/  \ ____
www.bio.umass.edu/biology/baskin
Voice: 413 - 545 - 1533 Fax: 413 - 545 - 3243
Reply | Threaded
Open this post in threaded view
|

Re: Measurement window please help

chris elliott
>>
>>> Dear Volker and Community,
>>>          Thank you for your reply. Sure, let me explain further. I have been measuring root elongation by means of a xerox machine and a digitizing tablet. It is time to replace this with a scanner and computer.  A typical experiment will have three or four treatments, each with three plates of seedlings and each seedling root might have one, two, or more segments to measure. There is no problem about measuring the segment lengths with Image J. But the measurement window gives me only a single column of length data. What would be far more convenient would be to write the lengths for plant one in column one, the lengths for plant two in column two, and so on. And then perhaps when getting to treatment two, go back to column one.

well the documentation says  (http://rsb.info.nih.gov/ij/developer/api/ij/measure/ResultsTable.html):

addValue(java.lang.String column, double value)
          Adds a value to the end of the given column.

but I don't see any examples in the Macros directory.

chris
Reply | Threaded
Open this post in threaded view
|

Re: How to batch convert ND2 to individual TIFF files

ctrueden
In reply to this post by Pang, Zhengyu (GE Global Research)
Hi Zhengyu,

I have hundreds of ND2 images acquired by Nikon Microscope using Element
> software, and I have to convert to tiff file for each channel. I could
> use plugin ND to Image6D to open each ND2 file, and Export TIFF file,
> but is there any way that I could batch convert images. I found the
> Export to TIFF can't be recorded by ImageJ's record macro. Could anyone
> help me on this?
>

Apologies for the long delay in my reply. You can use Bio-Formats to batch
convert ND2 to TIFF, using either the bfconvert command line tool (
http://www.loci.wisc.edu/bio-formats/command-line-tools) or within ImageJ
using a macro, with calls to Bio-Formats Importer and Bio-Formats Exporter
(or ImageJ's built-in Save As TIFF).

-Curtis

On Fri, Jun 11, 2010 at 9:42 AM, Pang, Zhengyu (GE, Research) <
[hidden email]> wrote:

> Dear all,
>
> I have hundreds of ND2 images acquired by Nikon Microscope using Element
> software, and I have to convert to tiff file for each channel. I could
> use plugin ND to Image6D to open each ND2 file, and Export TIFF file,
> but is there any way that I could batch convert images. I found the
> Export to TIFF can't be recorded by ImageJ's record macro. Could anyone
> help me on this?
>
> Thanks!
>
>
> Dr. Zhengyu Pang
> Biochemistry and Biological Engineering Laboratory
> General Electric Company Global Research
>
> GE Imagination at work
>