copick


Namecopick JSON
Version 0.4.0 PyPI version JSON
download
home_pageNone
SummaryDefinitions for a collaborative cryoET annotation tool.
upload_time2024-04-27 17:51:19
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT License Copyright (c) 2024 Utz Ermel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords annotation collaborative copick cryo-et cryoet segmentation tomography
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # copick
Definitions for a collaborative cryoET annotation tool.

## Data Spec

Shared data is organized as follows:

```
[copick_root]/
|-- copick_config.json (spec: src/models.py:CopickConfig)
|-- ParticleMrcs/
    |-- [object_id]_[object_name].mrc (index: src/models.py:CopickConfig.pickable_objects.object_name)
|-- ExperimentRuns
    |-- [run_name]/ (index: src/io/copick_models.py:CopickPicks.runs)
        |-- VoxelSpacing[xx.yyy]/
        |   |-- [tomotype].zarr/
        |   |   |-- [multiscale subdirectories according to OME-NGFF spec at 100%, 50% and 25% scale]
        |   |-- [tomotype]_[feature_type]_features.zarr/
        |       |-- [multiscale subdirectories according to OME-NGFF spec at 100% scale]
        |-- VoxelSpacing[x2.yy2]/
        |   |-- [tomotype].zarr/
        |   |   |-- [multiscale subdirectories according to OME-NGFF spec at 100%, 50% and 25% scale]
        |   |-- [tomotype]_[feature_type]_features.zarr/
        |       |-- [multiscale subdirectories according to OME-NGFF spec at 100% scale]
        |-- Picks/
        |   |-- [user_id | tool_name]_[session_id | 0]_[object_name].json (spec: src/models.py:CopickPicks)
        |-- Meshes/
        |   |-- [user_id | tool_name]_[session_id | 0]_[object_name].glb (spec: src/models.py:TBD)
        |-- Segmentations/
            |-- [xx.yyy]_[user_id | tool_name]_[session_id | 0]_[object_name].zarr (spec: src/models.py:TBD)
            |   |-- [multiscale subdirectories according to OME-NGFF spec at 100% scale, 50% and 25% scale]
            |-- [xx.yyy]_[user_id | tool_name]_[session_id | 0]_[name]-multilabel.zarr (spec: src/models.py:TBD)
                |-- [multiscale subdirectories according to OME-NGFF spec at 100% scale, 50% and 25% scale]
```

## Sample Data

A test set is hosted on [zenodo](https://doi.org/10.5281/zenodo.10905908).

The fsspec implementation allows the dataset to be split into a static and an overlay part. The static part is read-only
and contains the original data. The overlay part is read-write and contains the user-specific annotations.

### Config for identical location

```json
{
    "name": "test",
    "description": "A test project.",
    "version": "1.0.0",

    "pickable_objects": [
        {
            "name": "proteasome",
            "is_particle": true,
            "pdb_id": "3J9I",
            "label": 1,
            "color": [255, 0, 0, 255]
        },
        {
            "name": "ribosome",
            "is_particle": true,
            "pdb_id": "7P6Z",
            "label": 2,
            "color": [0, 255, 0, 255]
        },
        {
            "name": "membrane",
            "is_particle": false,
            "label": 3,
            "color": [0, 0, 0, 255]
        }
    ],

    "overlay_root": "local:///PATH/TO/sample_project",
    "static_root": "local:///PATH/TO/sample_project",

    "overlay_fs_args": {
        "auto_mkdir": true
    }
}
```

### Config for static remote and mutable local dataset

This has the additional `s3fs` requirement.

```json
{
    "name": "test",
    "description": "A test project.",
    "version": "1.0.0",

    "pickable_objects": [
        {
            "name": "proteasome",
            "is_particle": true,
            "pdb_id": "3J9I",
            "label": 1,
            "color": [255, 0, 0, 255]
        },
        {
            "name": "ribosome",
            "is_particle": true,
            "pdb_id": "7P6Z",
            "label": 2,
            "color": [0, 255, 0, 255]
        },
        {
            "name": "membrane",
            "is_particle": false,
            "label": 3,
            "color": [0, 0, 0, 255]
        }
    ],

    "overlay_root": "local:///PATH/TO/sample_project",
    "static_root": "s3://bucket/path/to/sample_project",

    "overlay_fs_args": {
        "auto_mkdir": true
    }
}
```

### API overview
```python
from copick.impl.filesystem import CopickRootFSSpec
import zarr

# Project root
root = CopickRootFSSpec.from_file("/PATH/TO/sample_project/copick_config_filesystem.json")

## Root API
root.config # CopickConfig object
root.runs # List of run objects (lazy loading from filesystem location(s))
root.get_run("run_name") # Get a run by name
run = root.new_run("run_name") # Create a new run (appends to the list of runs and creates directory in overlay fs location)
root.refresh() # Refresh the list of runs from filesystem location(s)

## Run API
# Hierarchical objects (lazy loading from filesystem location(s))
run.picks # List of pick objects
run.meshes # List of mesh objects
run.segmentations # List of segmentation objects
run.voxel_spacings # List of voxel spacing objects

# Create new objects
run.new_pick("user_id", "session_id", "object_name") # Create a new pick object (appends to the list of picks and creates file in overlay fs location)
run.new_mesh("user_id", "session_id", "object_name") # Create a new mesh object (appends to the list of meshes and creates file in overlay fs location)
run.new_segmentation("user_id", "session_id") # Create a new segmentation object (appends to the list of segmentations and creates zarr file in overlay fs location)
run.new_voxel_spacing(10.000) # Create a new voxel spacing object (appends to the list of voxel spacings and creates directory in overlay fs location)

# Get objects by name
run.get_picks(object_name="object_name") # Get all picks (list) for this run with a given object name
# ... similar for meshes, segmentations, voxel spacings

## Pick API
pick = run.picks[0] # Get a pick object
pick.points # List of CopickPoint objects

## Mesh API
mesh = run.meshes[0] # Get a mesh object
mesh.mesh # Trimesh scene object

## Segmentation API
segmentation = run.segmentations[0] # Get a segmentation object
segmentation.zarr() # zarr.storage.FSStore object

## VoxelSpacing API
voxel_spacing = run.voxel_spacings[0] # Get a voxel spacing object
voxel_spacing.tomograms # List of CopickTomogram objects

## Tomogram API
tomogram = voxel_spacing.tomograms[0] # Get a tomogram object
tomogram.zarr() # zarr.storage.FSStore object
tomogram.features # List of CopickTomogramFeature objects


# Example usage
# List of runs
print(root.runs)

# Points
print(root.runs[0].picks[0].points)

# List of meshes
print(root.runs[0].meshes)

# List of segmentations
print(root.runs[0].segmentations)

# List of voxel spacings
print(root.runs[0].voxel_spacings)

# List of tomograms
print(root.runs[0].voxel_spacings[0].tomograms)

# Get Zarr store for a tomogram
print(zarr.open_group(root.runs[0].voxel_spacings[0].tomograms[0].zarr()).info)

# Get Zarr store for a tomogram feature
print(root.runs[0].voxel_spacings[0].tomograms[1].features)
print(zarr.open_group(root.runs[0].voxel_spacings[0].tomograms[1].features[0].zarr()).info)

# Get a pick file's contents
print(root.runs[0].picks[0].load())

# Get a mesh file's contents
print(root.runs[0].meshes[0].mesh)

# Get a Zarr store for a segmentation
print(root.runs[0].segmentations[0].path)
print(zarr.open_group(root.runs[0].segmentations[0].zarr()).info)

```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "copick",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "annotation, collaborative, copick, cryo-et, cryoet, segmentation, tomography",
    "author": null,
    "author_email": "\"Utz H. Ermel\" <utz.ermel@czii.org>, \"Kyle I. S. Harrington\" <kyle@kyleharrington.com>",
    "download_url": "https://files.pythonhosted.org/packages/19/e0/224c83a65d1c049f8e0960f73a4205b0a09627308c86450a96f130086061/copick-0.4.0.tar.gz",
    "platform": null,
    "description": "# copick\nDefinitions for a collaborative cryoET annotation tool.\n\n## Data Spec\n\nShared data is organized as follows:\n\n```\n[copick_root]/\n|-- copick_config.json (spec: src/models.py:CopickConfig)\n|-- ParticleMrcs/\n    |-- [object_id]_[object_name].mrc (index: src/models.py:CopickConfig.pickable_objects.object_name)\n|-- ExperimentRuns\n    |-- [run_name]/ (index: src/io/copick_models.py:CopickPicks.runs)\n        |-- VoxelSpacing[xx.yyy]/\n        |   |-- [tomotype].zarr/\n        |   |   |-- [multiscale subdirectories according to OME-NGFF spec at 100%, 50% and 25% scale]\n        |   |-- [tomotype]_[feature_type]_features.zarr/\n        |       |-- [multiscale subdirectories according to OME-NGFF spec at 100% scale]\n        |-- VoxelSpacing[x2.yy2]/\n        |   |-- [tomotype].zarr/\n        |   |   |-- [multiscale subdirectories according to OME-NGFF spec at 100%, 50% and 25% scale]\n        |   |-- [tomotype]_[feature_type]_features.zarr/\n        |       |-- [multiscale subdirectories according to OME-NGFF spec at 100% scale]\n        |-- Picks/\n        |   |-- [user_id | tool_name]_[session_id | 0]_[object_name].json (spec: src/models.py:CopickPicks)\n        |-- Meshes/\n        |   |-- [user_id | tool_name]_[session_id | 0]_[object_name].glb (spec: src/models.py:TBD)\n        |-- Segmentations/\n            |-- [xx.yyy]_[user_id | tool_name]_[session_id | 0]_[object_name].zarr (spec: src/models.py:TBD)\n            |   |-- [multiscale subdirectories according to OME-NGFF spec at 100% scale, 50% and 25% scale]\n            |-- [xx.yyy]_[user_id | tool_name]_[session_id | 0]_[name]-multilabel.zarr (spec: src/models.py:TBD)\n                |-- [multiscale subdirectories according to OME-NGFF spec at 100% scale, 50% and 25% scale]\n```\n\n## Sample Data\n\nA test set is hosted on [zenodo](https://doi.org/10.5281/zenodo.10905908).\n\nThe fsspec implementation allows the dataset to be split into a static and an overlay part. The static part is read-only\nand contains the original data. The overlay part is read-write and contains the user-specific annotations.\n\n### Config for identical location\n\n```json\n{\n    \"name\": \"test\",\n    \"description\": \"A test project.\",\n    \"version\": \"1.0.0\",\n\n    \"pickable_objects\": [\n        {\n            \"name\": \"proteasome\",\n            \"is_particle\": true,\n            \"pdb_id\": \"3J9I\",\n            \"label\": 1,\n            \"color\": [255, 0, 0, 255]\n        },\n        {\n            \"name\": \"ribosome\",\n            \"is_particle\": true,\n            \"pdb_id\": \"7P6Z\",\n            \"label\": 2,\n            \"color\": [0, 255, 0, 255]\n        },\n        {\n            \"name\": \"membrane\",\n            \"is_particle\": false,\n            \"label\": 3,\n            \"color\": [0, 0, 0, 255]\n        }\n    ],\n\n    \"overlay_root\": \"local:///PATH/TO/sample_project\",\n    \"static_root\": \"local:///PATH/TO/sample_project\",\n\n    \"overlay_fs_args\": {\n        \"auto_mkdir\": true\n    }\n}\n```\n\n### Config for static remote and mutable local dataset\n\nThis has the additional `s3fs` requirement.\n\n```json\n{\n    \"name\": \"test\",\n    \"description\": \"A test project.\",\n    \"version\": \"1.0.0\",\n\n    \"pickable_objects\": [\n        {\n            \"name\": \"proteasome\",\n            \"is_particle\": true,\n            \"pdb_id\": \"3J9I\",\n            \"label\": 1,\n            \"color\": [255, 0, 0, 255]\n        },\n        {\n            \"name\": \"ribosome\",\n            \"is_particle\": true,\n            \"pdb_id\": \"7P6Z\",\n            \"label\": 2,\n            \"color\": [0, 255, 0, 255]\n        },\n        {\n            \"name\": \"membrane\",\n            \"is_particle\": false,\n            \"label\": 3,\n            \"color\": [0, 0, 0, 255]\n        }\n    ],\n\n    \"overlay_root\": \"local:///PATH/TO/sample_project\",\n    \"static_root\": \"s3://bucket/path/to/sample_project\",\n\n    \"overlay_fs_args\": {\n        \"auto_mkdir\": true\n    }\n}\n```\n\n### API overview\n```python\nfrom copick.impl.filesystem import CopickRootFSSpec\nimport zarr\n\n# Project root\nroot = CopickRootFSSpec.from_file(\"/PATH/TO/sample_project/copick_config_filesystem.json\")\n\n## Root API\nroot.config # CopickConfig object\nroot.runs # List of run objects (lazy loading from filesystem location(s))\nroot.get_run(\"run_name\") # Get a run by name\nrun = root.new_run(\"run_name\") # Create a new run (appends to the list of runs and creates directory in overlay fs location)\nroot.refresh() # Refresh the list of runs from filesystem location(s)\n\n## Run API\n# Hierarchical objects (lazy loading from filesystem location(s))\nrun.picks # List of pick objects\nrun.meshes # List of mesh objects\nrun.segmentations # List of segmentation objects\nrun.voxel_spacings # List of voxel spacing objects\n\n# Create new objects\nrun.new_pick(\"user_id\", \"session_id\", \"object_name\") # Create a new pick object (appends to the list of picks and creates file in overlay fs location)\nrun.new_mesh(\"user_id\", \"session_id\", \"object_name\") # Create a new mesh object (appends to the list of meshes and creates file in overlay fs location)\nrun.new_segmentation(\"user_id\", \"session_id\") # Create a new segmentation object (appends to the list of segmentations and creates zarr file in overlay fs location)\nrun.new_voxel_spacing(10.000) # Create a new voxel spacing object (appends to the list of voxel spacings and creates directory in overlay fs location)\n\n# Get objects by name\nrun.get_picks(object_name=\"object_name\") # Get all picks (list) for this run with a given object name\n# ... similar for meshes, segmentations, voxel spacings\n\n## Pick API\npick = run.picks[0] # Get a pick object\npick.points # List of CopickPoint objects\n\n## Mesh API\nmesh = run.meshes[0] # Get a mesh object\nmesh.mesh # Trimesh scene object\n\n## Segmentation API\nsegmentation = run.segmentations[0] # Get a segmentation object\nsegmentation.zarr() # zarr.storage.FSStore object\n\n## VoxelSpacing API\nvoxel_spacing = run.voxel_spacings[0] # Get a voxel spacing object\nvoxel_spacing.tomograms # List of CopickTomogram objects\n\n## Tomogram API\ntomogram = voxel_spacing.tomograms[0] # Get a tomogram object\ntomogram.zarr() # zarr.storage.FSStore object\ntomogram.features # List of CopickTomogramFeature objects\n\n\n# Example usage\n# List of runs\nprint(root.runs)\n\n# Points\nprint(root.runs[0].picks[0].points)\n\n# List of meshes\nprint(root.runs[0].meshes)\n\n# List of segmentations\nprint(root.runs[0].segmentations)\n\n# List of voxel spacings\nprint(root.runs[0].voxel_spacings)\n\n# List of tomograms\nprint(root.runs[0].voxel_spacings[0].tomograms)\n\n# Get Zarr store for a tomogram\nprint(zarr.open_group(root.runs[0].voxel_spacings[0].tomograms[0].zarr()).info)\n\n# Get Zarr store for a tomogram feature\nprint(root.runs[0].voxel_spacings[0].tomograms[1].features)\nprint(zarr.open_group(root.runs[0].voxel_spacings[0].tomograms[1].features[0].zarr()).info)\n\n# Get a pick file's contents\nprint(root.runs[0].picks[0].load())\n\n# Get a mesh file's contents\nprint(root.runs[0].meshes[0].mesh)\n\n# Get a Zarr store for a segmentation\nprint(root.runs[0].segmentations[0].path)\nprint(zarr.open_group(root.runs[0].segmentations[0].zarr()).info)\n\n```\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Utz Ermel  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Definitions for a collaborative cryoET annotation tool.",
    "version": "0.4.0",
    "project_urls": {
        "Issues": "https://github.com/uermel/copick/issues",
        "Repository": "https://github.com/uermel/copick.git"
    },
    "split_keywords": [
        "annotation",
        " collaborative",
        " copick",
        " cryo-et",
        " cryoet",
        " segmentation",
        " tomography"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2ffb829ae091d3533ead7c476c07f3006e66378c9b65266ac7dd9d7cc145f9ce",
                "md5": "790c080ae84b609111cf31f93ce6a73c",
                "sha256": "a3b9dd59aca0b96672f74087fc6ecc5368a4bf19769b20c6f659b08e1ef688f2"
            },
            "downloads": -1,
            "filename": "copick-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "790c080ae84b609111cf31f93ce6a73c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 18122,
            "upload_time": "2024-04-27T17:51:18",
            "upload_time_iso_8601": "2024-04-27T17:51:18.145099Z",
            "url": "https://files.pythonhosted.org/packages/2f/fb/829ae091d3533ead7c476c07f3006e66378c9b65266ac7dd9d7cc145f9ce/copick-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "19e0224c83a65d1c049f8e0960f73a4205b0a09627308c86450a96f130086061",
                "md5": "14efbc51e9607a269911d8347c350953",
                "sha256": "82444b440c4ab180d73d2f07a83e86a22831325b365c57d518b9063a52cd7eb9"
            },
            "downloads": -1,
            "filename": "copick-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "14efbc51e9607a269911d8347c350953",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 17669,
            "upload_time": "2024-04-27T17:51:19",
            "upload_time_iso_8601": "2024-04-27T17:51:19.979800Z",
            "url": "https://files.pythonhosted.org/packages/19/e0/224c83a65d1c049f8e0960f73a4205b0a09627308c86450a96f130086061/copick-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-27 17:51:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "uermel",
    "github_project": "copick",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "copick"
}
        
Elapsed time: 0.24470s