porespy.tools.parse_shape#
- porespy.tools.parse_shape(im_or_shape)#
Given a list of dimensions or an image finds shape in a clean format
- Parameters:
im_or_shape (scalar, list or ndarray) – Given a list of dimensions removes any 0, inf or None values. Given an image removes any singleton dimensions and returns shape. If a scalar then assumes a 3D shape is requested.
- Returns:
shape – List of [X, Y] or [X, Y, Z] dimensions
- Return type:
list