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__(run: CopickRun, meta: CopickVoxelSpacingMeta, config: Optional[CopickConfig] = None)
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() -> List[CopickTomogram]
Override this method to query for tomograms.
get_tomogram(tomo_type: str) -> Union[CopickTomogram, None]
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
None
if not found.
get_tomograms(tomo_type: str) -> List[CopickTomogram]
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.
refresh_tomograms() -> None
Refresh CopickVoxelSpacing.tomograms
from storage.
refresh() -> None
Refresh CopickVoxelSpacing.tomograms
from storage.
new_tomogram(tomo_type: str, **kwargs) -> CopickTomogram
Create a new tomogram object, also creates the Zarr-store in the storage backend.
Parameters:
-
tomo_type
(str
) –Type of the tomogram to create.
-
**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(create: bool = False) -> bool
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.