Hi all,
I have a fraction of a density map in MRC file, which I need to use in a program accepting only cubic maps. The problem is that my map is not cubic, it's dimensions are roughly 22x23x23(x,y,z). Theoretically I can add one "X dimension" since it would be filled with zeros because of lack of density information. I am using for this purpose CSB Toolbox (LINK), where map is represented by a three dimensional numpy array. What I do can be described by this code:
import numpy as np
old_array = np.zeros((22,23,23), dtype=float32) #representation of an map parsed from file
to_add = np.zeros((1,23,23), dtype=float32)
new_map = np.append(old_array, to_add, axis=0)
In theory everything should work since I am getting shape of a new map as 23,23,23, however map is stretched and does not represent the original shape. I was also adjusting origin and spacing, but that doesn't work.
Do you have any idea of an program, which could do sth like that? Or maybe I am screwing something with Python code?
Thanks in advance!
Your python code should be working fine. I guess the problem would be in the header of your MRC file. How is the header or mrc file generated in the end?
The specification of the MRC header format: http://ami.scripps.edu/software/mrctools/mrc_specification.php