teamtomo / membrain-seg

membrane segmentation in 3D for cryo-ET
Other
48 stars 12 forks source link

Connected components #25

Closed LorenzLamm closed 11 months ago

LorenzLamm commented 11 months ago

This PR is about two things:

  1. Added functionality to compute connected components of output segmentation. This will assign different labels to different components to differentiate between different membranes. Also, it is useful to use this in combination with ColabSeg, which recommends connected components as inputs.
  2. Dataloading: As suggested in https://github.com/teamtomo/membrain-seg/issues/23 and https://github.com/teamtomo/membrain-seg/pull/22#pullrequestreview-1542271416 , I adjusted the dataloading: First, tomogram loading does not depend on flags whether to return a header anymore, but instead returns a Tomogram object which always contains data, header and voxel size. Second, I adjusted the data storing to be more efficient. Depending on the tomogram data type, it will try to find the most efficient .mrc file mode to store the data in. Thus, particularly segmentations can be stored much more efficiently (e.g. 2GB to 500MB). That's still way too much, but the best we can do with the mrc file format I think.