reconstructImageFromPatches: Reconstruct image from a list of patches.

View source: R/reconstructImageFromPatches.R

reconstructImageFromPatchesR Documentation

Reconstruct image from a list of patches.

Description

Reconstruct image from a list of patches.

Usage

reconstructImageFromPatches(
  patches,
  domainImage,
  strideLength = 1,
  domainImageIsMask = FALSE
)

Arguments

patches

List or array of patches defining an image. Patches are assumed to have the same format as returned by extractImagePatches.

domainImage

Image or mask to define the geometric information of the reconstructed image. If this is a mask image, the reconstruction will only use patches in the mask.

strideLength

Defines the sequential patch overlap for maxNumberOfPatches = all. Can be a image-dimensional vector or a scalar.

domainImageIsMask

boolean specifying whether the domain image is a mask used to limit the region of reconstruction from the patches.

Value

an ANTs image.

Author(s)

Tustison NJ

Examples


library( ANTsR )

image <- antsImageRead( getANTsRData( "r16" ) )
patchSet <- extractImagePatches( image, c( 64, 64 ), "all", c( 8, 8 ) )
imageReconstructed <-
  reconstructImageFromPatches( patchSet, image, c( 8, 8 ) )
testthat::expect_equal(as.array(image), as.array(imageReconstructed))
rm(image); gc()
rm(patchSet); gc()
rm(imageReconstructed); gc()

ANTsX/ANTsRNet documentation built on April 23, 2024, 1:24 p.m.