Skip to content

Conversation

aranega
Copy link
Member

@aranega aranega commented Jun 13, 2025

Description

Adds the production of oriented mesh layers if meshes related to oriented point are found in the input bucket.

screen

The input bucket needs to have the meshes in the mesh_source directory, located at the root of the dataset folder, e.g:

input_bucket/CZII/202410_simulated_2/TS_0/
├── mesh_source
│   ├── beta_amylase.glb
│   ├── beta_galactosidase.glb
│   ├── ferritin_complex.glb
│   ├── ribosome.glb
│   ├── thyroglobulin.glb
│   └── virus_like_capsid.glb
└── TS_0
    ├── mdocs
    │   └── TS_0_vali.mdoc
    ├── Picks
    │   ├── apo-ferritin.star
    │   ├── beta-amylase.star
    │   ├── beta-galactoside.star
    │   ├── ribosome.star
    │   ├── thyroglobulin.star
    │   └── virus-like-particle.star
    ├── Segmentations
    │   └── ground_truth.mrc
    ├── TiltSeries
    │   ├── tilt_series.mrc
    │   ├── TS_0_st.rawtlt
    │   ├── TS_0_st.tlt
    │   └── TS_0_st.xf
    └── VoxelSpacing10.000
        └── wbp.mrc

8 directories, 19 files

@aranega aranega requested a review from seankmartin June 13, 2025 16:41
Copy link

@seankmartin seankmartin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, thanks! Some comments from reading the code, going to try it out now as well

Edit - I tried it, looks nice :) I think we need to resolve with CZI what the state should actually be in this case. And then once we know what the "ideal" state for this data would be we can go backwards and discuss whether the backend should handle that or the Python generation. Likely some combo of both would be needed.


return state_generator.generate_oriented_point_mesh_layer(**args)

def _has_mesh(self, path: str):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should either be more generic and take the shape into account for the names that are searched for, or the function should be named differently. Like _has_oriented_point_mesh for e.g.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sidenote -- it might be clearer if the function took an input shape as an arg and called path.replace(input_shape.lower(), "orientedmesh"). I'd also probably be inclined to run this after splitting on "_" and do it on the last one or similar in case for some reason the input had "_segmentationmask" for e.g. in it but not just at the end because then it wouldn't match correctly. It seems unlikely to happen but I feel you never know with filenames

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whatever the decision on that it would need to be reflected in visualization_precompute L154

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @seankmartin I did all the modifications you suggested, one not though about this method. I took a long time to try to avoid it, by linking the source configuration with the target one, to avoid to have to rely on this "juggling" in names. However, there is nothing that clearly relates the output layer configuration with the source configuration. The detection has to pass by considering sub-strings inclusion, and at the end, it doesn't feel more stable or "stronger" that this one that only relies on switching the "kind" of produced layer to check for mesh existence.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @aranega don't worry, thank you for taking a look at that and trying to make the change!
Having the name changed to be more specific to oriented points and changing the last occurence of the string is much nicer so this is all good

@seankmartin
Copy link

Small note, the mesh_source in the config were setup with - in some names by my files are all _ not sure what's going on there, we should check. But not important, for now I just fixed the config

Copy link

@seankmartin seankmartin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you!

@aranega
Copy link
Member Author

aranega commented Jun 26, 2025

PR opened here chanzuckerberg#511

@seankmartin
Copy link

Closing as made PR to main repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants