Skip to main content

No project description provided

Project description

pyimc

Library for accessing imaging mass cytometry (IMC) data stored in .mcd files. Access is provided to all channel data, metadata and optical images stored within the file. Additionally, it is possible to generate slide overview images which can be used in whole slide imaging registration workflows.

Installation

pip install pyimc

Usage

IMC data in *.mcd files are stored in a spectrum-wise manner, in the order acquired on the instrument. This allows fast access to individual pixel information, but requires reading in all data from a single acquisition to generate a single channel image. To provide fast access to image data, an optional means of opening the data is demonstrated below, with the caveat that this generates a temporary binary file in the same location as the .mcd file, the first time this function is called, which can take a few seconds. The temporary binary file is approximately 33% as big as the original .mcd file.

With fast access to images

import pyimc

data = pyimc.Mcd.parse_with_dcm("/path/to/data.mcd")

Without fast access to images

import pyimc

data = pyimc.Mcd.parse_with_dcm("/path/to/data.mcd")

Access to channel data

# Get the first slide (there is usually only one)
slide = data.slide(1)

# Get list of all acquisition IDs in the data
acquisition_ids = data.acquisition_ids() 

# Get 3rd acquisition
acquisition = data.acquisition(acquisition_ids[2])

# Get the channel list for the current acquisition
channels = acquisition.channels()

# Select for 10th channel
channel = channels[9]

print(channel.label())
print(channel.name())

# Get the image data for the channel as a numpy array from the chosen acquisition
channel_data = acquisition.channel_data(channel)

Access panorama image

# Get panorama with ID = 3
panorama = data.panorama(3)

# Get optical image associated with the panorama
image = panorama.image()

Generate slide overview image

# Get the first slide (there is usually only one)
slide = data.slide(1)

# Get all channels in the slide
channels = slide.channels()

# Select the 10th channel
channel = channels[9]

# Generate an overview image of the slide with a width of 7500 pixels (height will be 
# automatically scaled), displaying the selected channel image in the relative location
# on the slide where the acquisition was performed, thresholding the intensity at 10
overview_image = slide.overview_image(7500, channel, 10)

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

pyimc-0.1.0.tar.gz (33.6 kB view details)

Uploaded Source

Built Distributions

pyimc-0.1.0-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.7 MB view details)

Uploaded PyPy manylinux: glibc 2.5+ x86-64

pyimc-0.1.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.5+ x86-64

pyimc-0.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.5+ x86-64

pyimc-0.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.5+ x86-64

pyimc-0.1.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.5+ x86-64

pyimc-0.1.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.6m manylinux: glibc 2.5+ x86-64

File details

Details for the file pyimc-0.1.0.tar.gz.

File metadata

  • Download URL: pyimc-0.1.0.tar.gz
  • Upload date:
  • Size: 33.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.8.10

File hashes

Hashes for pyimc-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8f82a6e2cdb092a2ef09d12304088b4b6af677e9f79ae60e03127abd52c7d797
MD5 9fd48752588da1d7b1c743c82ff9b95b
BLAKE2b-256 52fd1b097e49afbe790bc512b9a3e6718ee49327796d91a7df9aaad92aaab9bd

See more details on using hashes here.

File details

Details for the file pyimc-0.1.0-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyimc-0.1.0-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3c73a4a594da61d309f14233576b81faf71534eaa8a07db9f031ed78d7b19ca7
MD5 a6a1dc57722f88ed0bee892287f4efaf
BLAKE2b-256 f86cfff12c404b2bf455523183790312fc56844b37b8f31d8d17c0bced912845

See more details on using hashes here.

File details

Details for the file pyimc-0.1.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyimc-0.1.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0866b764c623f7b170390bca67b8e2098bf07e63a8bc50ebb4a90e7f68fd16dc
MD5 9fa1480c150966d1f1ced0df016016f8
BLAKE2b-256 472445f61c3cd04413d7d5c0a9a1f616345bdf0f6bfb1bc3c331347fffcca7f1

See more details on using hashes here.

File details

Details for the file pyimc-0.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

  • Download URL: pyimc-0.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: CPython 3.9, manylinux: glibc 2.5+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.8.10

File hashes

Hashes for pyimc-0.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 61d4d2cca1e3226ed6dd0da1b0db668e2461c0897910eec5250db049688b5688
MD5 53bb07680a986426e6a9b69035e760ca
BLAKE2b-256 e169b9efa91ad9da742b3455bbace43eff60d5e6d9a69bdd32a2caaef55d4454

See more details on using hashes here.

File details

Details for the file pyimc-0.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

  • Download URL: pyimc-0.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: CPython 3.8, manylinux: glibc 2.5+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.8.10

File hashes

Hashes for pyimc-0.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 92c8fe18a17a8b2a67b74bb4f7012523997f5c7150f28ac8bcdbf3da866d2820
MD5 c88029dd244f69b540842949358f6572
BLAKE2b-256 4b83ec9e03d62aaf80b85b1b2f403d5976bc0dc46366bb9aa4706b4723021bf5

See more details on using hashes here.

File details

Details for the file pyimc-0.1.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyimc-0.1.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d7a7ddf4b8760f38e2708ef57262178bd56e16a882cc231abf01c03b560730db
MD5 eb889b27e5a32118ad684c411e7b9984
BLAKE2b-256 9827c02912828ba5483c39fa8958f33c2df386342c3b74cfa02286fbe347ef4a

See more details on using hashes here.

File details

Details for the file pyimc-0.1.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyimc-0.1.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ccec4dbb4d642da43905ed12b713a03790f22124dea2d189aae3fb79daf2a2fb
MD5 d249fea998f862ab0a7229dc5e842044
BLAKE2b-256 6326f4c2d8f604185a4fda3d368e79bc073f2ae6268a79afa202f0d37029cc4e

See more details on using hashes here.

Supported by

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