CopickVoxelSpacing
copick.models.CopickVoxelSpacing
Encapsulates all data pertaining to a specific voxel spacing. This includes the tomograms and feature maps at this voxel spacing.
Attributes:
-
run(CopickRun) –Reference to the run this voxel spacing belongs to.
-
meta(CopickVoxelSpacingMeta) –Metadata for this voxel spacing.
-
tomograms(List[CopickTomogram]) –Tomograms for this voxel spacing. Either populated from config or lazily loaded when CopickVoxelSpacing.tomograms is accessed for the first time.
__init__
Parameters:
-
run(CopickRun) –Reference to the run this voxel spacing belongs to.
-
meta(CopickVoxelSpacingMeta) –Metadata for this voxel spacing.
-
config(Optional[CopickConfig], default:None) –Configuration of the copick project.
query_tomograms
Override this method to query for tomograms.
get_tomogram
Get tomogram by type.
Parameters:
-
tomo_type(str) –Type of the tomogram to retrieve.
Returns:
-
CopickTomogram(Union[CopickTomogram, None]) –The tomogram with the given type, or
Noneif not found.
get_tomograms
Get tomograms by type.
Parameters:
-
tomo_type(str) –Type of the tomograms to retrieve.
Returns:
-
List[CopickTomogram]–List[CopickTomogram]: The tomograms with the given type.
new_tomogram
Create a new tomogram object, also creates the Zarr-store in the storage backend.
Parameters:
-
tomo_type(str) –Type of the tomogram to create.
-
exist_ok(bool, default:False) –Whether to raise an error if the tomogram already exists.
-
**kwargs–Additional keyword arguments for the tomogram metadata.
Returns:
-
CopickTomogram(CopickTomogram) –The newly created tomogram object.
Raises:
-
ValueError–If a tomogram with the given type already exists for this voxel spacing.
ensure
Override to check if the voxel spacing record exists, optionally create it if it does not.
Parameters:
-
create(bool, default:False) –Whether to create the voxel spacing record if it does not exist.
Returns:
-
bool(bool) –True if the voxel spacing record exists, False otherwise.