R/lm_pipeline.R
tif_to_nrrd_channels.RdVNC analogue of lsm_to_nrrd for sources
that have already been registered into a Janelia template space and
arrive as plain ImageJ hyperstack TIFFs (no LSM metadata). The
caller passes the voxdims they know from the target template —
the ImageJ TIFF resolution tags are typically uncalibrated for these
"registered" exports and would otherwise read as 1 px / unit.
Pure R: uses tiff::readTIFF to read every page of the
hyperstack, infers the channel/slice axis order from the
ImageDescription tag (channels=, slices=), and
writes per-channel im3d NRRDs via nat::write.nrrd.
tif_to_nrrd_channels(
input,
output_dir,
voxdims,
prefix = NULL,
channels = c(0L, 1L),
labels = NULL,
verbose = TRUE
)path to a 2-channel ImageJ-format TIFF.
directory for output NRRDs (created if missing).
length-3 numeric c(x, y, z) voxel size in
microns (e.g. c(0.4, 0.4, 0.4) for a JRCVNC2018F-aligned
source).
optional output stem (default = input file basename).
integer indices of the channels to extract
(zero-based, matching the TIFF order). Default c(0L, 1L).
per-channel labels used in the output filenames
(<stem>_<label>.nrrd). Defaults to ch0, ch1, ...
logical; emit a one-line shape summary.
a named character vector of absolute NRRD paths, one per requested channel.