Skip to main content

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


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.3.tar.gz (5.5 kB view details)

Uploaded Source

File details

Details for the file tifffolder-0.0.3.tar.gz.

File metadata

  • Download URL: tifffolder-0.0.3.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for tifffolder-0.0.3.tar.gz
Algorithm Hash digest
SHA256 09a7bec71f111a1ccf541c7bf6fc01b21fb397ecb257fbb3b2aad357bbd2d5ca
MD5 7864a2bc574813b942945c5d664deff1
BLAKE2b-256 8998aba026feccf96715ab0f977e445c49946769fd6366e0a4200bd1a27e2ecc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page