{"id":15703897,"url":"https://github.com/gzt/catsim","last_synced_at":"2025-09-10T13:38:49.947Z","repository":{"id":56935367,"uuid":"160879460","full_name":"gzt/catsim","owner":"gzt","description":"A structural similarity index for binary or categorical images that works in 2D or 3D.","archived":false,"fork":false,"pushed_at":"2024-09-30T19:54:30.000Z","size":1868,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-08T15:21:45.731Z","etag":null,"topics":["binary-data","binary-image-classification","binary-image-processing","categorical-data","categorical-images","classification","image-processing","r"],"latest_commit_sha":null,"homepage":"https://gzt.github.io/catsim","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gzt.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-07T21:55:57.000Z","updated_at":"2024-09-30T19:51:21.000Z","dependencies_parsed_at":"2024-10-24T06:15:25.448Z","dependency_job_id":"4aca07f8-1267-4813-bb3a-166b32cca026","html_url":"https://github.com/gzt/catsim","commit_stats":{"total_commits":263,"total_committers":9,"mean_commits":29.22222222222222,"dds":0.0874524714828897,"last_synced_commit":"eceeb92f1b40b9afaf4af94737fcfdff2c586c62"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/gzt/catsim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gzt%2Fcatsim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gzt%2Fcatsim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gzt%2Fcatsim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gzt%2Fcatsim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gzt","download_url":"https://codeload.github.com/gzt/catsim/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gzt%2Fcatsim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274395268,"owners_count":25277320,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binary-data","binary-image-classification","binary-image-processing","categorical-data","categorical-images","classification","image-processing","r"],"created_at":"2024-10-03T20:08:01.127Z","updated_at":"2025-09-10T13:38:49.921Z","avatar_url":"https://github.com/gzt.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r setup, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n\u003c!-- badges: start --\u003e\n\n[![lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)\n  [![Coverage status](https://codecov.io/gh/gzt/catsim/branch/master/graph/badge.svg)](https://app.codecov.io/github/gzt/catsim?branch=master)\n  [![R build status](https://github.com/gzt/catsim/workflows/R-CMD-check/badge.svg)](https://github.com/gzt/catsim/actions)\n  \u003c!-- badges: end --\u003e\n\n# `catsim`: a Categorical Image Similarity Index\n\nThe goal of `catsim` is to provide a similarity measure for binary or categorical images in either 2D or 3D\nsimilar to the [MS-SSIM index](https://en.wikipedia.org/wiki/Structural_similarity) for color images. \nSuppose you have a ground truth segmentation of some image\nthat has been segmented into regions - perhaps a brain scan with different types of tissues or a map \nwith different types of terrain - and a segmentation produced by some classification method.\nComparing the two pixel-by pixel (or voxel-by-voxel) might work well, but a method that captures \nstructural similarities might work better for your purposes. MS-SSIM is an image comparison metric\nthat tries to match the assessment of the human visual system by considering structural similarities\nacross multiple scales. CatSIM applies a similar logic in the case of 2-D and 3-D binary and multicategory\nimages, such as might be found in image segmentation or classification problems.\n\n\n## Installation\n\nYou can install the released version of catsim from [CRAN](https://CRAN.R-project.org) with:\n\n```r\ninstall.packages(\"catsim\")\n#### or the dev version with:\n#devtools::install_github(\"gzt/catsim\")\n```\n\n## Usage\n\nIf you have two images, `x` and `y`, the simplest method of comparing them is:\n\n```{r displayimage}\nlibrary(catsim)\nset.seed(20200505)\nx \u003c- besag\ny \u003c- x\ny[10:20,10:20] \u003c- 1\ncatsim(x, y, levels = 3)\n```\n\nBy default, this performs 5 levels of downsampling and uses Cohen's kappa as the local \nsimilarity metric on `11 x 11` windows for a 2-dimensional image and `5 x 5 x 5`\nwindows for a 3-D image. Those can be adjusted using the `levels`, `method`, and `window`\narguments. \n\n\nPlease note that the `catsim` project is released with a [Contributor Code of Conduct](https://gzt.github.io/catsim/CODE_OF_CONDUCT.html).\nBy contributing to this project, you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgzt%2Fcatsim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgzt%2Fcatsim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgzt%2Fcatsim/lists"}