View source: R/reconstructImageFromPatches.R
reconstructImageFromPatches | R Documentation |
Reconstruct image from a list of patches.
reconstructImageFromPatches(
patches,
domainImage,
strideLength = 1,
domainImageIsMask = FALSE
)
patches |
List or array of patches defining an image. Patches are assumed
to have the same format as returned by |
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
|
domainImageIsMask |
boolean specifying whether the domain image is a mask used to limit the region of reconstruction from the patches. |
an ANTs image.
Tustison NJ
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()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.