Hello,
I’m trying to import K2 superres movies and it has been throwing me the following error.
[CPU: 795.0 MB] Traceback (most recent call last):
File "cryosparc2_master/cryosparc2_compute/run.py", line 82, in cryosparc2_compute.run.main
File "cryosparc2_compute/jobs/imports/run.py", line 651, in run_import_movies_or_micrographs
imgdata = tiff.read_tiff(abs_path).sum(axis=0) * gainref
ValueError: operands could not be broadcast together with shapes (7676,3710) (7676,7420)
The movies need to be gain corrected, rotated and flipped according to the person who collected the data. The r/f in the header is also 7 suggesting the same (flip and rotate). The gainref file is in mrc format and is provided. From what I can decipher, the dimensions of the gainref in the Y are double that of the datafiles. The header for the tif movie says
RO image file on unit 1 : Mix4_00002_Jan28.tif Size= 230464 K
This is a TIFF file.
This file actually has 4-bit values packed in bytes, with 3710 bytes in X
Number of columns, rows, sections ..... 7420 7676 30
Map mode .............................. 0 (byte)
Start cols, rows, sects, grid x,y,z ... 0 0 0 7420 7676 30
Pixel spacing (Angstroms).............. 0.5480 0.5480 0.5480
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 ....................... 4.0000
Mean density .......................... 2.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, 4 bits packed r/f 7
SuperRef_Mix4_00001_Jan28.dm4
defects_Mix4_00001_Jan28.txt
The most important piece of information I can gather from this is
This file actually has 4-bit values packed in bytes, with 3710 bytes in X
That’s where the mismatch is and I’m not sure how I can correct it in cryosparc. I can correct it outside using the
clip unpack/normalize
command but that takes forever when you have 1000s of movies to process. Is there a way to do it on the fly in cryosparc? I feel like there isn’t or maybe I’m missing a trick here. Help?