MPI-Dortmund / cryolo

cryolo documentation
8 stars 0 forks source link

Support for tif files #4

Closed sbliven closed 3 years ago

sbliven commented 3 years ago

I'm having trouble running crYOLO on tif files. It seems cryolo uses PIL for opening tif, but this gives an error with my micrographs:

Traceback (most recent call last):
...
 File "/opt/psi/Programming/anaconda/2019.07/conda/envs/cryolo-1.6.1-gpu/lib/python3.6/site-packages/cryolo/imagereader.py", line 81, in read_width_height
 im = Image.open(image_path)
 File "/opt/psi/Programming/anaconda/2019.07/conda/envs/cryolo-1.6.1-gpu/lib/python3.6/site-packages/PIL/Image.py", line 2896, in open
 "cannot identify image file %r" % (filename if filename else fp)
PIL.UnidentifiedImageError: cannot identify image file '/data/.../Cryolo/full_data/gabriella_1_00000_Jul06_15.12.46.tif'

Here's info about the micrograph (from IMOD's header command):

$ header /data/.../Cryolo/full_data/gabriella_1_00000_Jul06_15.12.46.tif

 RO image file on unit   1 : /data/.../Cryolo/full_data/gabriella_1_00000_Jul06_15.12.46.tif     Size=     156772 K

                    This is a TIFF file.

 Number of columns, rows, sections .....    3838    3710      35
 Map mode ..............................    6   (unsigned 16-bit integer)
 Start cols, rows, sects, grid x,y,z ...    0     0     0    3838   3710     35
 Pixel spacing (Angstroms)..............  0.8200     0.8200     0.8200
 Cell angles ...........................   90.000   90.000   90.000
 Fast, medium, slow axes ...............    X    Y    Z
 Origin on x,y,z .......................    0.000       0.000       0.000
 Minimum density .......................   0.0000
 Maximum density .......................   6.0000
 Mean density ..........................   3.0000
 tilt angles (original,current) ........   0.0   0.0   0.0   0.0   0.0   0.0
 Space group,# extra bytes,idtype,lens .        0        0        0        0

     3 Titles :
SerialEMCCD: Dose frac. image, scaled by 1.00  r/f 0
  CountRef_gabriella_1_00000_Jul06_15.12.46.dm4
  defects_gabriella_1_00000_Jul06_15.12.46.txt

Are tif files unsupported in general, or is it this dataset in particular?

thorstenwagner commented 3 years ago

Thanks for reporting. TIFF should work. Can you send me one file as an example?

sbliven commented 3 years ago

No problem. I'll send it via email.

thorstenwagner commented 3 years ago

It looks like that you are trying to apply crYOLO on a movie? This is not supported. crYOLO uses the motion corrected sums for picking.

thorstenwagner commented 3 years ago

I guess the problem is solved.