https://github.com/wimpomp/ndbioimage

Bio image reading, metadata and some affine registration.

https://github.com/wimpomp/ndbioimage

Science Score: 39.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.1%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Bio image reading, metadata and some affine registration.

Basic Info
  • Host: GitHub
  • Owner: wimpomp
  • License: gpl-3.0
  • Language: Python
  • Default Branch: main
  • Size: 35 MB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • Open Issues: 0
  • Releases: 0
Created almost 4 years ago · Last pushed 11 months ago
Metadata Files
Readme License

README.md

Pytest

ndbioimage

Exposes (bio) images as a numpy ndarray-like object, but without loading the whole image into memory, reading from the file only when needed. Some metadata is read and stored in an ome structure. Additionally, it can automatically calculate an affine transform that corrects for chromatic aberrations etc. and apply it on the fly to the image.

Currently, it supports imagej tif files, czi files, micromanager tif sequences and anything bioformats can handle.

Installation

One of:

pip install ndbioimage pip install ndbioimage[bioformats] pip install ndbioimage[write] pip install ndbioimage[bioformats, write]

  • bioformats: use bio-formats as fallback when other readers cannot open a file.
  • write: write an image file into a mp4 or mkv file. Work in progress! Make sure ffmpeg is installed.

Usage

Python

  • Reading an image file and plotting the frame at channel=2, time=1

import matplotlib.pyplot as plt from ndbioimage import Imread with Imread('image_file.tif', axes='ctyx', dtype=int) as im: plt.imshow(im[2, 1])

  • Showing some image metadata

from ndbioimage import Imread from pprint import pprint with Imread('image_file.tif') as im: pprint(im)

  • Slicing the image without loading the image into memory

from ndbioimage import Imread with Imread('image_file.tif', axes='cztyx') as im: sliced_im = im[1, :, :, 100:200, 100:200]

sliced_im is an instance of Imread which will load any image data from file only when needed

  • Converting (part) of the image to a numpy ndarray

from ndbioimage import Imread import numpy as np with Imread('image_file.tif', axes='cztyx') as im: array = np.asarray(im[0, 0])

Command line

ndbioimage --help: show help
ndbioimage image: show metadata about image
ndbioimage image -w {name}.tif -r: copy image into image.tif (replacing {name} with image), while registering channels
ndbioimage image -w image.mp4 -C cyan lime red copy image into image.mp4 (z will be max projected), make channel colors cyan lime and red

Adding more formats

Readers for image formats subclass AbstractReader. When an image reader is imported, Imread will automatically recognize it and use it to open the appropriate file format. Image readers are required to implement the following methods:

  • staticmethod canopen(path): return True if path can be opened by this reader
  • __frame__(self, c, z, t): return the frame at channel=c, z-slice=z, time=t from the file

Optional methods: - get_ome: reads metadata from file and adds them to an OME object imported from the ome-types library - open(self): maybe open some file handle - close(self): close any file handles

Optional fields: - priority (int): Imread will try readers with a lower number first, default: 99 - donotpickle (strings): any attributes that should not be included when the object is pickled, for example: any file handles

TODO

  • more image formats

Owner

  • Login: wimpomp
  • Kind: user

GitHub Events

Total
  • Push event: 26
  • Fork event: 1
  • Create event: 1
Last Year
  • Push event: 26
  • Fork event: 1
  • Create event: 1

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 59
  • Total Committers: 2
  • Avg Commits per committer: 29.5
  • Development Distribution Score (DDS): 0.017
Past Year
  • Commits: 14
  • Committers: 1
  • Avg Commits per committer: 14.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Wim Pomp w****p@n****l 58
wimpomp 5****p 1
Committer Domains (Top 20 + Academic)
nki.nl: 1

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 359 last-month
    • cargo 4,749 total
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 1
    (may contain duplicates)
  • Total versions: 64
  • Total maintainers: 2
pypi.org: ndbioimage

Bio image reading, metadata and some affine registration.

  • Versions: 54
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 359 Last month
Rankings
Dependent packages count: 10.1%
Downloads: 11.2%
Dependent repos count: 21.6%
Average: 22.3%
Forks count: 29.8%
Stargazers count: 38.8%
Maintainers (1)
Last synced: 11 months ago
crates.io: ndbioimage

Read bio image formats using the bio-formats java package.

  • Versions: 10
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 4,749 Total
Rankings
Dependent repos count: 23.3%
Dependent packages count: 31.0%
Average: 49.9%
Downloads: 95.3%
Maintainers (1)
Last synced: 11 months ago

Dependencies

.github/workflows/pytest.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
pyproject.toml pypi
  • JPype1 *
  • SimpleITK-SimpleElastix *
  • czifile 2019.7.2
  • imagecodecs *
  • lxml *
  • numpy *
  • ome-types ^0.4.0
  • pandas *
  • parfor >=2023.10.1
  • pint *
  • pytest *
  • python ^3.8
  • pyyaml *
  • scikit-image *
  • tifffile *
  • tiffwrite *
  • tqdm *