-
Notifications
You must be signed in to change notification settings - Fork 18
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
MRC import, axes mess and dtypes #51
Comments
Let me try to disentangle the two parts here: fixing axes Ok, this should def. be done. As far as I understand Line 10 in 20d7c7f
Feel free to make a PR for this, but note that you'll probably need to update the test accordingly too: https://github.com/constantinpape/elf/blob/master/test/io_tests/test_mrc_wrapper.py value ranges
No it doesn't and that's also not what it's there for. It should just load the data correctly through an API that's compatible with
I guess that this is a mobie viewer issue; is there a corresponding issue about it?
This doesn't make much sense in |
That's clear. In this case, the dtype is signed int8. The display limits for MoBIE still are set to |
it can actually also create a |
Yes, |
for testing messy axes hacks, I will change the shape of the test array. |
Yeah, the shape should def. be changed. |
here you go. Was easier than expected... |
I think it's all fixed by #52. |
Hi,
I realized that there are a couple of issues with the MRC importer.
I am not very familiar with the classes you use here, but I guess somewhere here:
elf/elf/io/mrc_wrapper.py
Line 10 in 20d7c7f
the
data
contained in themrc.mfile
class needs to be transposed to match numpy and other image conventions:This is what I always do for 3D MRC tomograms to get a "well-behaving" volume:
Here's
CD138-BMNC_01_Grid5_c0051
as an example:Top left: original MoBIE import that I have done using my axes hack.
Top right: new MoBIE import using
mobie.add_image
passing it the MRC file.Bottom left: Native IMOD viewer of the source volume.
Bottom right: BioFormats importer into ImageJ of the source volume.
You see that the axes are messed up and also the dynamic range of the view entry that is generated:
does not correctly map the original signed integer range. Does elf not provide the
min
andmax
tomobie-python
?When I adjust the viewer manually, we again have the problem of "transparent/black" zero value.
@tischi Do you know if this is getting solved any time soon?
In any case, I think it would help to have an option to map signed data types to their unsigned equivalents.
I think this should happen in
elf
, or where would you see this?I don't think
mrcfile
can do this itself https://mrcfile.readthedocs.io/en/latest/usage_guide.html#data-types .So I suggest the following implementations:
The first point is especially crucial, otherwise all existing crop views have to be re-done because the coordinates no longer match the data.
The text was updated successfully, but these errors were encountered: