Calassifeid Object Table

Hello,

I have 5 cell classes which were nicely classified using cell classifier in CPA.
Can CPA produce a new object table in which the ‘cell class’ is specified for each cell/object?

If not, what further downstream analysis can be performed using these classes, other then just counting the number of object in each class per image?

Thanks,
Erez

Hi Erez,

Indeed you can save the object class values in what we call the “class_table”. To do this:
(1) In your properties file, fill in the of the class_table (the field is near the bottom of the properties file)
(2) Classify, and then click Score All
(3) Wait for the Score All hit table to appear
(4) In the table’s File menu, click Save Table to Database (or CSV)

Then your class_table should appear in your database or CSV.

Let us know how it goes!
David

1 Like

Thanks!
I can now save the class data to the csv/DB.

In a related issue - Now, whever I try to create a plot using the object class data I recieve the following error, so I’m unable to use this data in my plots:

[size=85]An error occurred in the program:
DBException: ERROR: Database query failed for connection “MainThread” and failed to reconnect
Query was: "SELECT Per_Object.ImageNumber, Per_Object.ObjectNumber, five_classes.class, Per_Object.Filtered_cells_3_Intensity_LowerQuartileIntensity_Turq
FROM five_classes, Per_Object
WHERE five_classes.pEnriched_peroxi = Per_Object.Filtered_cells_3_Intensity_IntegratedIntensity_Turq AND five_classes.class IS NOT NULL AND Per_Object.Filtered_cells_3_Intensity_LowerQuartileIntensity_Turq IS NOT NULL "
First exception was: no such column: five_classes.pEnriched_peroxi
Second exception was: ERROR: Database query failed for connection "MainThread"
Query was: "SELECT Per_Object.ImageNumber, Per_Object.ObjectNumber, five_classes.class, Per_Object.Filtered_cells_3_Intensity_LowerQuartileIntensity_Turq
FROM five_classes, Per_Object
WHERE five_classes.pEnriched_peroxi = Per_Object.Filtered_cells_3_Intensity_IntegratedIntensity_Turq AND five_classes.class IS NOT NULL AND Per_Object.Filtered_cells_3_Intensity_LowerQuartileIntensity_Turq IS NOT NULL "
Exception was: no such column: five_classes.pEnriched_peroxi

Traceback (most recent call last):
File “scatter.pyc”, line 239, in update_figpanel
File “scatter.pyc”, line 293, in _load_points
File “dbconnect.pyc”, line 64, in fn
File “dbconnect.pyc”, line 512, in execute[/size]

What is wrong here?

Thanks again,
Erez

Hi Erez,

This sounds like the same issue: viewtopic.php?f=12&t=3577&p=10129&hilit=no+such+column#p10215
Can you try this?

David

Hi David,

Thanks for your refernce.
In fact, I am trying to create a plot (density, scatter etc.) in which the X axis will be the cell classes which were succesfully defeined in classifier. I don’t get the error message when trying to view the iamges, as in the example you referenced to.

If it matters, I used a single object table in which I maintained a 1 to 1 parental relationships between the objects. I used differnt parameters measured for different objects, in order to classify my cells. This all now works fine. But I’m not able to create plots using the class data.

Any ideas why?

Thanks!
Erez

Ah, I see. Unfortunately, this would take a bit more work as Scatterplot, etc don’t know about the class_table, and you’d have to link this class_table to your per_object table. See this Forum response to the same issue: viewtopic.php?f=12&t=3649&p=10432&hilit=scatterplot+class+table#p10432

David

Hello!
I have the same problem as Ereznit had.
Am I right that this “class_table” works only for MySQL?

If you don’t mind I would like to describe my situation.
I have SQLite database.
And in this database I have 130 Images with several Objects on each image (totally about 600 objects). I would like to divide objects into 5 classes by using RandomForest. I used some images and I took objects from them to create my training set. Thus my Training set consists of 100 objects. Finally I was very satisfyed with the result of the algorythm and I would like CPA to apply these rules for the rest 500 objects. When I do Score All I get Hit table with enrichments and other information which is not interesting for me… I would really like to get a table like this:
ImageNumber / ObjectNumber / Class
1…1…class2
1…2…class4
1…3…class1
2…1…class1
2…2…class3
and so on…
I tryed to open properties file and to fill in
class_table = table_of_classes.
Then I did thisn (as you wrote):
(2) Classify, and then click Score All
(3) Wait for the Score All hit table to appear
(4) In the table’s File menu, click Save Table to Database (or CSV)
Then your class_table should appear in your database or CSV.
But finally I got only the table with enrichments.
What I did wrong?
Or does this fail connect with that I use SQLite?

Now I see only this solution:
I load my training set, do Train, I get satisfyed with the result of it. And then I ask CPA to Score Image, I see CPA’s desicion about classes for each object, and I manually do sorting the rest of the objects into classes. In the end I will Save my training set with 600 manually sorted objects. I will be able to open this MyTrainingSet table in exel and I will see classes for each object. Buuuuuuut…You understand, it will take a lot of time.

I think I miss something obvious…

Thank you very much in advance!

And I thank for this amazing software.