Parse filenames & slice a folder of images like a numpy array
Project description
tifffolder
Read a subset of data from a folder of images like a numpy array
Example:
>>> from tifffolder import TiffFolder
>>> tf = TiffFolder('/folder/of/files', tpattern='_stack{:04d}_', cpattern='_ch{}_')
# extract data with numpy slicing with axes [t,c,z,y,x]
# for instance get timepoints 1-100, stepping by 10,
# in the first channel, last 10 z planes, cropping somewhere in the middle of y
>>> data = tf[0:100:10, 0, -10:, 200:400, :]
>>> data.shape
(10, 1, 10, 200, 512) # (nt, nc, nz, ny, nx)
Can also be used as an iterator/generator for lazily reading data
>>> for timepoint in tf:
>>> do_something(timepoint)
# or just load the whole thing
>>> alldata = tf[:]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tifffolder-0.0.2.tar.gz
(5.5 kB
view details)
File details
Details for the file tifffolder-0.0.2.tar.gz
.
File metadata
- Download URL: tifffolder-0.0.2.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89cbc2379614be97d9ed322b3d70d2855c6eac4fb25dc169035d3f8b693f22e8 |
|
MD5 | 364c22a2b4e82f0f335d8fce188fb85d |
|
BLAKE2b-256 | 99bcf4db2b1c6f1903c5e8896816c2169cc21bb9358bfe4d88d88cef7f0a46c9 |