I2PC / scipion

Scipion is an image processing framework to obtain 3D models of macromolecular complexes using Electron Microscopy (3DEM)
http://scipion.i2pc.es
Other
76 stars 47 forks source link

particles shifted when picking with 'sphire - cryolo picking' from K3 micrographs #2054

Closed JuhaHuiskonen closed 4 years ago

JuhaHuiskonen commented 4 years ago

When picking particles from K3 micrographs (rectangular shape) the particles are shifted towards the top right corner. As the installation works fine with Falcon III micrographs (square shape), I suspect it has to do with the rectangular shape. I am not sure if this is a bug in cryolo or in Scipion coordinate conversions.

pconesa commented 4 years ago

Thanks @JuhaHuiskonen , we experienced that , and if I remember correctly, the shift was coming from entering a non multiple of 32 in the input size.

We also added some code to convert the parameter to the closest multiple of 32, and as a consequence, throsten added this in his documentation page:

02 input_size: This is the size to which the input is rescaled before passed through the network (it is NOT the size of your micrograph!). In the example given here it would be 768×768. The input could either be the whole micrograph or a patch (in case you use the patchmode). The input size have to be a multiple of 32.

Either: 1.- you do not have the latest plugin 2.- The latest plugin does not have what I'm saying it has (our bad) 3.- You are right and Cryolo does not work nicely with non square images.

@JuhaHuiskonen , can you check that the input size is multiple of 32?

I'll check with Thorsten.

JuhaHuiskonen commented 4 years ago

Hi @pconesa. The input size is the Scipion default = 1024. Number of patches = 1.

pconesa commented 4 years ago

Great! then, that eliminates 1 and 2, or at least that is not the issue.

delarosatrevin commented 4 years ago

@JuhaHuiskonen what version of the plugin are you using?

@pconesa the symptom of going to the top right corner could also be a bug while parsing the coordinates from EMAN convention, that we bring to the center, could you check this?

JuhaHuiskonen commented 4 years ago

@delarosatrevin our plugin version is 1.2.8

pconesa commented 4 years ago

@JuhaHuiskonen ....is the shift progressively increasing? or is it constant?

Could you please post a screenshot?

JuhaHuiskonen commented 4 years ago

@pconesa It's a constant. If I extract the particles, each particle is shifted towards the top right corner.

pconesa commented 4 years ago

Thanks, @JuhaHuiskonen, could you post a screen capture of the output, for now.

thorstenwagner commented 4 years ago

The problem seems to be on the crYOLO side. It seems to be a problem, when you apply a model which was trained with square anchor sizes on non-square images. I've to dig deeper into that problem next week.

Quick workaround, pick 5 micrographs, train (or maybe just refine) a model and it will work.

pconesa commented 4 years ago

Many thanks @thorstenwagner !

thorstenwagner commented 4 years ago

Thank you @JuhaHuiskonen and @pconesa for making me aware of that problem!

thorstenwagner commented 4 years ago

@JuhaHuiskonen and @pconesa

The problem should be fixed. Here is the release candidate: https://pypi.org/project/cryolo/1.5.4rc3/

Could you give it a try?

pconesa commented 4 years ago

Thanks @thorstenwagner , we are going to update the plugin and test the new version. @JuhaHuiskonen I'll let you know when we release the plugin

JuhaHuiskonen commented 4 years ago

We updated the binary and it seems to have solved the problem.

pconesa commented 4 years ago

I guess a : pip install cryolo==1.5.4rc3 solved it?

vabrishami commented 4 years ago

@pconesa It should work, but we had a number of errors. So I followed the download instructions in Cryolo page (without touching the plugin) to install it again, and it did work.