GrotjahnLab / surface_morphometrics

Morphometrics for Membrane Surfaces Segmented from Cryo-ET or other volumetric imaging.
GNU General Public License v3.0
18 stars 9 forks source link

Fix headers on example data files #16

Closed GenevieveBuckley closed 2 years ago

GenevieveBuckley commented 2 years ago

Closes https://github.com/GrotjahnLab/surface_morphometrics/issues/9

I've fixed the problem with the headers in the example data file, using this method:

import mrcfile

filename = "TE1.mrc"

with mrcfile.open(filename, mode='r+', permissive=True) as mrc:
    print("Original mrc file header:", mrc.header)
    mrc.header.map = mrcfile.constants.MAP_ID
    mrc.update_header_from_data()
    print("Fixed mrc file header:", mrc.header)

...and now the files can be opened without needing the permissive=True keyword argument. There's no error or warning now.

with mrcfile.open(filename) as mrc:
    print(mrc.data.shape)

The updated files have been re-tarred, and uploaded here in this PR.

GenevieveBuckley commented 2 years ago

Possibly the README text should also be updated, in this section.

I'm not entirely sure what to write here though. I don't completely want to get rid of the note about the permissive keyword argument, since it seems likely other users will export from Amira and might want to know about it.

We could also leave it for now, since the instructions still work if you pass the permissive kwarg, regardless of the header format.

GenevieveBuckley commented 2 years ago

Update: I think I found a good way to explain it, and have edited the README now too.

bbarad commented 2 years ago

I like this solution!