Giter Club home page Giter Club logo

imagine's Introduction

imagine

packageversion CRAN_Status_Badge CRAN_time_from_release metacran downloads minimal R version

[IMAG]ing eng[INE]s, Tools for Application of Image Filters to Data Matrices

Provides fast application of image filters to data matrices by using C++ algorithms called 'engines'. More details are shown in vignette.

Installation

Get the development version from github:

# install.packages("devtools")
devtools::install_github("LuisLauM/imagine")

Or install the CRAN version

install.packages("imagine")

Input data

For all functions, the main input data must be a numeric matrix object. Depending on each funtion, user must indicate some extra arguments for the filter.

Examples

Next, we show the utility of quantileFilter, one of the six functions that imagine performs.

# Load imagine
library(imagine)

# Build an example matrix
n <- 1e3
origMatrix <- matrix(seq(n^2), nrow = n)

# Add some NAs
origMatrix_withNA <- origMatrix
origMatrix_withNA[sample(seq(n^2), 0.7*n^2, replace = FALSE)] <- NA

# Apply filter
newMatrix <- quantileFilter(X = origMatrix_withNA, radius = 3, x = 0.1, times = 1)

# Plot matrices for compare
cols <- colorRampPalette(c("green3", "red4"))(n)

par(mar = c(0, 2, 0, 0), mfrow = c(3, 1))

image(origMatrix, col = cols, axes = FALSE)
mtext(text = "Original", side = 2, line = 0.5, font = 2)

image(origMatrix_withNA, col = cols, axes = FALSE)
mtext(text = "Original with NAs", side = 2, line = 0.5, font = 2)

image(newMatrix, col = cols, axes = FALSE)
mtext(text = "Filtered", side = 2, line = 0.5, font = 2)

imagine's People

Contributors

luislaum avatar roliveros-ramos avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.