Skip to main content

CSI-Cancer image data structure and basic processing.

Project description

csi_images

Coverage Badge

This package contains classes and functions for interacting with images and image data. While much of the functionality is specific to the CSI-Cancer organization, some of the functionality and structure may be beneficial for the broader community. Other packages in the CSI-Cancer organization may depend on this package.

Install with:

pip install csi_images

Structure

This package contains these modules:

  1. csi_scans.py: a module for interacting with scan-level files, such as .czi files.
    • Scan: a class that contains all of the scan metadata. for interacting with scan metadata, such as the slide ID, the path to the scan, and scan parameters. Recommend importing via from csi_images.csi_scans import Scan
  2. csi_tiles.py: a module for interacting with tiles, which have a particular (x, y) position in the scan. Tiles have several frames taken at the same position.
    • Tile: a class for containing a tile's positional data. Imports csi_scans.py. This class unifies multiple scanners' tile positioning to convert between index and (x, y). Recommend importing via from csi_images.csi_tiles import Tile
  3. csi_frames.py: a module for interacting with frames, which are individual images. Imports csi_scans.py and csi_tiles.py. Recommend importing via from csi_images.csi_frames import Frame
    • Frame: a class for containing a frame's metadata. Each frame in a tile has a different channel, or light spectrum. The frame only contains metadata, but enables gathering of the image data through the get_image() method. For a list of frames, use get_frames(). For all frames in a scan, use get_all_frames(). For many frames, use [frame.get_image() for frame in frames]. Recommend importing via from csi_images.csi_frames import Frame
  4. csi_events.py: a module for interacting with individual events. Imports csi_scans.py, csi_tiles.py, and csi_frames.py.
    • Event: a class for containing a single event's metadata and feature data. Key metadata (scan, tile, x, y) is required; the others are optional and flexible. Contains a convenience function for getting crops of an event, as well as functions for determining the position of the event in the slide coordinate frame. Recommend importing via from csi_images.csi_events import Event
    • EventArray: a class for containing a list of events, holding their data in pandas dataframes. Contains functions converting back and forth from Events and files. Recommend importing via from csi_images.csi_events import EventArray

Planned Features

  • Event.montage(): Combines crops for an event into side-by-side montages.

Documentation

For more detailed documentation, check the API docs.

Alternatively, once you have cloned the repository, you can open up docs/index.html in your browser.

To regenerate the documentation, ensure that you have installed the package and then run:

make_docs_for_csi_images

Development Installation

  1. Activate your conda (conda activate yourenv) or venv (source path/to/your/venv/bin/activate) environment first.
  2. Clone csi_images and install:
cd ~/path/to/your/repositories
git clone git@github.com:CSI-Cancer/csi_images.git
pip install ./csi_images

Alternatively, you can "editable" install the package, which will allow you to make changes to the package and have them reflected in your environment without reinstalling:

pip install -e ./csi_images

This will add symbolic links to your site-packages directory instead of copying the package files over.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

csi_images-1.1.4.tar.gz (451.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

csi_images-1.1.4-py3-none-any.whl (26.7 kB view details)

Uploaded Python 3

File details

Details for the file csi_images-1.1.4.tar.gz.

File metadata

  • Download URL: csi_images-1.1.4.tar.gz
  • Upload date:
  • Size: 451.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for csi_images-1.1.4.tar.gz
Algorithm Hash digest
SHA256 526bf9b9a66d88797a6428c58bc1ce8de2d6da96bb24034af513350e652fba7c
MD5 9efc7e80d485c66f1391dabb7b292891
BLAKE2b-256 62391374689374e2fc6483876fd1675091ca2ae20c34539d53cdaf1e8dd9a828

See more details on using hashes here.

File details

Details for the file csi_images-1.1.4-py3-none-any.whl.

File metadata

  • Download URL: csi_images-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 26.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for csi_images-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2c44b4f14d4aa85fa73b21f84f1e91bd44f9e0f8c5513475099095d8b199d8b7
MD5 f3eee2d37e6eb85fea88f1b061c11b8d
BLAKE2b-256 4d02845a1e54438caa129b1634110ab986cb7031369e783fe346f3a25df2158e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page