kalemaria / pycurv

Reliable estimation of membrane curvature for cryo-electron tomography
GNU Lesser General Public License v3.0
16 stars 7 forks source link

Using second segmentation for lumen #5

Closed jqyhuang closed 3 years ago

jqyhuang commented 4 years ago

Hi Maria!

Hope you're doing well. I was wondering if it's possible to use one segmentation for the membrane and an additional for the lumen, in lieu of a single file containing the segmentations for both the membrane and the lumen. I currently have two annotations of the same tomogram, where both the membrane and the lumen are labelled 1, and I'm having trouble merging the two with the programs I am familiar with.

Thank you! Judy

kalemaria commented 4 years ago

Hi Judy,

Sorry for the late reply. Yes, you can read in the membrane and the lumen segmentations from different files, where both are labelled with 1: mem_seg = io.load_tomo(mem_seg_file) data_type = mem_seg.dtype lum_seg = io.load_tomo(lum_seg_file)

then create the compartment segmentation by joining the two arrays (they have to have the same shape): comp_seg = np.logical_or(mem_seg == 1, lum_seg == 1).astype(data_type)

and finally generate the surface like this: surf = run_gen_surface(comp_seg, fold + base_filename, other_mask=mem_seg, isosurface=True, sg=1, thr=THRESH_SIGMA1)

Sorry that PyCurv interface is so low level and requires some Python scripting. I am considering to implement some convenience routines to simplify the usage, at least for the main curvature workflow steps. Please feel free to write me an email for any suggestions or further questions: salfer@biochem.mpg.de

Thanks and best! Ria