extr_OriginalStack: Convert original TIFF image stack used to gather spot and...

View source: R/Plot_Image.R

extr_OriginalR Documentation

Convert original TIFF image stack used to gather spot and cell outline data.

Description

extr_OriginalStack() converts the original TIFF stack used to gather spot and cell outline data to a data frame containing the pixel x,y coordinates and the pixel value.

extr_OriginalCells() is connecting cell outlines to pixel values, using the output of extr_OriginalStack() and a mesh dataframe.

Usage

extr_OriginalStack(picloc)

extr_OriginalCells(imdatframe, mesh, surroundings=FALSE, turnCell=TRUE)

Arguments

extr_OriginalStack:

picloc

file path of the .TIFF image stack.

extr_OriginalCells:

imdatframe

output dataframe of extr_OriginalStack()

mesh

dataframe containing (at least) mesh coordinates, cell numbers and frame numbers.

surroundings

when TRUE, the function takes a box around the cells, when FALSE, only the pixels inside the cells are taken.

turnCell

when TRUE, the cells all turned in the same orientation. when FALSE, this is not the case.

Details

extr_OriginalStack needs the package "raster" to function.

extr_OriginalCells needs "SMDTools" and "raster" to function

Value

The output of extr_OriginalStack is a list of dataframes including the x coordinates, y coordinates and intensity values of each pixel.

The output of extr_OriginalCells is a list of dataframes including:

rawdata_turned

a dataframe including the cell information and pixel coordinates per cell, all turned in the same direction.

mesh

mesh data turned in the same direction

Note

1. extr_OriginalCells is a heavy function since it's turning all pixels of each cell!

2. extr_OriginalStack works for single TIFFs and stacks, not hyperstacks. It only works with greyscale stacks.

Author(s)

Renske van Raaphorst

Examples

## Not run: 
#get tif
TIFFfilepath <- file.choose()

TIFFstack <- extr_OriginalStack(TIFFfilepath)

#plot stack
bactMAP::plotRaw(TIFFstack, frameN=1)

#get cell meshes
Meshpath <- file.choose()
meshes <- extr_Oufti(Meshpath)

#combine cells & tiff
extr_OriginalCells(TIFFstack, meshes$mesh)


## End(Not run)

vrrenske/shinyspots documentation built on Oct. 28, 2023, 12:26 p.m.