basicInPaint: Inpaints missing imaging data from boundary data

View source: R/basicInPaint.R

basicInPaintR Documentation

Inpaints missing imaging data from boundary data

Description

Smooths data along the boundary into the missing region.

Usage

basicInPaint(img, paintMask, speedimage = NULL, its = 0, gparam = 0.05)

Arguments

img

antsImage to be approximated / painted

paintMask

painting mask with values 1 or values 1 and 2 - if there is a 2 then it will learn from label 1 to paint label 2. should cover the brain.

speedimage

- larger means faster/better

its

- iterations of graddescent

gparam

- graddescent param e.g. 0.05

Value

inpainted image

Author(s)

Brian B. Avants

Examples

set.seed(123)
fi <- abs(replicate(100, rnorm(100)))
fi[1:10, ] <- fi[, 1:10] <- fi[91:100, ] <- fi[, 91:100] <- 0
mask <- fi
mask[mask > 0] <- 1
mask2 <- mask
mask2[11:20, 11:20] <- 2
mask <- as.antsImage(mask2)
fi <- as.antsImage(fi)
fi <- smoothImage(fi, 3)
## Not run: 
painted <- basicInPaint(fi, mask)

## End(Not run)

stnava/ANTsR documentation built on Sept. 19, 2024, 12:02 a.m.