Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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")
Expand All @@ -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:

Expand Down
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,25 +58,27 @@ plot(vol)
<img src="man/figures/README-unnamed-chunk-2-1.png" width="100%" />

``` 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")
```

<img src="man/figures/README-unnamed-chunk-3-1.png" width="100%" />

## 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:

Expand Down
6 changes: 3 additions & 3 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file modified man/figures/README-unnamed-chunk-3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions vignettes/articles/v2-changes-since-v1.Rmd
Original file line number Diff line number Diff line change
@@ -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}
---
Expand Down
4 changes: 2 additions & 2 deletions vignettes/articles/v2-parameters.Rmd
Original file line number Diff line number Diff line change
@@ -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}
---
Expand Down