Problems importing tiff files

Hi,

I acquired tiff files using EPU on a K3. When I try to import them using *.tiff I am getting and mrc error:

Traceback (most recent call last):
  File "cryosparc2_master/cryosparc2_compute/run.py", line 85, in cryosparc2_compute.run.main
  File "cryosparc2_compute/jobs/imports/run.py", line 754, in run_import_movies_or_micrographs
    gain = mrc.read_mrc(gainref_abs_path)[1][0]
  File "cryosparc2_compute/blobio/mrc.py", line 135, in read_mrc
    data = read_mrc_data(file_obj, header, start_page, end_page, out)
  File "cryosparc2_compute/blobio/mrc.py", line 86, in read_mrc_data
    dtype = mrc_datatype_to_dtype(datatype)
  File "cryosparc2_compute/blobio/mrc.py", line 65, in mrc_datatype_to_dtype
    assert False,'Unsupported MRC datatype: {0}'.format(datatype)
AssertionError: Unsupported MRC datatype: 151714817

So I linked the files and made them *.tif

When trying to read them I am getting the following error. Traceback (most recent call last):
File “cryosparc2_master/cryosparc2_compute/run.py”, line 85, in cryosparc2_compute.run.main
File “cryosparc2_compute/jobs/imports/run.py”, line 640, in run_import_movies_or_micrographs
datashape, data_format = read_movie_header(all_filepaths_to_check[0][‘abs_path’], extn)
File “cryosparc2_compute/jobs/imports/run.py”, line 471, in read_movie_header
shape = tiff.read_tiff_shape(abs_path)
File “cryosparc2_compute/blobio/tiff.py”, line 76, in read_tiff_shape
tif = libtiff.TIFF.open(path)
File “/home/svc_cryosparc/cryosparc2_master/deps/anaconda/lib/python2.7/site-packages/libtiff/libtiff_ctypes.py”, line 501, in open
raise TypeError('Failed to open file ’ + repr(filename))
TypeError: Failed to open file ‘/groups/haselbach/Leonard_lab/200729_dataKrios/raw_micrographs/FoilHole_28850659_Data_28851347_28851349_20200728_133706_fractions.tif’

The file mentioned can be read by warp and relion so I don’t quite know what to do.
Any ideas?

Anyone any idea? I am really stuck

Have you tried testing individual files? Is it just this one rogue file that is causing a problem, or do all the tif files cause the same issue?

I haven’t had this issue with K3 tiff files written by leginon, but I’m not sure I’ve tried with tiff files written by EPU, perhaps it is writing in a slightly different format?

Hi @david.haselbach,

In the first error message you sent, the error is actually happening when trying to read the gain reference file rather than the movies.
The gain reference must be in MRC format (not tiff or dm4). Can you check that maybe that was the problem?

Ah indeed it was the gain. When I took it out it worked. thank you.

Hello there,

I am having a similar problem when trying to import micrographs from a Tecnai G2, 200 kV:
[CPU: 200.8 MB] Traceback (most recent call last):
File “cryosparc2_master/cryosparc2_compute/run.py”, line 85, in cryosparc2_compute.run.main
File “cryosparc2_compute/jobs/imports/run.py”, line 772, in run_import_movies_or_micrographs
imgdata = mrc.read_mrc(os.path.join(proj_dir_abs, exp[‘micrograph_blob/path’]))[1][0]
File “cryosparc2_compute/blobio/mrc.py”, line 135, in read_mrc
data = read_mrc_data(file_obj, header, start_page, end_page, out)
File “cryosparc2_compute/blobio/mrc.py”, line 86, in read_mrc_data
dtype = mrc_datatype_to_dtype(datatype)
File “cryosparc2_compute/blobio/mrc.py”, line 65, in mrc_datatype_to_dtype
assert False,‘Unsupported MRC datatype: {0}’.format(datatype)
AssertionError: Unsupported MRC datatype: 942813506

–> I’ve tried a number of files individually, none works.
–> as I understand the script mrc.py is trying to find the value for “datatype” in the .tif file, but it can’t. Is there a way to add that information to the .tif file without loosing information from the image?

I am also having problems importing tiffs in cryosparc. Motioncor2 and relion are fine with these files. I get this:

[CPU: 207.6 MB]  Traceback (most recent call last):
  File "cryosparc_master/cryosparc_compute/run.py", line 84, in cryosparc_compute.run.main
  File "/data/opt/cryosparc/cryosparc_master/cryosparc_compute/jobs/imports/run.py", line 725, in run_import_movies_or_micrographs
    eer_upsamp_factor=eer_upsamp_factor)
  File "/data/opt/cryosparc/cryosparc_master/cryosparc_compute/jobs/imports/run.py", line 549, in read_movie_header
    shape = tiff.read_tiff_shape(abs_path)
  File "/data/opt/cryosparc/cryosparc_master/cryosparc_compute/blobio/tiff.py", line 69, in read_tiff_shape
    tif = libtiff.TIFF.open(path)
  File "/data/opt/cryosparc/cryosparc_master/deps/anaconda/envs/cryosparc_master_env/lib/python3.7/site-packages/libtiff/libtiff_ctypes.py", line 501, in open
    raise TypeError('Failed to open file ' + repr(filename))
TypeError: Failed to open file b'/archives/???/frames/???_00044.tif'

Hi @jcoleman,

A few things to check:

  1. Permissions on the file- can cryoSPARC properly access the file?
  2. Are there actually question marks in the filename? Or was this manually modified by you?
  1. Yes
  2. Manually modified by me, the ? seems to work for importing mrc and other files.