When I try to make filter with two operators in "fetch" ima

see screencast screencast-o-matic.com/watch/c2jf2FnKJr

When I try to make filter with two operators in “fetch” images, it create wrong SQL statement with duplicated database name

[MainThread] SELECT ImageNumber FROM cpPer_Image,cpPer_Image WHERE cpPer_Image.Image_Metadata_Plate REGEXP “^60” AND cpPer_Image.Image_Metadata_Well = "E5"
Filter query failed for filter “glia1”. Check the MySQL syntax in your properties file.
ERROR: Database query failed for connection “MainThread” and failed to reconnect
Query was: "SELECT ImageNumber FROM cpPer_Image,cpPer_Image WHERE cpPer_Image.Image_Metadata_Plate REGEXP “^60” AND cpPer_Image.Image_Metadata_Well = "E5""
First exception was: (1066, “Not unique table/alias: ‘cpPer_Image’”)
Second exception was: ERROR: Database query failed for connection "MainThread"
Query was: "SELECT ImageNumber FROM cpPer_Image,cpPer_Image WHERE cpPer_Image.Image_Metadata_Plate REGEXP “^60” AND cpPer_Image.Image_Metadata_Well = "E5""
Exception was: (1066, “Not unique table/alias: ‘cpPer_Image’”)

Hi vmorozov

Thanks for reporting - I see the issue and it should be easily correctable by editing your properties file to create the filter instead of using the GUI.
(And I like the screencast! Potentially very helpful.)
Unfortunately, we don’t have funding for a software engineer for CPAnalyst so I will report this bug but I can’t say when it will be fixed.

Workaround:
As you noted, the sql query created when you create the filter in the GUI mistakenly duplicates the Per_Image table “cpPer_Image”

In your properties file, change this to:

OR, perhaps even easier, in ExportToDatabase, you can “add filter fields”, so that you shouldn’t have to do any creation in CPA, and the filters will appear in your properties file.

Cheers,
David

FYI Github issue here: github.com/CellProfiler/CellPro … /issues/53