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)

Access XML

xml = data.xml()

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.1.tar.gz (38.1 kB view details)

Uploaded Source

Built Distributions

pyimc-0.1.1-pp37-pypy37_pp73-manylinux_2_24_x86_64.whl (2.1 MB view details)

Uploaded PyPy manylinux: glibc 2.24+ x86-64

pyimc-0.1.1-cp311-cp311-manylinux_2_24_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.24+ x86-64

pyimc-0.1.1-cp310-cp310-manylinux_2_24_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.24+ x86-64

pyimc-0.1.1-cp39-cp39-manylinux_2_28_x86_64.whl (15.4 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.28+ x86-64

pyimc-0.1.1-cp39-cp39-manylinux_2_24_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.24+ x86-64

pyimc-0.1.1-cp38-cp38-manylinux_2_28_x86_64.whl (15.4 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.28+ x86-64

pyimc-0.1.1-cp38-cp38-manylinux_2_24_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.24+ x86-64

pyimc-0.1.1-cp37-cp37m-manylinux_2_24_x86_64.whl (2.1 MB view details)

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

File details

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

File metadata

  • Download URL: pyimc-0.1.1.tar.gz
  • Upload date:
  • Size: 38.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.7

File hashes

Hashes for pyimc-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e8762d917eb35f4ad95ab739cda2afd2edeca9bcccb09d6451f25b6565a31baf
MD5 2b3bbf4ea958b995458ade19d4f9dc55
BLAKE2b-256 d0b76e92efc869309a220011b2250209baa759d457e5cd1f553847fba879e9c5

See more details on using hashes here.

File details

Details for the file pyimc-0.1.1-pp37-pypy37_pp73-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for pyimc-0.1.1-pp37-pypy37_pp73-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 5368b55926413aaf1023bdaf32ee1c0e7c87c07876f234aabe0794641d2953fa
MD5 518c7eac4349702f432c8baeaa4cb873
BLAKE2b-256 79b4893274fe6515d681c44799d8810c803ef0759d355f1077b06ea24dd7a828

See more details on using hashes here.

File details

Details for the file pyimc-0.1.1-cp311-cp311-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for pyimc-0.1.1-cp311-cp311-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 fd00c838955df2ab988ed94a2c5228d0e3b45a0538f3802fba63fee432cdd004
MD5 6353e064141853339a543904ebc0d94d
BLAKE2b-256 e608715948609326ce4254edfd832ad0b2198b799a1efab9ca262c3a38cf51a3

See more details on using hashes here.

File details

Details for the file pyimc-0.1.1-cp310-cp310-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for pyimc-0.1.1-cp310-cp310-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 3bad93642b23cc7d0c5ab9a6cf1b3daed4d50f95b78bcff2bfdce390a53e7452
MD5 d7815af749599688266a4a08714b1e02
BLAKE2b-256 9dbb30e364677f615091befd4f830c46df036eb09289bd979aa59856d50a8664

See more details on using hashes here.

File details

Details for the file pyimc-0.1.1-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyimc-0.1.1-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 96cc32f349e24cae7c961fa4815980c127856ad7fc65807f0ab258609a9f236f
MD5 1e5c8b82358114a1ced3d2965959ca0e
BLAKE2b-256 935a4b93279b88be54725cd0986d3581e73c04e4907192cfb582cc41eaf80b70

See more details on using hashes here.

File details

Details for the file pyimc-0.1.1-cp39-cp39-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for pyimc-0.1.1-cp39-cp39-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 c563475f4b8133db1711761ee8f1125ecf3d5fd84b0057ff57bf2f6e6cafd662
MD5 032ae60046bfa932182437b1b7863168
BLAKE2b-256 60d443de9b2ad137eacc36f9031a842d12bae37c84a75dc7e04c9d6f687fa5d5

See more details on using hashes here.

File details

Details for the file pyimc-0.1.1-cp38-cp38-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyimc-0.1.1-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a501401d890fa69573e3f39387aa63bcc375a06aff151b888f2f8c2337071c23
MD5 88dac2f94f5a6260a097f4fe2864e4aa
BLAKE2b-256 ab55e7313509841591024c6e253d650eed937212342b3e360ef8aeb20f1d8afb

See more details on using hashes here.

File details

Details for the file pyimc-0.1.1-cp38-cp38-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for pyimc-0.1.1-cp38-cp38-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 adb3c6138691bf680c85abed2c09c58764a7eccdcbdd1ce7d7ca2a73c1b34700
MD5 ed56dec77070e2bd7ef15c4591ce7702
BLAKE2b-256 86e1933d686e2ef33c8cc1f1a4f16ff8efb8394b08b15a5527c1bc905c876188

See more details on using hashes here.

File details

Details for the file pyimc-0.1.1-cp37-cp37m-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for pyimc-0.1.1-cp37-cp37m-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 c242189d2b72d4f54eaf71100e8ceda3e2826d33f384fdd96b0a7bde6c9102cb
MD5 40e1c2731589a793ca1a0e3b4cb5f47e
BLAKE2b-256 c07102a2cb6780a79bf09b464a811776a6dae383de3e5516e459cd257f45414a

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