translation: Translation of the data

Description Usage Arguments Value Examples

View source: R/translation.R

Description

Sometimes, a slight shift exists between two images of the same sample. This function allows them to be superimposed. The shift can be determined with a vector by entering its coordinates; or interactively by clicking on a specific point on a first image, and its corresponding point on the second image)

Usage

1
translation(dtt,dtc=NULL,x,y,interact="none",dtt.lim=NULL,dtc.lim=NULL,n.around=c(5,5))

Arguments

dtt

image matrix (for 512*512 image, the dimensions of this matrix are 512*512) to translate

dtc

potential image matrix (for 512*512 image, the dimensions of this matrix are 512*512) on which the dtt is superimposed

x

If interactive is FALSE, abscisse of vector of translation

y

If interactive is FALSE, ordinate of vector of translation

interact

if TRUE, dtt is displayed as an image, and the user has to select one point on it. Then, dtc is displayed as an image and the user has to select the related same point on it.

dtt.lim

limits of the scale of dtt (to change when the image is not contrasted enough to detect specific points)

dtc.lim

limits of the scale of dtc (to change when the image is not contrasted enough to detect specific points)

n.around

Tests every translation in a neighborhood of n.around[1] in x and n.around[2] of y (clicked by the user), and select the translation that maximizes the number of not TRUE common to dtc and dtt. It requires that both dtc and dtt are boolean matrices.

Value

The function returns a list containing the translated data ("data") and the vector of translation ("translation")

Examples

1
2
3
4
data(gp)
data(count)
GP37Anew=translation(dtt=gp,dtc=count,interact=TRUE,dtt.lim=c(-0.4,0.8),dtc.lim=c(1000,4000))
GP37Anew=translation(gp,x=7,y=-3)$data

multifluo documentation built on May 2, 2019, 1:07 p.m.