Skip to contents

Utility function to generate a tibble with image transformations

Usage

generate_rigid_transform(
  sampleID = 1,
  mirror_x = FALSE,
  mirror_y = FALSE,
  angle = 0,
  tr_x = 0,
  tr_y = 0,
  scalefactor = 1
)

Arguments

sampleID

An integer specifying a sample ID

mirror_x, mirror_y

Logical specifying if the image and spots should be mirrored along the x- and/or y-axis

angle

Numeric value specifying the degree of rotation. Use negative angles for counter-clockwise rotation. The value needs to be in the range (-360, 360)

tr_x, tr_y

Integer values for translations along the x- and y-axis

scalefactor

A numeric value specifying a scaling factor between (0, 3)

Value

A tbl with image transformations

Examples


# Flip along x axis and rotate 45 degrees
generate_rigid_transform(sampleID = 1, mirror_x = TRUE, angle = 45)
#> # A tibble: 1 × 7
#>   sampleID mirror_x mirror_y angle  tr_x  tr_y scalefactor
#>      <dbl> <lgl>    <lgl>    <dbl> <dbl> <dbl>       <dbl>
#> 1        1 TRUE     FALSE       45     0     0           1

# Move image 100 pixels along x and y axes
generate_rigid_transform(sampleID = 1, tr_x = 100, tr_y = 100)
#> # A tibble: 1 × 7
#>   sampleID mirror_x mirror_y angle  tr_x  tr_y scalefactor
#>      <dbl> <lgl>    <lgl>    <dbl> <dbl> <dbl>       <dbl>
#> 1        1 FALSE    FALSE        0   100   100           1