Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
etwinn committed Aug 31, 2023
1 parent d231885 commit 13af368
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 9 deletions.
7 changes: 0 additions & 7 deletions R/RcppExports.R

This file was deleted.

3 changes: 2 additions & 1 deletion R/mcmc.R
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ generate_ashape3d <- function(point_cloud, J, tau, delta=0.05,
}
keep_pts
}

my_points = unique(my_points) #keeps error free if necessary.
if(dim(my_points)[1]<5){
stop("Not enough points accepted in MCMC walk to make a shape. Need at least 5.")
}
Expand Down Expand Up @@ -182,6 +182,7 @@ generate_ashape2d <- function(point_cloud, J, tau, delta=0.05,
}
keep_pts
}
my_points = unique(my_points) #keeps error free if necessary.
if(dim(my_points)[1]<3){
stop("Not enough points accepted in MCMC walk to make a shape. Need at least 3.")
}
Expand Down
1 change: 1 addition & 0 deletions R/tau_bound.R
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ extreme_pts <- function(complex, n_vert, dimension){
edge_face = data.frame(edge_face)
colnames(edge_face)=c("ed1", "ed2")
int_edge = edge_face[which(duplicated(edge_face)),]
int_edge = unique(int_edge)
bd_edge = setdiff(edge_list, int_edge)
bd_vert = unique(c(bd_edge$ed1, bd_edge$ed2))
return(c(iso_vert, bd_vert))
Expand Down
75 changes: 74 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,75 @@
# ashapesampler
R package for sampling alpha shapes

R package for generating alpha shapes via either sampling from a known distribution or sampling based on an existing data set.

## R Packages for ashapesampler and Tutorials

The ashapesampler software requires the installation of the following R libraries:

[alphahull](https://cran.r-project.org/web/packages/alphahull/index.html)

[alphashape3d](https://cran.r-project.org/web/packages/alphashape3d/index.html)

[doParallel](https://cran.r-project.org/web/packages/doParallel/index.html)

[dplyr](https://cran.r-project.org/web/packages/dplyr/index.html)

[foreach](https://cran.r-project.org/web/packages/foreach/index.html)

[ggplot2](https://cran.r-project.org/web/packages/ggplot2/index.html)

[Rvcg](https://cran.r-project.org/web/packages/Rvcg/index.html)

[TDA](https://cran.r-project.org/web/packages/TDA/index.html)

[truncnorm](https://cran.r-project.org/web/packages/truncnorm/index.html)

Note that the latest BAKR and RATE functions are also included in the `Software` directory for this repo. Unless stated otherwise, the easiest method to install many of these packages is with the following example command entered in an R shell:

install.packages("alphahull", dependecies = TRUE)

Alternatively, one can also [install R packages from the command line](http://cran.r-project.org/doc/manuals/r-release/R-admin.html#Installing-packages).

## C++ Packages for ashapesampler and Tutorials

The code in this repository assumes that basic C++ functions and applications are already set up on the running personal computer or cluster. If not, the functions and necessary TDA and alphashape3d packages to build alpha complexes and alpha shapes in three dimensions will not work properly. A simple option is to use [gcc](https://gcc.gnu.org/). macOS users may use this collection by installing the [Homebrew package manager](http://brew.sh/index.html) and then typing the following into the terminal:

brew install gcc

For macOS users, the Xcode Command Line Tools include a GCC compiler. Instructions on how to install Xcode may be found [here](http://railsapps.github.io/xcode-command-line-tools.html). Additional installs for macOS users are automake, curl, glfw3, glew, xquartz, and qpdf. For extra tips on how to run C++ on macOS, please visit [here](http://seananderson.ca/2013/11/18/rcpp-mavericks.html). For tips on how to avoid errors dealing with "-lgfortran" or "-lquadmath", please visit [here](http://thecoatlessprofessor.com/programming/rcpp-rcpparmadillo-and-os-x-mavericks-lgfortran-and-lquadmath-error/).

## R Package Installation

To install the package, we will use the remotes package and run the command:

remotes::install_github('lcrawlab/ashapesampler')

To load the package, use the command

library(ashapesampler)

Other common installation procedures may apply.

# Code Usage

## Vignettes

The `vignettes` folder contains the following demonstrations for running and analyzing results in the ashapesampler:

Generating new annuli from a simulated set of annuli

Generating new tori from a simulated set of tori

Converting binary masks to simplicial complexes for input into the alpha shape sampler

Analyzing landmarks on teeth via procrustes analysis

## Relevant Citations

E.T. Winn-Nuñez, H. Witt, D. Bhaskar, R. Huang, I.Y. Wong, J. Reichner, and L. Crawford. A probabilistic method for sampling alpha-shapes.

## Questions and Feedback

Please send any questions or feedback to the corresponding authors [Emily Winn-Nuñez](mailto:[email protected]) or [Lorin Crawford](mailto:[email protected]).

We appreciate any feedback you may have with our repository and instructions.

0 comments on commit 13af368

Please sign in to comment.