upxo.pxtal.images1 module

Composable 3D labelled-image stack (ops / props / viz plugins).

Experimental redesign of IMAGE_3D with abstract bases for morphological, topological, and spatial operations, property calculators, visualisers, and IMAGE_3D_New as the orchestrating container. Prefer the mature IMAGE_3D / MCGS paths for production until this stack is fully implemented.

class upxo.pxtal.images1.BaseOperations[source]

Bases: ABC

Abstract partitioning ops interface for 3D label images.

abstractmethod part(img: ndarray) → Tuple[ndarray, int][source]

Partition an image into features

class upxo.pxtal.images1.BaseProperties[source]

Bases: ABC

Abstract per-feature property calculator interface.

abstractmethod calculate(feature_id: int) → Dict[str, Any][source]

Calculate properties for a given feature

class upxo.pxtal.images1.BaseVisualizer[source]

Bases: ABC

Abstract visualisation interface for 3D image features.

abstractmethod show(data: ndarray) → None[source]

Display the data

class upxo.pxtal.images1.VoxelConfig(size: float = 1.0, anisotropy: Tuple[float, float, float] = (1.0, 1.0, 1.0))[source]

Bases: object

Voxel size and anisotropy for physical scaling of IMAGE_3D_New.

size: float = 1.0
anisotropy: Tuple[float, float, float] = (1.0, 1.0, 1.0)
class upxo.pxtal.images1.ImageConfig(voxel: VoxelConfig = <factory>, connectivity: int = 1, debug_mode: bool = False)[source]

Bases: object

Top-level config for IMAGE_3D_New (voxel, connectivity, debug).

voxel: VoxelConfig
connectivity: int = 1
debug_mode: bool = False
class upxo.pxtal.images1.MorphologicalOps(config: ImageConfig)[source]

Bases: BaseOperations

Connected-component partitioning via scipy.ndimage label structures.

part(img: ndarray) → Tuple[ndarray, int][source]

Partition image into features using connected components

class upxo.pxtal.images1.TopologicalOps(config: ImageConfig)[source]

Bases: BaseOperations

Topological partitioning of 3D features (not implemented yet).

part(img: ndarray) → Tuple[ndarray, int][source]

Partition based on topological features

class upxo.pxtal.images1.SpatialOps(config: ImageConfig)[source]

Bases: BaseOperations

Spatial-feature partitioning of 3D volumes (not implemented yet).

part(img: ndarray) → Tuple[ndarray, int][source]

Partition based on spatial features

class upxo.pxtal.images1.MorphologicalProps(image3d: IMAGE_3D_New)[source]

Bases: BaseProperties

Volume, centre, and bbox morphological props for one feature ID.

calculate(feature_id: int) → Dict[str, Any][source]

Calculate morphological properties for a feature

class upxo.pxtal.images1.TopologicalProps(image3d: IMAGE_3D_New)[source]

Bases: BaseProperties

Neighbour-graph topological props (degree, betweenness) per feature.

calculate(feature_id: int) → Dict[str, Any][source]

Calculate topological properties for a feature

class upxo.pxtal.images1.SpatialProps(image3d: IMAGE_3D_New)[source]

Bases: BaseProperties

Position, extent, and anisotropy spatial props for one feature ID.

calculate(feature_id: int) → Dict[str, Any][source]

Calculate spatial properties for a feature

class upxo.pxtal.images1.MorphologicalViz(image3d: IMAGE_3D_New)[source]

Bases: BaseVisualizer

Max-projection matplotlib views of morphological 3D fields.

show(data: ndarray) → None[source]

Display morphological features

class upxo.pxtal.images1.TopologicalViz(image3d: IMAGE_3D_New)[source]

Bases: BaseVisualizer

NetworkX graph visualisation of feature topology (stub layout).

show(data: ndarray) → None[source]

Display topological features

class upxo.pxtal.images1.IMAGE_3D_New(image: ndarray, config: ImageConfig | None = None)[source]

Bases: object

Plugin-style 3D labelled image: config + ops/props/viz bundles.

Holds a working copy of a 3D integer volume, ImageConfig, and dictionaries of operation / property / visualisation plugins. Prefer IMAGE_3D for production until this redesign is complete.

base
img
config
ops
props
viz
partition(method: str = 'morphological') → Tuple[ndarray, int][source]

Partition the image using specified method

clear_cache()[source]

Clear the feature cache

count_features() → int[source]

Count unique features in the image