cvpy.biomedimage.BiomedImageTable.BiomedImageTable.sphericity¶
- BiomedImageTable.sphericity(use_spacing: bool, input_background: float, label_connectivity: LabelConnectivity, output_table_parms: Dict[str, str] | None = None) CASTable ¶
Quantify the sphericity for the given component from this BiomedImageTable.
- Parameters:
- use_spacing: :class:’bool’
When set to True, use image spacing in the sphericity calculation.
- input_background: :class:’float’
Specifies the background value in input images.
- label_connectivity: LabelConnectivity.FACE | LabelConnectivity.VERTEX
Specifies the level of connectivity for connected components: LabelConnectivity.FACE or LabelConnectivity.VERTEX
- output_table_parms:class:’Dict[str,str]’
Specifies the parameters in the output image table.
- Returns:
- :class:’CASTable’
Examples
>>> # Import classes >>> from swat import CAS >>> from cvpy.biomedimage.BiomedImageTable import BiomedImageTable >>> from cvpy.biomedimage.LabelConnectivity import LabelConnectivity >>> ## Connect to CAS >>> s = CAS("example.com", 5570) >>> # Construct tables that are parameters to the sphericity API >>> image_table = s.CASTable(...) >>> # Construct Biomed object >>> biomed = BiomedImageTable(image_table) >>> # Call the API >>> output_table = biomed.sphericity(use_spacing, ...., label_connectivity)