Bug #939
closedAcquisitionImageTargetData table need to exist to diplay pixelsize in viewer
100%
Description
This table is not created until a Leginon MSI application is run. When only apppionis used, the initial uploaded image do not have targets. The cause in inc/leginon.inc function getImageInfo returns results without binning infomation which makes pixelsize calculation in inc/leginon.inc function getPresets() multiply binning by zero.
The cause in getImageInfo is set up incorrectly, it should be corrected so that binning, which come from CameraEMData, can be returned.
Updated by Anchi Cheng about 14 years ago
- Subject changed from install script does not create AcquisitionImageTargetData table to AcquisitionImageTargetData table need to exist to diplay pixelsize in viewer
- Status changed from New to Assigned
- Assignee set to Anchi Cheng
Updated by Anchi Cheng about 14 years ago
- Priority changed from Normal to Urgent
- Target version set to Appion/Leginon 2.1.0
This is a bug we found at UCLA and forgot that it affect any new installation of appion. I am working on it right now.
Updated by Anchi Cheng about 14 years ago
r14957 make the query look for all image information except those involves parent. All uploaded and manual images do have pixelsize etc.
This need to be merged into branch 2.1 after testing.
Testing:
1. Use a brand-new installation or ones only have uploaded image so that there is no AcquisitionImageTargetData in leginondb.
2. Go to any image viewer. The old code would not have meaningful pixel size above the image, The fixed one would
Updated by Anchi Cheng about 14 years ago
- Status changed from Assigned to In Code Review
- Assignee changed from Anchi Cheng to Jim Pulokas
Updated by Amber Herold about 14 years ago
Jim, I can test it this afternoon and merge it after your code review.
Updated by Amber Herold about 14 years ago
I just merged it...want to test tonight.
Updated by Jim Pulokas about 14 years ago
- Status changed from In Code Review to In Test
- Assignee changed from Jim Pulokas to Amber Herold
Looks good, but here are some things to think about for future problems like this:
If it is a common problem where the existence of tables has to be checked before running a query... Could that table check be done in the low level function that actually runs the query? That would eliminate the need for a lot of "if... isTable(..." in the higher level code. Or in this case, getImageInfo is taking responsibility for calling "isTable" even though getParent is actually running the query that fails if those tables do not exist. If another table is added to the query in getParent, then getImageInfo may have to add more isTable checks. If there is anything in php like the try/except in python, then a query could just be tried, and if it has problems, then it can fall back to returning an empty result. That cleans up code where you otherwise need complicated if statements.
Updated by Amber Herold about 14 years ago
Good points Jim. And PHP does have exceptions. Here's an example: checkwebserver.php
Updated by Amber Herold about 14 years ago
- Status changed from In Test to Closed
Updated by Anchi Cheng about 14 years ago
- Status changed from Closed to In Code Review
- Assignee changed from Amber Herold to Jim Pulokas
- Priority changed from Urgent to Normal
- % Done changed from 0 to 100
r14982 moved the table_exists check to getParent function to make Jim happier.
Updated by Anchi Cheng about 14 years ago
r14983 fixed the bug r14982 introduced which made atlas not displayed because grid images came from targets on a fake image.