Title: | A single-channel UINT8 TIFF toolkit |
---|---|
Description: | The {ti} package provides a set of tools for working with single-channel unsigned 8-bit integer TIFF images. |
Authors: | Bart Rogiers [cre, aut] (<https://orcid.org/0000-0002-8836-0988>, <https://rogiersbart.github.io>), SCK CEN [cph, fnd] |
Maintainer: | Bart Rogiers <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.0.9000 |
Built: | 2024-11-23 05:18:29 UTC |
Source: | https://github.com/rogiersbart/ti |
Convert a brick of bytes to a TIFF image
ff_bob2tif(path, dims, out = fs::path_ext_set(path, "tif"))
ff_bob2tif(path, dims, out = fs::path_ext_set(path, "tif"))
path |
Input image path. |
dims |
Dimension vector for the TIF image dimensions. |
out |
Output image path. Defaults to the input image path, with .tif extension. |
The image array, invisibly.
Compress a TIFF image
ff_compress(path, type = "deflate", out = path)
ff_compress(path, type = "deflate", out = path)
path |
Input image path. |
type |
Type of compression to apply ( |
out |
Output image path. Defaults to the input image path. |
The output image, invisibly.
Convert a CSV file to a TIFF image
ff_csv2tif(path, dims, out = fs::path_ext_set(path, "tif"))
ff_csv2tif(path, dims, out = fs::path_ext_set(path, "tif"))
path |
Input image path. |
dims |
Dimension vector for the TIF image dimensions. |
out |
Output image path. Defaults to the input image path, with .tif extension. |
The image array, invisibly.
Extract specific frames from a multi-frame TIFF
ff_extract(path, frames, out = fs::path_ext_set(path, "%frame.tif"))
ff_extract(path, frames, out = fs::path_ext_set(path, "%frame.tif"))
path |
Path of the multi-frame TIFF. |
frames |
Frame numbers to extract. |
out |
Path for the output single-frame images, using "%frame" as placeholder for the frame number. Defaults to the input file path with extension ".001.tif" etc. |
Invert a TIFF image
ff_invert(path, out = path)
ff_invert(path, out = path)
path |
Input image path. |
out |
Output image path. Defaults to the input image path. |
The output image, invisibly.
Merge single-frame images into a multi-frame TIFF
ff_merge(paths, out)
ff_merge(paths, out)
paths |
Paths to the single-frame images to be merged. |
out |
Path to the output multi-frame TIFF. |
Convert a NumPy array to a TIFF image
ff_npy2tif(path, out = fs::path_ext_set(path, "tif"))
ff_npy2tif(path, out = fs::path_ext_set(path, "tif"))
path |
Input image path. |
out |
Output image path. Defaults to the input image path, with .tif extension. |
The image array, invisibly.
Convert a PNG image to a TIFF image
ff_png2tif(path, out = fs::path_ext_set(path, "tif"))
ff_png2tif(path, out = fs::path_ext_set(path, "tif"))
path |
Input image path. |
out |
Output image path. Defaults to the input image path, with .tif extension. |
The image array, invisibly.
Read a TIFF image
ff_read(path)
ff_read(path)
path |
Image path. |
Split a multi-frame TIFF into single-frame images
ff_split(path, out = fs::path_ext_set(path, "%frame.tif"))
ff_split(path, out = fs::path_ext_set(path, "%frame.tif"))
path |
Path of the multi-frame TIFF. |
out |
Path for the output single-frame images, using "%frame" as placeholder for the frame number. Defaults to the input file path with extension ".001.tif" etc. |
Stretch the contrast of a TIFF image
ff_stretch(path, out = path)
ff_stretch(path, out = path)
path |
Input image path. |
out |
Output image path. Defaults to the input image path. |
The output image, invisibly.
Convert a TIFF image to a brick of bytes
ff_tif2bob(path, out = fs::path_ext_set(path, "bob"))
ff_tif2bob(path, out = fs::path_ext_set(path, "bob"))
path |
Input image path. |
out |
Output image path. Defaults to the input image path, with .tif extension. |
The image array, invisibly.
Convert a TIFF image to a CSV file
ff_tif2csv(path, out = fs::path_ext_set(path, "csv"))
ff_tif2csv(path, out = fs::path_ext_set(path, "csv"))
path |
Input image path. |
out |
Output image path. Defaults to the input image path, with .tif extension. |
The image array, invisibly.
Convert a TIFF image to a NumPy array
ff_tif2npy(path, out = fs::path_ext_set(path, "npy"))
ff_tif2npy(path, out = fs::path_ext_set(path, "npy"))
path |
Input image path. |
out |
Output image path. Defaults to the input image path, with .tif extension. |
The image array, invisibly.
Convert a TIFF image to a PNG image
ff_tif2png(path, out = fs::path_ext_set(path, "png"))
ff_tif2png(path, out = fs::path_ext_set(path, "png"))
path |
Input image path. |
out |
Output image path. Defaults to the input image path, with .tif extension. |
The image array, invisibly.
Transpose a TIFF image
ff_transpose(path, dims, out = path)
ff_transpose(path, dims, out = path)
path |
Input image path. |
dims |
The dimension permutation vector. |
out |
Output image path. Defaults to the input image path. |
The output image, invisibly.
Write a TIFF image
ff_write(img, path, compression = "deflate")
ff_write(img, path, compression = "deflate")
img |
2D or 3D array. |
path |
Path to write to. |
compression |
Type of compression to apply ( |