Skip to content

lens-biophotonics/dcimg

This branch is 1 commit ahead of, 3 commits behind master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

138efca · Oct 21, 2021
Jan 13, 2021
Dec 12, 2020
Aug 24, 2021
Dec 12, 2020
Jun 11, 2018
May 25, 2018
Dec 12, 2020
Dec 12, 2020
Aug 24, 2021
Dec 12, 2020
Oct 21, 2021
Oct 4, 2017
Dec 12, 2020
Feb 23, 2017
Dec 12, 2020

Repository files navigation

dcimg

This module provides the DCIMGFile class for accessing Hamamatsu DCIMG files.

Installation

pip install dcimg

Documentation

The DCIMGFile class provides an interface for reading 3D Hamamatsu DCIMG files.

Usage is pretty straightforward. First of all, create a DCIMGFile object:

>>> my_file = DCIMGFile('input_file.dcimg')
>>> my_file
    <DCIMGFile shape=2450x2048x2048 dtype=<class 'numpy.uint16'> file_name=input_file.dcimg>

Image data can then be accessed using NumPy's basic indexing:

>>> my_file[-10, :5, :5]
array([[101, 104, 100,  99,  89],
       [103, 102, 103,  99, 102],
       [101, 104,  99, 108,  98],
       [102, 111,  99, 111,  95],
       [103,  98,  99, 104, 106]], dtype=uint16)

Other convenience methods for accessing image data are: zslice, zslice_idx, frame and whole.

DCIMGFile supports context managers:

with DCIMGFile('input_file.dcimg') as f:
     a = f[800, ...]

For further details refer to: https://lens-biophotonics.github.io/dcimg/