diff --git a/README.Rmd b/README.Rmd index 060acea..e8b4af5 100644 --- a/README.Rmd +++ b/README.Rmd @@ -24,7 +24,7 @@ knitr::opts_chunk$set( The goal of **supercells** is to bring the idea of superpixels into spatial analysis - grouping raster cells (not just image pixels) into meaningful, coherent regions. This package works on spatial data with one variable (e.g., continuous raster), many variables (e.g., RGB rasters), and spatial patterns (e.g., areas in categorical rasters). -It is based on the SLIC algorithm (Achanta et al. (2012)), adapted to work with arbitrary dissimilarity measures. +It is based on the SLIC algorithm (Achanta et al. (2012)), adapted to work with arbitrary dissimilarity measures and multidimensional data. ## Installation @@ -34,7 +34,7 @@ You can install the released version of supercells from [CRAN](https://CRAN.R-pr install.packages("supercells") ``` -You can install the development version from [GitHub](https://github.com/) with: +You can install the development version with: ``` r install.packages("supercells", repos = "https://nowosad.r-universe.dev") @@ -56,21 +56,24 @@ vol = rast(system.file("raster/volcano.tif", package = "supercells")) plot(vol) ``` +Here, `step` controls the approximate spacing between supercell centers, and `compactness` allows to balance spatial proximity versus value similarity. + ```{r} #| results: 'hide' -vol_slic1 = supercells(vol, k = 50, compactness = 7) +vol_slic1 = sc_slic(vol, step = 8, compactness = 7) plot(vol) plot(st_geometry(vol_slic1), add = TRUE, lwd = 0.5, border = "red") ``` ## Documentation -See the package's vignettes: +Version 2 (in development) focuses on a clearer workflow, better diagnostics, and more guidance on choosing parameters and interpreting results. +Start with these vignettes: -1. [The `supercells()` function](https://jakubnowosad.com/supercells/articles/main-function.html) -2. [Superpixels of a single raster layer](https://jakubnowosad.com/supercells/articles/articles/one_var.html) -3. [Superpixels of an RGB raster](https://jakubnowosad.com/supercells/articles/articles/rgb_vars.html) -4. [Superpixels of spatial categorical patterns](https://jakubnowosad.com/supercells/articles/articles/motifels.html) +1. [Main changes since version 1.0.0](https://jakubnowosad.com/supercells/articles/v2-changes-since-v1.html) +2. [Introduction to supercells](https://jakubnowosad.com/supercells/articles/v2-intro.html) +3. [Choosing parameters for supercells](https://jakubnowosad.com/supercells/articles/v2-parameters.html) +4. [Evaluation and diagnostics](https://jakubnowosad.com/supercells/articles/v2-evaluation.html) Watch the presentations about this package and some related ideas: diff --git a/README.md b/README.md index 60a7002..fd988c1 100644 --- a/README.md +++ b/README.md @@ -58,25 +58,27 @@ plot(vol) ``` r -vol_slic1 = supercells(vol, k = 50, compactness = 1) +vol_slic1 = sc_slic(vol, step = 8, compactness = 1) plot(vol) -plot(st_geometry(vol_slic1), add = TRUE, lwd = 0.2) +plot(st_geometry(vol_slic1), add = TRUE, lwd = 0.5, border = "red") ``` ## Documentation -See the package’s vignettes: - -1. [The `supercells()` - function](https://jakubnowosad.com/supercells/articles/main-function.html) -2. [Superpixels of a single raster - layer](https://jakubnowosad.com/supercells/articles/articles/one_var.html) -3. [Superpixels of an RGB - raster](https://jakubnowosad.com/supercells/articles/articles/rgb_vars.html) -4. [Superpixels of spatial categorical - patterns](https://jakubnowosad.com/supercells/articles/articles/motifels.html) +The upcoming version 2 (development) introduces a refreshed API with +`sc_`-prefixed functions (for example, `sc_slic()`), plus new tooling for +parameter tuning and evaluation. Start with these v2 vignettes: + +1. [Main changes since version + 1.0.0](https://jakubnowosad.com/supercells/articles/v2-changes-since-v1.html) +2. [Introduction to + supercells](https://jakubnowosad.com/supercells/articles/v2-intro.html) +3. [Choosing parameters for + supercells](https://jakubnowosad.com/supercells/articles/v2-parameters.html) +4. [Evaluation and + diagnostics](https://jakubnowosad.com/supercells/articles/v2-evaluation.html) Watch the presentations about this package and some related ideas: diff --git a/_pkgdown.yml b/_pkgdown.yml index 4c1426b..d6f1657 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -8,12 +8,12 @@ navbar: text: Articles menu: - text: "Version 2.0" - - text: Main supercells changes since version 1.0.0 + - text: Main changes since version 1.0.0 href: articles/v2-changes-since-v1.html - text: Introduction to supercells href: articles/v2-intro.html - - text: Choosing Parameters for Supercells - href: articles/v2-tuning.html + - text: Choosing parameters for supercells + href: articles/v2-parameters.html - text: Evaluation and diagnostics href: articles/v2-evaluation.html # - text: Title A1 diff --git a/man/figures/README-unnamed-chunk-3-1.png b/man/figures/README-unnamed-chunk-3-1.png index 1724d64..4b2c7b4 100644 Binary files a/man/figures/README-unnamed-chunk-3-1.png and b/man/figures/README-unnamed-chunk-3-1.png differ diff --git a/vignettes/articles/v2-changes-since-v1.Rmd b/vignettes/articles/v2-changes-since-v1.Rmd index 1cf4337..c1d469a 100644 --- a/vignettes/articles/v2-changes-since-v1.Rmd +++ b/vignettes/articles/v2-changes-since-v1.Rmd @@ -1,10 +1,10 @@ --- -title: "Main supercells changes since version 1.0.0" +title: "Main changes since version 1.0.0" author: Jakub Nowosad date: "`r Sys.Date()`" output: rmarkdown::html_vignette vignette: > - %\VignetteIndexEntry{Main supercells changes since version 1.0.0} + %\VignetteIndexEntry{Main changes since version 1.0.0} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- diff --git a/vignettes/articles/v2-parameters.Rmd b/vignettes/articles/v2-parameters.Rmd index dd76c38..982c32a 100644 --- a/vignettes/articles/v2-parameters.Rmd +++ b/vignettes/articles/v2-parameters.Rmd @@ -1,10 +1,10 @@ --- -title: "Choosing Parameters for Supercells" +title: "Choosing parameters for supercells" author: Jakub Nowosad date: "`r Sys.Date()`" output: rmarkdown::html_vignette vignette: > - %\VignetteIndexEntry{Choosing Parameters for Supercells} + %\VignetteIndexEntry{Choosing parameters for supercells} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} ---