Skip to main content

Light Mastodon project file reader for Python

Project description

Light Mastodon Reader for Python

This is a lighter version of Mastodon Reader for Python from Chrisoph Sommer.

Import the spots and links tables, features, tags and meta data from a Mastodon project file.

Ported to Python from: matlab-mastodon-importer

This reader is lighter mainly because it does not depend on pandas nor on networkx and it therefore only depends on numpy.

Example

Read the mastodon file:

from micromastodonreader import MicroMastodonReader

mr = MicroMastodonReader("demo/demo.mastodon")

# show meta data
meta_data = mr.read_metadata()

# read spot and link tables with features and tags columns
spots, links, tag_definition, features = mr.read(tags=True, features=True)

spots is a numpy.ndarray where:

  • spots[int_id] is the cell with id int_id
  • spots[int_id, 0] is the x coordinate of the cell int_id
  • spots[int_id, 1] is the y coordinate of the cell int_id
  • spots[int_id, 2] is the z coordinate of the cell int_id
  • spots[int_id, 3] is the time of the cell int_id
  • spots[int_id, 3:10] are the values of the elongation matrix representing the cell int_id sphere
  • spots[int_id, 10] is the bsrs (??) of int_id

links is a numpy.ndarray where:

  • links[int_pos] is an edge
  • links[int_pos, 2] is the id of the edge
  • links[int_pos, 0] is the id of the cell at time t
  • links[int_pos, 1] is the id of the cell at time t + 1

tag_definition and features are a bit more complicated 🫠

You can also read information separately

# read only spot and link tables
spots, links = mr.read_tables()

# read tag_definition
tag_definition = mr.read_tags()

# read features
mr.read_features()

Installation

Current version

pip install git+git://github.com/GuignardLab/python-mastodon-importer-light

pip

pip install micro-mastodon-reader

more information on PyPi

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

micro_mastodon_reader-1.1.0.tar.gz (377.6 kB view details)

Uploaded Source

Built Distribution

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

micro_mastodon_reader-1.1.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file micro_mastodon_reader-1.1.0.tar.gz.

File metadata

  • Download URL: micro_mastodon_reader-1.1.0.tar.gz
  • Upload date:
  • Size: 377.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for micro_mastodon_reader-1.1.0.tar.gz
Algorithm Hash digest
SHA256 81a7c690541276f5792b9d3c8a54857d1ee54f3d73e2a22a85c4dc2773dbc6f2
MD5 ace456912d4aa9e164bb8e34ca3a59be
BLAKE2b-256 d161d8888547a994caa8270a66805b13804a8d675b7074e2732d01776e29c47c

See more details on using hashes here.

File details

Details for the file micro_mastodon_reader-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for micro_mastodon_reader-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8565a1fc103169c14637d8f85052aaa0ec67e03666e5638ec206080e00877de6
MD5 1a93d058af8e693ba8a66533bad85cf2
BLAKE2b-256 9da1b8881bf6491fafa316b27c458c20f8c72228f4bff42857a5808b0cb9def5

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