how put the result table of the particle analysis pluging in an array?

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

how put the result table of the particle analysis pluging in an array?

sancho38
Hi,



In  a macro, I use the plugin particles analysis.

I would like to know, in my macro how to put the result table (number of the particle, the area of the particle,...) of the particles analysis pluging in an array usable in my macro?


thank you in advance for your help

regard's

Loïc
Reply | Threaded
Open this post in threaded view
|

Re: how put the result table of the particle analysis pluging in an array?

MrScientistman2
Hi!

This is not a direct answer to your question, but could help you get started. I have made two macro functions that writes some variables to text files, and also loads from text files. What you could do is to save the results from analyze particles to a text file, and load them using my functions into arrays, that are split into columns and rows.


Macro: BEWARE OF TEXT BREAKS!



function create_empty_threshold_file()
        {
        print("\\Clear");
        print("Section#" + "\t" + "Hoechst_threshold" + "\t" + "Dextran_threshold" + "\t" + "Antigen1_threshold" + "\t" + "Antigen2_threshold");
        for(i=1; i<27; i++)
                {
                print("section" + i + ":" + "\t" + "0" + "\t" + "0" + "\t" + "0" + "\t" + "0");
                }
        selectWindow("Log");
        saveAs("Text", root_directory + "thresholds.txt");
        selectWindow("Log");
        run("Close");
        }


function update_thresholds_txt()
        {
        print("\\Clear"); //CLEARING LOG WINDOW
        text_file = root_directory + "thresholds.txt";
        filestring=File.openAsString(text_file);
        //CREATING COLUMN ARRAYS FOR THE FIVE COLUMNS: SECTION NUMBER, HOE_THRESH, DEXTRAN_THRESH, ANTIGEN1_THRESH, ANTIGEN2_THRESH.
        rows=split(filestring, "\n");
        c1=newArray(rows.length);
        c2=newArray(rows.length);
        c3=newArray(rows.length);
        c4=newArray(rows.length);
        c5=newArray(rows.length);
        //PRINTING ORIGINAL TEXT FILE TO "LOG" WINDOW
        for(i=0; i<rows.length; i++)
                {
                columns=split(rows[i],"\t");
                c1[i]=columns[0];
                c2[i]=columns[1];
                c3[i]=columns[2];
                c4[i]=columns[3];
                c5[i]=columns[4];
                }
        for(i=0; i<rows.length; i++)
                {
                print(c1[i] + "\t" + c2[i] + "\t"+ c3[i] + "\t" + c4[i] + "\t" + c5[i]);
                }
        //UPDATING WITH THRESHOLDS FOR CURRENT FILE:
        print("\\Update" + section_number + ":" + "section" + section_number + "\t" + hoechst_threshold + "\t" + dextran_threshold + "\t"+ antigen1_threshold + "\t" + antigen2_threshold);
        selectWindow("Log");
        saveAs("Text", root_directory + "thresholds.txt");
        selectWindow("Log");
        run("Close");
        }