Project

General

Profile

Actions

Bug #939

closed

AcquisitionImageTargetData table need to exist to diplay pixelsize in viewer

Added by Jim Pulokas over 13 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
10/13/2010
Due date:
% Done:

100%

Estimated time:
Affected Version:
Appion/Leginon 2.1.0
Show in known bugs:
No
Workaround:

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.

Actions #1

Updated by Anchi Cheng over 13 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
Actions #2

Updated by Anchi Cheng over 13 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.

Actions #3

Updated by Anchi Cheng over 13 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

Actions #4

Updated by Anchi Cheng over 13 years ago

  • Status changed from Assigned to In Code Review
  • Assignee changed from Anchi Cheng to Jim Pulokas
Actions #5

Updated by Amber Herold over 13 years ago

Jim, I can test it this afternoon and merge it after your code review.

Actions #6

Updated by Amber Herold over 13 years ago

I just merged it...want to test tonight.

Actions #7

Updated by Jim Pulokas over 13 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.

Actions #8

Updated by Amber Herold over 13 years ago

Good points Jim. And PHP does have exceptions. Here's an example: checkwebserver.php

Actions #9

Updated by Amber Herold over 13 years ago

  • Status changed from In Test to Closed
Actions #10

Updated by Anchi Cheng over 13 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.

Actions #11

Updated by Anchi Cheng over 13 years ago

r14983 fixed the bug r14982 introduced which made atlas not displayed because grid images came from targets on a fake image.

Actions #12

Updated by Jim Pulokas over 13 years ago

  • Status changed from In Code Review to Closed

I am happy

Actions

Also available in: Atom PDF