CopickFeatures
copick.models.CopickFeatures
Encapsulates all data pertaining to a specific feature map, i.e. the Zarr-store for the feature map.
Attributes:
-
tomogram
(CopickTomogram
) –Reference to the tomogram this feature map belongs to.
-
meta
(CopickFeaturesMeta
) –Metadata for this feature map.
-
tomo_type
(str
) –Type of the tomogram that the features were computed on.
-
feature_type
(str
) –Type of the features contained.
__init__(tomogram: CopickTomogram, meta: CopickFeaturesMeta)
Parameters:
-
tomogram
(CopickTomogram
) –Reference to the tomogram this feature map belongs to.
-
meta
(CopickFeaturesMeta
) –Metadata for this feature map.
zarr() -> MutableMapping
Override to return the Zarr store for this feature set. Also needs to handle creating the store if it doesn't exist.
numpy(zarr_group: str = '0', slices: Tuple[slice, ...] = None) -> np.ndarray
Returns the content of the Zarr-File for this feature map as a numpy array. Multiscale group and slices are supported.
Parameters:
-
zarr_group
(str
, default:'0'
) –Zarr group to access.
-
slices
(Tuple[slice, ...]
, default:None
) –Tuple of slices for the axes.
Returns:
-
ndarray
–np.ndarray: The object as a numpy array.
set_region(data: np.ndarray, zarr_group: str = '0', slices: Tuple[slice, ...] = None) -> None
Set the content of the Zarr-File for this feature map from a numpy array. Multiscale group and slices are supported.
Parameters:
-
data
(ndarray
) –The data to set.
-
zarr_group
(str
, default:'0'
) –Zarr group to access.
-
slices
(Tuple[slice, ...]
, default:None
) –Tuple of slices for the axes.