Skip to content

added dynamic erosion voxel size based in input data voxel size#164

Merged
constantinpape merged 4 commits into
mainfrom
163-cristae-segmentation-mitochondria-erosion
Apr 22, 2026
Merged

added dynamic erosion voxel size based in input data voxel size#164
constantinpape merged 4 commits into
mainfrom
163-cristae-segmentation-mitochondria-erosion

Conversation

@lufre1
Copy link
Copy Markdown
Contributor

@lufre1 lufre1 commented Apr 14, 2026

No description provided.

@lufre1 lufre1 linked an issue Apr 14, 2026 that may be closed by this pull request
@lufre1 lufre1 requested a review from constantinpape April 14, 2026 14:54
Comment thread synapse_net/inference/cristae.py Outdated
mito_seg = scaler.scale_input(mitochondria, is_segmentation=True)
input_volume = np.stack([volume, mito_seg], axis=0)

erode_voxels = max(1, round(6.0 / erosion_voxel_size))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What exactly is the logic here? I.e. why 6 divided by the erosion_voxel_size.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This assumes the average outer mito membrane is 6nm thick. The erosion voxel size is the voxel size in which the model runs inference: e.g. 1.45nm then we get 4 voxels to erode

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i've checked some of the test split tomos and it appears that the mito membrane is bigger than 6nm - for the tomos i checked it averages at approx. 10nm


# target 10nm erosion for mitochondria
# voxel_size is the model's training voxel size, which is the space we erode in
erode_voxels = max(1, round(10.0 / voxel_size))
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we resize the input volume to the model's training voxel_size, so we can use this voxel_size to compute the voxels that correspond to 10nm to use for the erosion

@constantinpape constantinpape merged commit 4f03f00 into main Apr 22, 2026
3 checks passed
@constantinpape constantinpape deleted the 163-cristae-segmentation-mitochondria-erosion branch April 22, 2026 14:59
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.

cristae segmentation: mitochondria erosion

2 participants