wire

R package wire

https://github.com/yuhangtom/wire

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.1%) to scientific vocabulary
Last synced: 11 months ago · JSON representation ·

Repository

R package wire

Basic Info
Statistics
  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created almost 3 years ago · Last pushed about 2 years ago
Metadata Files
Readme License Citation

README.Rmd

---
output: github_document
editor_options: 
  chunk_output_type: console
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%",
  message = FALSE,
  warning = FALSE
)

set.seed(0)
```


# wire wire website



[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![Last-changedate](https://img.shields.io/badge/last%20change-`r gsub('-', '--', Sys.Date())`-yellowgreen.svg)](https://github.com/YuhangTom/wire/commits/main)
[![CRAN
status](https://www.r-pkg.org/badges/version/wire.png)](https://CRAN.R-project.org/package=wire)
[![Codecov test coverage](https://codecov.io/gh/YuhangTom/wire/branch/main/graph/badge.svg)](https://app.codecov.io/gh/YuhangTom/wire?branch=main)
[![R-CMD-check](https://github.com/YuhangTom/wire/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/YuhangTom/wire/actions/workflows/R-CMD-check.yaml)


The goal of `wire` is to provide a systematic reproducible automatic algorithm to analyze the similarity between wire cut scans.


# Installation


You can install the development version of wire from [GitHub](https://github.com/) with:

``` r
# install.packages("devtools")
devtools::install_github("YuhangTom/wire")
```


# Usage


## Data


The original scans for the wire cuts are stored in `x3p` format of width around 2300 and height around 1800,
under a resolution $0.645 \mu m \times 0.645 \mu m$,
with each file being at least 15 MB,
which is much larger compared to the file limit of 5 MB for a `R` package.
Therefore,
we subsampled the original scans by a factor of 10,
and saved them as `x3p_subsamples` in the package.
The data can be used by:

```{r data}
library(wire)

x3p_subsamples
```


## Inner polygon


To remove the edge effect,
we extract the inner part of the scan,
which can be achieved by:

```{r insidepoly}
x3p <- x3p_subsamples[[1]]
insidepoly_df <- x3p_insidepoly_df(x3p, mask_col = "#FF0000", concavity = 1.5, b = 1, ifplot = TRUE)

attr(insidepoly_df, "x3p_plot")
attr(insidepoly_df, "number_of_missing_immediate_neighbors_plot")
attr(insidepoly_df, "standard_deviation_of_non_missing_immediate_neighbors_plot")
attr(insidepoly_df, "number_of_missing_immediate_neighbors_boxplot")
```


## Remove trend


To remove the overall trend on the inner surface,
we can use:

```{r rmtrend}
x3p_inner_nomiss_res <- df_rmtrend_x3p(insidepoly_df)
x3p_inner_nomiss_res
```


## Imputation


We can impute the missing values inside the surface by:

```{r impute}
x3p_inner_impute <- x3p_impute(x3p_inner_nomiss_res, ifout = TRUE, ifsave = FALSE, dir_name = NULL, ifplot = TRUE)
attr(x3p_inner_impute, "x3p_impute_0_plot")
attr(x3p_inner_impute, "x3p_impute_1_plot")
attr(x3p_inner_impute, "x3p_impute_n_plot")
```


## Rotation


We can rotate the surface to the correct angle by:

```{r rotate}
x3p_bin_rotate <- x3p_vertical(x3p_inner_impute, min_score_cut = 5, ifplot = TRUE)

attr(x3p_bin_rotate, "nfline_red_plot")
attr(x3p_bin_rotate, "MLE_loess_red_plot")
attr(x3p_bin_rotate, "nfline_blue_plot")
attr(x3p_bin_rotate, "MLE_loess_blue_plot")
```


## Signal extraction


To extract signals from the rotated surface,
two methods are provided,
implemented by
`wire::x3p_raw_sig_df`
and
`wire::x3p_shift_sig_df`,
respectively:

```{r signal}
raw_sig_df <- x3p_raw_sig_df(x3p_bin_rotate, ifplot = TRUE)
attr(raw_sig_df, "sig_df_plot")

shift_sig_df <- x3p_shift_sig_df(x3p_bin_rotate, ifplot = TRUE)
attr(shift_sig_df, "x3p_before_shift_plot")
attr(shift_sig_df, "x3p_after_shift_plot")
attr(shift_sig_df, "fn_align_plot")
attr(shift_sig_df, "MSE_plot")
attr(shift_sig_df, "sig_df_plot")
```

The signals and hooks can be further smoothed and removed by:

```{r ccsignals}
raw_ccsig_df <- df_ccsig(raw_sig_df, ifplot = TRUE)
attr(raw_ccsig_df, "sig_df_plot")
```



## Signal alignment


Extracted signals can be aligned,
and the cross-correlation can be computed:

```{r align}
aligned <- vec_align_sigs_list(raw_sig_df$sig, shift_sig_df$sig, ifplot = TRUE)
attr(aligned, "sig_align_plot")
```

Owner

  • Name: Yuhang (Tom) Lin
  • Login: YuhangTom
  • Kind: user
  • Location: Ames, IA
  • Company: Iowa State University

Citation (CITATION.cff)

# --------------------------------------------
# CITATION file created with {cffr} R package
# See also: https://docs.ropensci.org/cffr/
# --------------------------------------------
 
cff-version: 1.2.0
message: 'To cite package "wire" in publications use:'
type: software
license: MIT
title: 'wire: Tools for Analyzing Similarity Between Wires'
version: 0.0.0.9000
abstract: This `wire` package allows everyone to conduct reproducible automatic analysis
  to compare different wire scans in 'x3p' format. A conclusion for similarity or
  dissimilarity can be easily drawn based on the resulting cross-correlation.
authors:
- family-names: Lin
  given-names: Yuhang
  email: yhlin@iastate.edu
  orcid: https://orcid.org/0000-0002-3600-9889
- family-names: Hofmann
  given-names: Heike
  email: hofmann@iastate.edu
  orcid: https://orcid.org/0000-0001-6216-5183
preferred-citation:
  type: manual
  title: Tools for Analyzing Similarity Between Wires
  authors:
  - family-names: Lin
    given-names: Yuhang
    email: yhlin@iastate.edu
    orcid: https://orcid.org/0000-0002-3600-9889
  - family-names: Hofmann
    given-names: Heike
    email: hofmann@iastate.edu
    orcid: https://orcid.org/0000-0001-6216-5183
  year: '2023'
  url: https://github.com/YuhangTom/wire
repository-code: https://github.com/YuhangTom/wire
url: https://yuhangtom.github.io/wire/
contact:
- family-names: Lin
  given-names: Yuhang
  email: yhlin@iastate.edu
  orcid: https://orcid.org/0000-0002-3600-9889
references:
- type: software
  title: sf
  abstract: 'sf: Simple Features for R'
  notes: Suggests
  url: https://r-spatial.github.io/sf/
  repository: https://CRAN.R-project.org/package=sf
  authors:
  - family-names: Pebesma
    given-names: Edzer
    email: edzer.pebesma@uni-muenster.de
    orcid: https://orcid.org/0000-0001-8049-7069
  year: '2024'
- type: software
  title: spelling
  abstract: 'spelling: Tools for Spell Checking in R'
  notes: Suggests
  url: https://ropensci.r-universe.dev/spelling
  repository: https://CRAN.R-project.org/package=spelling
  authors:
  - family-names: Ooms
    given-names: Jeroen
    email: jeroen@berkeley.edu
    orcid: https://orcid.org/0000-0002-4035-0289
  - family-names: Hester
    given-names: Jim
    email: james.hester@rstudio.com
  year: '2024'
- type: software
  title: testthat
  abstract: 'testthat: Unit Testing for R'
  notes: Suggests
  url: https://testthat.r-lib.org
  repository: https://CRAN.R-project.org/package=testthat
  authors:
  - family-names: Wickham
    given-names: Hadley
    email: hadley@posit.co
  year: '2024'
  version: '>= 3.0.0'
- type: software
  title: withr
  abstract: 'withr: Run Code ''With'' Temporarily Modified Global State'
  notes: Suggests
  url: https://withr.r-lib.org
  repository: https://CRAN.R-project.org/package=withr
  authors:
  - family-names: Hester
    given-names: Jim
  - family-names: Henry
    given-names: Lionel
    email: lionel@posit.co
  - family-names: Müller
    given-names: Kirill
    email: krlmlr+r@mailbox.org
  - family-names: Ushey
    given-names: Kevin
    email: kevinushey@gmail.com
  - family-names: Wickham
    given-names: Hadley
    email: hadley@posit.co
  - family-names: Chang
    given-names: Winston
  year: '2024'
- type: software
  title: raster
  abstract: 'raster: Geographic Data Analysis and Modeling'
  notes: Imports
  url: https://rspatial.org/raster
  repository: https://CRAN.R-project.org/package=raster
  authors:
  - family-names: Hijmans
    given-names: Robert J.
    email: r.hijmans@gmail.com
    orcid: https://orcid.org/0000-0001-5872-2872
  year: '2024'
- type: software
  title: dplyr
  abstract: 'dplyr: A Grammar of Data Manipulation'
  notes: Imports
  url: https://dplyr.tidyverse.org
  repository: https://CRAN.R-project.org/package=dplyr
  authors:
  - family-names: Wickham
    given-names: Hadley
    email: hadley@posit.co
    orcid: https://orcid.org/0000-0003-4757-117X
  - family-names: François
    given-names: Romain
    orcid: https://orcid.org/0000-0002-2444-4226
  - family-names: Henry
    given-names: Lionel
  - family-names: Müller
    given-names: Kirill
    orcid: https://orcid.org/0000-0002-1416-3412
  - family-names: Vaughan
    given-names: Davis
    email: davis@posit.co
    orcid: https://orcid.org/0000-0003-4777-038X
  year: '2024'
- type: software
  title: stats
  abstract: 'R: A Language and Environment for Statistical Computing'
  notes: Imports
  authors:
  - name: R Core Team
  institution:
    name: R Foundation for Statistical Computing
    address: Vienna, Austria
  year: '2024'
- type: software
  title: tidyr
  abstract: 'tidyr: Tidy Messy Data'
  notes: Imports
  url: https://tidyr.tidyverse.org
  repository: https://CRAN.R-project.org/package=tidyr
  authors:
  - family-names: Wickham
    given-names: Hadley
    email: hadley@posit.co
  - family-names: Vaughan
    given-names: Davis
    email: davis@posit.co
  - family-names: Girlich
    given-names: Maximilian
  year: '2024'
- type: software
  title: purrr
  abstract: 'purrr: Functional Programming Tools'
  notes: Imports
  url: https://purrr.tidyverse.org/
  repository: https://CRAN.R-project.org/package=purrr
  authors:
  - family-names: Wickham
    given-names: Hadley
    email: hadley@rstudio.com
    orcid: https://orcid.org/0000-0003-4757-117X
  - family-names: Henry
    given-names: Lionel
    email: lionel@rstudio.com
  year: '2024'
- type: software
  title: magick
  abstract: 'magick: Advanced Graphics and Image-Processing in R'
  notes: Imports
  url: https://docs.ropensci.org/magick/
  repository: https://CRAN.R-project.org/package=magick
  authors:
  - family-names: Ooms
    given-names: Jeroen
    email: jeroen@berkeley.edu
    orcid: https://orcid.org/0000-0002-4035-0289
  year: '2024'
- type: software
  title: stringr
  abstract: 'stringr: Simple, Consistent Wrappers for Common String Operations'
  notes: Imports
  url: https://stringr.tidyverse.org
  repository: https://CRAN.R-project.org/package=stringr
  authors:
  - family-names: Wickham
    given-names: Hadley
    email: hadley@posit.co
  year: '2024'
- type: software
  title: assertthat
  abstract: 'assertthat: Easy Pre and Post Assertions'
  notes: Imports
  repository: https://CRAN.R-project.org/package=assertthat
  authors:
  - family-names: Wickham
    given-names: Hadley
    email: hadley@rstudio.com
  year: '2024'
- type: software
  title: ggplot2
  abstract: 'ggplot2: Create Elegant Data Visualisations Using the Grammar of Graphics'
  notes: Imports
  url: https://ggplot2.tidyverse.org
  repository: https://CRAN.R-project.org/package=ggplot2
  authors:
  - family-names: Wickham
    given-names: Hadley
    email: hadley@posit.co
    orcid: https://orcid.org/0000-0003-4757-117X
  - family-names: Chang
    given-names: Winston
    orcid: https://orcid.org/0000-0002-1576-2126
  - family-names: Henry
    given-names: Lionel
  - family-names: Pedersen
    given-names: Thomas Lin
    email: thomas.pedersen@posit.co
    orcid: https://orcid.org/0000-0002-5147-4711
  - family-names: Takahashi
    given-names: Kohske
  - family-names: Wilke
    given-names: Claus
    orcid: https://orcid.org/0000-0002-7470-9261
  - family-names: Woo
    given-names: Kara
    orcid: https://orcid.org/0000-0002-5125-4188
  - family-names: Yutani
    given-names: Hiroaki
    orcid: https://orcid.org/0000-0002-3385-7233
  - family-names: Dunnington
    given-names: Dewey
    orcid: https://orcid.org/0000-0002-9415-4582
  - family-names: Brand
    given-names: Teun
    name-particle: van den
    orcid: https://orcid.org/0000-0002-9335-7468
  year: '2024'
- type: software
  title: imager
  abstract: 'imager: Image Processing Library Based on ''CImg'''
  notes: Imports
  url: https://asgr.github.io/imager/
  repository: https://CRAN.R-project.org/package=imager
  authors:
  - family-names: Barthelme
    given-names: Simon
    email: simon.barthelme@gipsa-lab.fr
  year: '2024'
- type: software
  title: rgl
  abstract: 'rgl: 3D Visualization Using OpenGL'
  notes: Imports
  url: https://dmurdoch.github.io/rgl/
  repository: https://CRAN.R-project.org/package=rgl
  authors:
  - family-names: Murdoch
    given-names: Duncan
    email: murdoch.duncan@gmail.com
  - family-names: Adler
    given-names: Daniel
    email: dadler@dyncall.org
  year: '2024'
- type: software
  title: htmltools
  abstract: 'htmltools: Tools for HTML'
  notes: Imports
  url: https://rstudio.github.io/htmltools/
  repository: https://CRAN.R-project.org/package=htmltools
  authors:
  - family-names: Cheng
    given-names: Joe
    email: joe@posit.co
  - family-names: Sievert
    given-names: Carson
    email: carson@posit.co
    orcid: https://orcid.org/0000-0002-4958-2844
  - family-names: Schloerke
    given-names: Barret
    email: barret@posit.co
    orcid: https://orcid.org/0000-0001-9986-114X
  - family-names: Chang
    given-names: Winston
    email: winston@posit.co
    orcid: https://orcid.org/0000-0002-1576-2126
  - family-names: Xie
    given-names: Yihui
    email: yihui@posit.co
  - family-names: Allen
    given-names: Jeff
  year: '2024'
- type: software
  title: magrittr
  abstract: 'magrittr: A Forward-Pipe Operator for R'
  notes: Imports
  url: https://magrittr.tidyverse.org
  repository: https://CRAN.R-project.org/package=magrittr
  authors:
  - family-names: Bache
    given-names: Stefan Milton
    email: stefan@stefanbache.dk
  - family-names: Wickham
    given-names: Hadley
    email: hadley@rstudio.com
  year: '2024'
- type: software
  title: bulletxtrctr
  abstract: 'bulletxtrctr: Automatic Matching of Bullet Striae'
  notes: Imports
  url: https://heike.github.io/bulletxtrctr/
  authors:
  - family-names: Hofmann
    given-names: Heike
    email: hofmann@iastate.edu
    orcid: https://orcid.org/0000-0001-6216-5183
  - family-names: Vanderplas
    given-names: Susan
    email: susan.vanderplas@unl.edu
    orcid: https://orcid.org/0000-0001-6216-5183
  - family-names: Ju
    given-names: Will
    email: wju@iastate.edu
  - family-names: Krishnan
    given-names: Ganesh
    email: ganeshk@iastate.edu
  year: '2024'
  version: '>= 0.2.0.9000'
- type: software
  title: x3ptools
  abstract: 'x3ptools: Tools for Working with 3D Surface Measurements'
  notes: Imports
  url: https://heike.github.io/x3ptools/
  repository: https://CRAN.R-project.org/package=x3ptools
  authors:
  - family-names: Hofmann
    given-names: Heike
    email: hofmann@iastate.edu
    orcid: https://orcid.org/0000-0001-6216-5183
  - family-names: Vanderplas
    given-names: Susan
    email: srvander@iastate.edu
    orcid: https://orcid.org/0000-0002-3803-0972
  - family-names: Lin
    given-names: Yuhang
    email: yhlin@iastate.edu
    orcid: https://orcid.org/0000-0002-3600-9889
  - family-names: Krishnan
    given-names: Ganesh
    email: ganeshk@iastate.edu
  - family-names: Hare
    given-names: Eric
    email: eric@oaiti.org
    orcid: https://orcid.org/0000-0002-4277-3146
  year: '2024'
- type: software
  title: concaveman
  abstract: 'concaveman: A Very Fast 2D Concave Hull Algorithm'
  notes: Imports
  url: https://joelgombin.github.io/concaveman/
  repository: https://CRAN.R-project.org/package=concaveman
  authors:
  - family-names: Gombin
    given-names: Joël
    email: joel.gombin@gmail.com
  - family-names: Vaidyanathan
    given-names: Ramnath
  - family-names: Agafonkin
    given-names: Vladimir
  year: '2024'
- type: software
  title: Cairo
  abstract: 'Cairo: R Graphics Device using Cairo Graphics Library for Creating High-Quality
    Bitmap (PNG, JPEG, TIFF), Vector (PDF, SVG, PostScript) and Display (X11 and Win32)
    Output'
  notes: Imports
  url: http://www.rforge.net/Cairo/
  repository: https://CRAN.R-project.org/package=Cairo
  authors:
  - family-names: Urbanek
    given-names: Simon
    email: Simon.Urbanek@r-project.org
  - family-names: Horner
    given-names: Jeffrey
    email: jeff.horner@vanderbilt.edu
  year: '2024'
- type: software
  title: png
  abstract: 'png: Read and write PNG images'
  notes: Imports
  url: http://www.rforge.net/png/
  repository: https://CRAN.R-project.org/package=png
  authors:
  - family-names: Urbanek
    given-names: Simon
    email: Simon.Urbanek@r-project.org
  year: '2024'
- type: software
  title: grDevices
  abstract: 'R: A Language and Environment for Statistical Computing'
  notes: Imports
  authors:
  - name: R Core Team
  institution:
    name: R Foundation for Statistical Computing
    address: Vienna, Austria
  year: '2024'
- type: software
  title: graphics
  abstract: 'R: A Language and Environment for Statistical Computing'
  notes: Imports
  authors:
  - name: R Core Team
  institution:
    name: R Foundation for Statistical Computing
    address: Vienna, Austria
  year: '2024'
- type: software
  title: readr
  abstract: 'readr: Read Rectangular Text Data'
  notes: Imports
  url: https://readr.tidyverse.org
  repository: https://CRAN.R-project.org/package=readr
  authors:
  - family-names: Wickham
    given-names: Hadley
    email: hadley@posit.co
  - family-names: Hester
    given-names: Jim
  - family-names: Bryan
    given-names: Jennifer
    email: jenny@posit.co
    orcid: https://orcid.org/0000-0002-6983-2759
  year: '2024'
- type: software
  title: zoo
  abstract: 'zoo: S3 Infrastructure for Regular and Irregular Time Series (Z''s Ordered
    Observations)'
  notes: Imports
  url: https://zoo.R-Forge.R-project.org/
  repository: https://CRAN.R-project.org/package=zoo
  authors:
  - family-names: Zeileis
    given-names: Achim
    email: Achim.Zeileis@R-project.org
    orcid: https://orcid.org/0000-0003-0918-3766
  - family-names: Grothendieck
    given-names: Gabor
    email: ggrothendieck@gmail.com
  - family-names: Ryan
    given-names: Jeffrey A.
    email: jeff.a.ryan@gmail.com
  year: '2024'
- type: software
  title: RColorBrewer
  abstract: 'RColorBrewer: ColorBrewer Palettes'
  notes: Imports
  repository: https://CRAN.R-project.org/package=RColorBrewer
  authors:
  - family-names: Neuwirth
    given-names: Erich
    email: erich.neuwirth@univie.ac.at
  year: '2024'
- type: software
  title: 'R: A Language and Environment for Statistical Computing'
  notes: Depends
  url: https://www.R-project.org/
  authors:
  - name: R Core Team
  institution:
    name: R Foundation for Statistical Computing
    address: Vienna, Austria
  year: '2024'
  version: '>= 2.10'

GitHub Events

Total
Last Year

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.4.1 composite
  • actions/checkout v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v3 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION cran
  • assertthat * imports
  • bulletxtrctr >= 0.2.0.9000 imports
  • dplyr * imports
  • ggplot2 * imports
  • htmltools * imports
  • imager * imports
  • magick * imports
  • magrittr * imports
  • purrr * imports
  • raster * imports
  • rgl * imports
  • stats * imports
  • stringr * imports
  • tidyr * imports
  • wires >= 0.1.0 imports
  • x3ptools * imports
  • spelling * suggests