-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pyto tomoloading #22
Pyto tomoloading #22
Conversation
data -= np.mean(data) | ||
data /= np.std(data) | ||
if return_header: | ||
return data, header |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what I was doing in the previous version :D
The new version is even shorter
if header is not None: | ||
attributes = header.dtype.names | ||
for attr in attributes: | ||
setattr(out_mrc.header, attr, getattr(header, attr)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the header could not be set directly with
out_mrc.header = header
but separate setting of the attributes works nicely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay here - just getting back to reality!
Main comment is I don't love that a flag dictates the return type in the load_tomogram function, I would rather return some simple model Tomogram
with both the array data and the header in every case
non blocking though - can be followup/cleanup
Adjust dataloading to keep the header information of the input tomogram even after segmentation with MemBrain-seg.
It is not based on Pyto (as I thought initially would be necessary), but only on the mrcfile package. Thanks Alister for helping fix this!