segmCrop=np.isin(temp[minX:maxX,minY:maxY],[0,glomID])# please note that this way of expanding rectangular search regions, feature computation is strongly accelerated (instead of masking search regions using ball-shaped masks)
resultsRootFolder=''# Folder comprising the predicted segmentation files
featureRootFolder=''# Folder to save the computed features of their structures
ifnotos.path.exists(featureRootFolder):
os.makedirs(featureRootFolder)
########
LOAD_PRECOMPUTED_FEATURES=False# In case of adjustments of already computed features (e.g. adding a feature), one can load them in and only perform computation for new features
########
tubuliInstanceID_StartsWith=10# => tubuli instances start with id 10
bgLabel=8# => background label is 8
lengthOfPixel=0.33721# in micrometers, since we used 174um sized image patches sampled into 516x516 images
tissueFeatures['glom_shape_elongation']=np.array([1.-e.minor_axis_length/e.major_axis_lengthforeinregionPropsTemp])# from 0-1, 0=circle, the higher the number, the elongated subject is
tissueFeatures['glom_tuft_shape_elongation']=np.array([1.-e.minor_axis_length/e.major_axis_lengthforeinregionPropsTemp])# from 0-1, 0=circle, the higher the number, the elongated subject is
# tissueFeatures['tuft_shape_solidity'] = np.array([e.solidity for e in regionPropsTemp]) # convexity measure
# tissueFeatures['tuft_shape_circularity'] = np.array([(4.*np.pi*e.area)/np.square(e.perimeter) for e in regionPropsTemp]) # circularity measure
# tissueFeatures['tuft_shape_elongation'] = np.array([1.- e.minor_axis_length/e.major_axis_length for e in regionPropsTemp]) # from 0-1, 0=circle, the higher the number, the elongated subject is
# tissueFeatures['tuft_shape_eccentricity'] = np.array([e.eccentricity for e in regionPropsTemp]) # eccentricity, inertia ratio: 0 = circle, 1 = ellipse