
Install
Setup
Use
conversion of stacks
command line
making scripts
some little tools when running interactively
data=EMData() #create an object to hold the image
data.read_image("raw.hdf",0) #reads the first image from the stack
nx = data.get_attr("nx")
ny=nx # image should be square of course
r=nx/2 # this will mask only the corners of the image
mask=model_circle(r,nx,ny)
square=model_blank(nx,ny,bckg=1)
inv_mask = square-mask # can do math on images!
back_1d = Util.compress_image_mask(data,inv_mask) # converts all image data under the mask to a 1D image -- for getting the stats of the corner data
mean = back_1d.get_attr("mean")
sd = back_1d.get_attr("sigma")
norm = (data - mean) / sd # can also do scalar math on images!
norm.write_image("normalised.hdf",0)
| ||||||||
| Added: | ||||||||
| > > | Notes stolen from sparx site for convenience
READ IMAGE
. a = EMData()
. a.read_image("name.hdf")
. a.read_image("bdb:name")
. or
. a = [[get_image]]("name.hdf")
. a = [[get_image]]("bdb:name")
. a = EMData()
. i=12
. a.read_image("name.hdf" , i)
. a.read_image("bdb:name", i)
. a = EMData.read_images("name.hdf")
. a = EMData.read_images("bdb:name")
. stack = "data.hdf" . stack = "bdb:data" . n = EMUtil.get_image_count(stack)
. ima = EMData() . ima.read_image(stack, 0, True) | |||||||
| ||||||||
| Added: | ||||||||
| > > | ||||||||