Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ntustison committed Sep 23, 2024
2 parents c996afa + 737e212 commit 991588c
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 48 deletions.
4 changes: 2 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ export(encodeSsd3D)
export(encodeUnet)
export(extractImagePatchCoordinates)
export(extractImagePatches)
export(getANTsXNetCacheDirectory)
export(getANTsXNetData)
export(getAntsxnetCacheDirectory)
export(getMixtureDensityLossFunction)
export(getMixtureDensityMseAccuracyFunction)
export(getMixtureDensitySamplingFunction)
Expand Down Expand Up @@ -194,7 +194,7 @@ export(reconstructImageFromPatches)
export(regressionMatchImage)
export(sampleFromCategoricalDistribution)
export(sampleFromOutput)
export(setAntsxnetCacheDirectory)
export(setANTsXNetCacheDirectory)
export(shivaPvsSegmentation)
export(shivaWmhSegmentation)
export(simulateBiasField)
Expand Down
10 changes: 5 additions & 5 deletions R/getANTsXNetData.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#' @param path A character string specifying the path to the cache directory.
#' @return NULL
#' @export
setAntsxnetCacheDirectory <- function(path) {
normalizedPath <- normalizePath(path, winslash = "/", mustWork = FALSE)
setANTsXNetCacheDirectory <- function(path) {
normalizedPath <- normalizePath( path, winslash = "/", mustWork = FALSE )

if (!dir.exists(normalizedPath)) {
dir.create(normalizedPath, recursive = TRUE)
Expand All @@ -26,7 +26,7 @@ setAntsxnetCacheDirectory <- function(path) {
#'
#' @return A character string specifying the path to the cache directory.
#' @export
getAntsxnetCacheDirectory <- function() {
getANTsXNetCacheDirectory <- function() {
cacheDir <- getOption("antsxnetCacheDirectory", default = NULL)

if (is.null(cacheDir)) {
Expand Down Expand Up @@ -185,12 +185,12 @@ getANTsXNetData <- function(
}
}

targetFileNamePath <- fs::path_join( path.expand( c( getAntsxnetCacheDirectory(), targetFileName ) ) )
targetFileNamePath <- fs::path_join( path.expand( c( getANTsXNetCacheDirectory(), targetFileName ) ) )

if( ! fs::file_exists( targetFileNamePath ) )
{
targetFileNamePath <- tensorflow::tf$keras$utils$get_file(
targetFileName, url, cache_subdir = getAntsxnetCacheDirectory() )
targetFileName, url, cache_subdir = getANTsXNetCacheDirectory() )
}

return( as.character( targetFileNamePath ) )
Expand Down
2 changes: 1 addition & 1 deletion R/getPretrainedNetwork.R
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ getPretrainedNetwork <- function(
targetFileName <- paste0( fileId, ".h5" )
}

cacheDir <- getAntsxnetCacheDirectory()
cacheDir <- getANTsXNetCacheDirectory()

targetFileNamePath <- fs::path_join( path.expand( c( cacheDir, targetFileName ) ) )

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,6 @@ R CMD INSTALL ANTsRNet

[Documentation page](https://antsx.github.io/ANTsRNet/)

[ANTsXNet tutorial](https://gist.github.com/ntustison/12a656a5fc2f6f9c4494c88dc09c5621#antsxnet)
[ANTsXNet self-contained examples](https://gist.github.com/ntustison/12a656a5fc2f6f9c4494c88dc09c5621#antsxnet)


16 changes: 0 additions & 16 deletions man/dot-antsxnetCacheDirectory.Rd

This file was deleted.

5 changes: 4 additions & 1 deletion man/getANTsXNetData.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 6 additions & 11 deletions man/getAntsxnetCacheDirectory.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/getPretrainedNetwork.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/randomlyTransformImageData.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 4 additions & 9 deletions man/setAntsxnetCacheDirectory.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 991588c

Please sign in to comment.