-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
47adc5d
commit cb09d88
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# dcimg | ||
|
||
This module provides the `DCIMGFile` class for accessing Hamamatsu DCIMG | ||
files. | ||
|
||
## Installation | ||
```bash | ||
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: | ||
|
||
```python | ||
>>> 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: | ||
|
||
```python | ||
>>> 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: | ||
```python | ||
with DCIMGFile('input_file.dcimg') as f: | ||
a = f[800, ...] | ||
``` |