Forums » Appion and Leginon Web tools »
mrc files can't be opened
Added by Long Gui almost 12 years ago
To whom it may concern,
We have finished the leginon installation and the calibration step. And yesterday we tried to using the Tomography program for the first time, the data collection went smoothly. (Yeah!)
However, after we downloaded the mrc files from "Tomography" on the Leginon Web, these mrc files could not be opened either by IMOD or ImageJ.
When we tried to open mrc file in IMOD, it displayed "ERROR: IMOPEN -- This file is not recognizable as MRC or spider image file". And if used in ImageJ via MRC_reader plugin (which we used for the previous tomography data and worked well) , ImagaJ showed "Unimplemented ImageData mode=1936933152 in MRC file".
We also checked the file size. A MRC file size is about ~500 MB. Each frame is about ~8 MB and we collected about 60 frames in one mrc file so we think the mrc file is in the right range.
And we checked the raw data and the raw data (each single frame) saved in "/data/leginon/" could be opened normally.
So, we proposed there might be something wrong during the generation of mrc files. Would you please help us solve this problem? Thanks a lot!
-Long
Replies (3)
RE: mrc files can't be opened - Added by Anchi Cheng almost 12 years ago
There may be some platform dependency in writing the header. Could you give more details about your system? The code for this has not been changed for a long time and it opened in IMOD 4.5.3 on my old 32-bit machine. Could you try the following python script on the file
from pyami import mrc h=mrc.readHeaderFromFile('your_file.mrc') print h['mode'] a = mrc.read('your_file.mrc',0) mrc.write(a,'frame0.mrc')
Replace your file name and save the script as test.py and run in the same directory as your file by
python test.py
Let us know if you get any error in the running the script, and whether you can view the resulting frame0.mrc in any of the programs you normally use.
Anchi
RE: mrc files can't be opened - Added by Long Gui almost 12 years ago
Hello Anchi,
Thank you for your quick reply.
The leginon is running on Ubuntu 12.04 64-bit OS. And I tried to open the mrc file on Mac OS X 10.8.2 64-bit.
I just run the python program as you suggested. And the results returned with a error.
tf20@TF20:~/Downloads$ python test2.py
Traceback (most recent call last):
File "test2.py", line 2, in <module>
h=mrc.readHeaderFromFile('13jan31a__011.mrc')
File "/usr/local/lib/python2.7/dist-packages/pyami/mrc.py", line 711, in readHeaderFromFile
h = parseHeader(h)
File "/usr/local/lib/python2.7/dist-packages/pyami/mrc.py", line 323, in parseHeader
dtype = numpy.dtype(mrc2numpy[newheader['mode']])
KeyError: 1936933152
It is quite interesting that this error code 1936933152 is the same as the error information in ImageJ. Does this error code have any special meaning?
Thanks!
-Long
RE: mrc files can't be opened - Added by Anchi Cheng almost 12 years ago
No, the error code simple reflects that the mrc file you download has a header that has items in there saved in different length of bytes than mrc header reading programs expects. I will consult Jim and see what we can do about it.
Anchi