get_stage_xy_from_file: Get stage XY coordinates from tiff file's description tag

View source: R/read_tiff_tags.R

get_stage_xy_from_fileR Documentation

Get stage XY coordinates from tiff file's description tag

Description

The description is in the tiff file's metadata, tipically written by Metamorph.

Usage

get_stage_xy_from_file(tiff.path, frames = 1)

Arguments

tiff.path

A path to the tiff file, passed to read_tags.

frames

The frame number to process, passed to read_tags.

Value

A named vector, with "x" and "y" coordinates.

Examples


# Get the "images" data.frame from CellID
cell.data <- get_cell_data("path/to/output/")
images <- cell.data$images

# Generate a list with file paths split and named by "pos"
tags.list <- images %>% filter(t.frame==0, channel=="BF") %>% 
  {split(.$file, .$pos)}
  
# Otherwise, a simple list of file paths ordered by "pos" suffice.
# tags.list <- list(file.paths)  # NOT RUN

# Get stage positions
tags.stage <- tags.list %>% 
  lapply(get_stage_xy_from_file) %>% bind_rows(.id="pos") %>% 
  mutate(pos = as.integer(pos))

tags.stage


darksideoftheshmoo/rcell2 documentation built on Oct. 23, 2024, 12:59 p.m.