Skip to content

CopickPicks

copick.models.CopickPicks

Encapsulates all data pertaining to a specific set of picked points. This includes the locations, orientations, and other metadata for the set of points.

Attributes:

  • run (CopickRun) –

    Reference to the run this pick belongs to.

  • meta (CopickPicksFile) –

    Metadata for this pick.

  • points (List[CopickPoint]) –

    Points for this pick. Either populated from storage or lazily loaded when CopickPicks.points is accessed for the first time.

  • from_tool (bool) –

    Flag to indicate if this pick was generated by a tool.

  • pickable_object_name (str) –

    Pickable object name from CopickConfig.pickable_objects[...].name

  • user_id (str) –

    Unique identifier for the user or tool name.

  • session_id (str) –

    Unique identifier for the pick session

  • trust_orientation (bool) –

    Flag to indicate if the angles are known for this pick or should be ignored.

  • color (Union[Tuple[int, int, int, int], None]) –

    Color of the pickable object this pick belongs to.

__init__(run: CopickRun, file: CopickPicksFile)

Parameters:

  • run (CopickRun) –

    Reference to the run this pick belongs to.

  • file (CopickPicksFile) –

    Metadata for this set of points.

load() -> CopickPicksFile

Load the points from storage.

Returns:

store()

Store the points (set using CopickPicks.points property).

refresh() -> None

Refresh the points from storage.

numpy() -> Tuple[np.ndarray, np.ndarray]

Return the points as a [N, 3] numpy array (N, [x, y, z]) and the transforms as a [N, 4, 4] numpy array. Format of the transforms is:

[[rxx, rxy, rxz, tx],
 [ryx, ryy, ryz, ty],
 [rzx, rzy, rzz, tz],
 [  0,   0,   0,  1]]

Returns:

  • Tuple[ndarray, ndarray]

    Tuple[np.ndarray, np.ndarray]: The picks and transforms as numpy arrays.

from_numpy(positions: np.ndarray, transforms: Optional[np.ndarray] = None) -> None

Set the points and transforms from numpy arrays.

Parameters:

  • positions (ndarray) –

    [N, 3] numpy array of positions (N, [x, y, z]).

  • transforms (Optional[ndarray], default: None ) –

    [N, 4, 4] numpy array of orientations. If None, transforms will be set to the identity matrix. Format of the transforms is:

    [[rxx, rxy, rxz, tx],
     [ryx, ryy, ryz, ty],
     [rzx, rzy, rzz, tz],
     [  0,   0,   0,  1]]