2012-03-29 2 views
0
import numpy as np 
import Image 
im=Image.open("C:\Users\jhon\Pictures\newtry\101201x0.mrc",) 
newArr = numpy.fromfromstring(im.tostring(),numpy.uint8) 
newArr = numpy.reshape(newArr,im.size)` 

를 엽니 다 당신이 내가 당신의 EMAN2를 설치하고 사용할 수 있습니다 감사사용 파이썬, 나는 인터프리터에서이있어 MRC 형식으로 이미지를

IOError: [Errno 22] invalid mode ('rb') or filename: 'C:\\Users\\xxx\\Pictures\201x0.mrc' 
File "C:\Users\jhon\try.py", line 18, in <module> 
im=Image.open("C:\Users\xxx\Pictures\newtry\101201x0.mrc") 
File "C:\EMAN2\python\Python27\Lib\site-packages\PIL\Image.py", line 1952, in open 
fp = __builtin__.open(fp,'rb') 

답변

0

파이썬에 대한 새로운 오전 어떤 생각 mrc 파일을 여는 코드는 매우 간단합니다.

from EMAN2 import * 
img = EMData("testOK.mrc", 0) 
img.write_image("copy.mrc") #write a copy of the image on the disk 

img.read_image("testOK2.mrc", 0) 
img.write_image("copy2.mrc") #write a copy of the image on the disk 
관련 문제