-
Notifications
You must be signed in to change notification settings - Fork 89
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
Read .ndjson
CryoET Files
#493
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #493 +/- ##
==========================================
- Coverage 75.28% 74.80% -0.49%
==========================================
Files 41 41
Lines 3731 3770 +39
==========================================
+ Hits 2809 2820 +11
- Misses 922 950 +28 ☔ View full report in Codecov by Sentry. |
I tested this using https://cryoetdataportal.czscience.com/runs/643 . The import works fine, but there are some rough edges:
but this is just a simple fix in the nodetree:
The biggest shame is that the display of the tomograms will be nicest when we have the "Sample Volume" node in 4.2. I used this in a recent preprint and it came out really nice: |
OK, looks like the location coordinates are in pixels of the tomogram, but all densities get scaled to be in physical coordinates (as it should be). Unfortunately, the ndjson has no info about the pixel size, so for now we have to create a way for the user to manually enter the pixelsize or connect it with the volume, so the pixelsize can be read from there. |
I think we can add a 'scale pixel size' to the node group which defaults to 1.0. Don't need to use it if the coordinates have been input but can use if needed for these datasets. |
And yes I think we can rename the ensemble node group as well to be consistent. |
Actually, I am pretty sure the rotations are wrong. I did some tests with this: https://cryoetdataportal.czscience.com/runs/506?metadata=run&tab=metadata and the Z-axes (blue arrow) should point out of the viral particles. (Inverting the rotation doesn't help either) I just saw you are working on the matrix attribute, so maybe the thing to do is to write the matrix directly in there and go from there. |
The matrix data format won't be until Blender 4.2 in early July. Currently I am taking the MolecularNodes/molecularnodes/io/parse/star.py Lines 258 to 259 in 09dbd99
|
This reverts commit 2d37c54.
I haven't found a spec. I just asked in their repo how the matrix is defined: chanzuckerberg/cryoet-data-portal#749 |
Great - thanks @jojoelfe ! |
After some more tinkering: if has_rotation:
matrix[:3, :3] = data['xyz_rotation_matrix']
matrix[:3, :3] = np.flip(matrix[:3, :3]) makes things work: 2024-05-23.11-45-00.mp4 |
Thanks for figuring that out @jojoelfe - I've fixed the rotation and added a test for some basic import. Will be interested what they say about spec for the data formats. |
For instancing of particles, reads
.ndjson
files and creates points for instancing.Currently just the initial barebones importer which can parse the positions and the rotations for the points. Doesn't currently handle particle picking or anything similar.
Probably requires some refactoring of naming for the parsing classes. The importer panel should really be "CryoET" or something similar, with the possibility to open
.starfile
or.ndjson
point instancing files.