ijtiff (version 2.0.2)

text-image-io: Read/write an image array to/from disk as text file(s).

Description

Write images (arrays) as tab-separated .txt files on disk. Each channel-frame pair gets its own file.

Usage

write_txt_img(img, path, rds = FALSE, msg = TRUE)

read_txt_img(path, msg = TRUE)

Arguments

img

An image, represented by a 4-dimensional array, like an ijtiff_img.

path

The name of the input/output output file(s), without a file extension.

rds

In addition to writing a text file, save the image as an RDS (a single R object) file?

msg

Print an informative message about the image being read?

Examples

Run this code
# NOT RUN {
img <- read_tif(system.file("img", "Rlogo.tif", package = "ijtiff"))
tmptxt <- tempfile(pattern = "img", fileext = ".txt")
write_txt_img(img, tmptxt)
tmptxt_ch1_path <- paste0(filesstrings::before_last_dot(tmptxt), "_ch1.txt")
print(tmptxt_ch1_path)
txt_img <- read_txt_img(tmptxt_ch1_path)
# }

Run the code above in your browser using DataCamp Workspace