ISS_roi: Select grid/region of interest (ROI) from a tissue.

Description Usage Arguments Details Examples

View source: R/2.1_ISS_roi.R

Description

Select grid of interest from a tissue

Usage

1
2
3
ISS_roi(data, gridtype = "rect", nx = 6, ny = nx, grid_id = NULL,
  roifile = NULL, roi.id = NULL, roi.x = NULL, roi.y = NULL,
  main = "ROI on tissue")

Arguments

data

Input data in class MolDiaISS. Output of readISS.

gridtype

type of grid to plot. Default is "rect". See details.

nx, ny

Numbers of rectangular quadrats in the x and y directions

grid_id

Grid to select. Default id NULL.

roifile

Name of the file that contain ROI. csv formate. Most important is, data points should be in clockwise or anti-clockwise order.

roi.id

Column name in roifile file that contain ROI id

roi.x, roi.y

X and Y axis name in roifile file.

main

Main title.

Details

gridtype parameter can have 4 values : "hexa", "rect", "roifile" and "roi"

1. "hexa" will create hexagonal grid and number of grid is based on nx parameter and grid_id will select grid of interest.

2. "rect" will create rectangular grid and number of grid is based on nx parameter and grid_id will select grid of interest.

3. "roifile" will require a file input in csv formate in the parameter "roifile". The input file must have at least 3 column of ROI id, x-axis, y-axis. The parameter "roi.id", "roi.x" and "roi.y" will be the name input of corresponding column.

4. "roi" will select ROI more interactively. One cal select ROI on the image by pointer.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# Read ISS data
ex_data <- readISS(file = system.file("extdata", "Hypocampus_left.csv", package="MolDia"),cellid = "CellId", centX = "centroid_x", centY = "centroid_y", rpc = 3)

# Select hexagonal and rectangular ROI
mygrid  <- ISS_roi(data = ex_data, nx = 8,gridtype = "hexa", main = "Hexagonal ROI on tissue")
mygrid  <- ISS_roi(data = ex_data, nx = 8,gridtype = "rect", main = "Rectangular ROI on tissue")
mygrid  <- ISS_roi(data = ex_data, nx = 8,gridtype = "rect", grid_id = c(6,16,20,8,17,21))

# Selected ROI from a pre selected ROI file
ex_data <- readISS(file = system.file("extdata", "CellBlobs_ROI.csv", package="MolDia"),
                   cellid = "CellID", centX = "centroidX", centY = "centroidY")
mygrid  <- ISS_roi(data = ex_data, nx = 6, gridtype = "roifile",
                            roifile = system.file("extdata", "polygon_coordinates.csv", package="MolDia"),
                            roi.id = "Polygon_id", roi.x ="x_coordiates" , roi.y = "y_coordinates", grid_id = c(1,2,5,6),
                            main = "Selected ROI on tissue")
# Select ROI interactively by user
mygrid  <- ISS_roi(data = ex_data, gridtype = "roi")

mashranga/MolDia documentation built on May 26, 2019, 9:36 a.m.