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.4.tar.gz
(5.5 kB
view details)
File details
Details for the file tifffolder-0.0.4.tar.gz
.
File metadata
- Download URL: tifffolder-0.0.4.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb2b3ac574fc6c4c56a30e4d32a726221d8614da32878530bc7f48306f82b80d |
|
MD5 | 85be6564bf3cfce1b791b6bdbcd0f43a |
|
BLAKE2b-256 | 06d1874ee6f47921a78da120fa393faa6e82b0a561682df53e929b259ec12353 |