fastGLCM


Fast GLCM feature texture computation. This R package includes two GLCM implementations:

  • An Rcpp Armadillo implementation which is parallelized and modified to return all GLCM features at once. Preferably use this version but be aware that there is a difference when computing the convolution between the OpenCV (python fastGLCM implementation) and the Armadillo library (Rcpp implementation). OpenCV performs interpolation in the image boundaries whereas Armadillo does not. For big images there is no visual difference but it’s visible in small imagery.
  • A fast GLCM feature texture computation based on python numpy arrays (for more information see the ‘fastGLCM’ Python Code Github Repository). To use this version, you will need to have Python configured in your Operating System and the reticulate R package installed.

More details on the functionality of fastGLCM can be found in the package Documentation, Vignette and blog-post


Installation:


To install the package from CRAN use,

install.packages("fastGLCM")


and to download the latest version of the package from Github,

remotes::install_github('mlampros/fastGLCM')


Docker Image


Docker images of the fastGLCM package are available to download from my dockerhub account. The images come with Rstudio and the R-development version (latest) installed. The whole process was tested on Ubuntu 18.04. To pull & run the image do the following,



docker pull mlampros/fastglcm:rstudiodev

docker run -d --name rstudio_dev -e USER=rstudio -e PASSWORD=give_here_your_password --rm -p 8787:8787 mlampros/fastglcm:rstudiodev


The user can also bind a home directory / folder to the image to use its files by specifying the -v command,



docker run -d --name rstudio_dev -e USER=rstudio -e PASSWORD=give_here_your_password --rm -p 8787:8787 -v /home/YOUR_DIR:/home/rstudio/YOUR_DIR mlampros/fastglcm:rstudiodev


The USER defaults to rstudio but you have to give your PASSWORD of preference (see https://rocker-project.org for more information).


Open your web-browser and depending where the docker image was build / run give,


1st. Option on your personal computer,


http://0.0.0.0:8787 


2nd. Option on a cloud instance,


http://Public DNS:8787


to access the Rstudio console in order to give your username and password.


Similar Projects:


Citation:


If you use the code of this repository in your paper or research please cite both fastGLCM and the original articles (see CITATION) https://CRAN.R-project.org/package=fastGLCM:


@Manual{,
  title = {{fastGLCM}: Fast Gray Level Co-occurrence Matrix computation (GLCM) using R},
  author = {Lampros Mouselimis},
  year = {2022},
  note = {R package version 1.0.2},
  url = {https://CRAN.R-project.org/package=fastGLCM},
}