Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shoeboxes displayed wrong for rotated detector models #1189

Closed
phyy-nx opened this issue Mar 10, 2020 · 5 comments
Closed

Shoeboxes displayed wrong for rotated detector models #1189

phyy-nx opened this issue Mar 10, 2020 · 5 comments

Comments

@phyy-nx
Copy link
Member

phyy-nx commented Mar 10, 2020

Generally we have panels close to 90 degrees so It's not too surprising we haven't noticed this. Here are two examples:

image

Here I used rotate_detector.py (see #1182) to rotate dials_regression/image_examples/ALS_831/q315r_lyso_001.img 90 degrees, then ran dials.find_spots rotated.expt, dials.index rotated.expt strong.refl, and dials.image_viewer indexed.*. Interestingly, because the detector is not constrained in dials.index by design, the detector Z drifted ~20 degrees-ish. You can see the pixels are marked correctly, but the centroid cross is a bit funny and the red shoebox is wrong.

Another example:
image

Here I used rotate_detector.py on dials_regression/image_examples/LCLS_cspad_nexus/idx-20130301060858401.cbf, but changed the angle to 45 degrees, then used dials.find_spots rotated.expt gain=25 filter.min_spot_size=2 and dials.image_viewer rotated.expt strong.refl. Now you can see the centroid cross and shoebox are both flattened.

Note, this bug is in the master now, but can only be seen on multi-panel images until #1182 is merged.

@dagewa
Copy link
Member

dagewa commented Mar 10, 2020

Interestingly, because the detector is not constrained in dials.index by design, the detector Z drifted ~20 degrees-ish

Could this be because the detector was rotated, but the rotation axis was not?

@phyy-nx
Copy link
Member Author

phyy-nx commented Mar 10, 2020

Interestingly, because the detector is not constrained in dials.index by design, the detector Z drifted ~20 degrees-ish

Could this be because the detector was rotated, but the rotation axis was not?

You mean the goniometer axis? Likely! Not relevant to the second case of course which is a still, but it's a good point for the single image sweep.

@dagewa
Copy link
Member

dagewa commented Mar 26, 2020

This issue seems to be because the shoebox display only takes the coordinates of diametric corners and draws a rectangle between them.

x0_, y0_ = map_coords(x0, y0, panel)
x1_, y1_ = map_coords(x1, y1, panel)

@dagewa
Copy link
Member

dagewa commented Aug 5, 2020

With the fix in 62dab08, the original example:

dials.import $(libtbx.find_in_repositories dials_regression)/image_examples/ALS_831/q315r_lyso_001.img
dials.python $(libtbx.find_in_repositories dials)/util/image_viewer/slip_viewer/rotate_detector.py imported.expt
dials.find_spots rotated.expt
dials.index rotated.expt strong.refl
dials.image_viewer indexed.*

now gives this:
Screenshot from 2020-08-05 14-32-04

@phyy-nx
Copy link
Member Author

phyy-nx commented Aug 5, 2020

oooooooo

@dagewa dagewa closed this as completed in 5dea370 Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants