atropos.Rd
A finite mixture modeling (FMM) segmentation approach with possibilities for
specifying prior constraints. These prior constraints include the
specification of a prior label image, prior probability images (one for each
class), and/or an MRF prior to enforce spatial smoothing of the labels.
Similar algorithms include FAST and SPM. atropos can also perform
multivariate segmentation if you pass a list of images in: e.g.
a=c(img1,img2)
.
atropos(
a,
x,
i = "KMeans[3]",
m = "[0.2,1x1]",
c = "[5,0]",
priorweight = 0.25,
verbose = FALSE,
use_random_seed = FALSE,
...
)
One or more scalar images to segment. If priors are not used, the intensities of the first image are used to order the classes in the segmentation output, from lowest to highest intensity. Otherwise the order of the classes is dictated by the order of the prior images.
mask image.
initialization usually KMeans[N]
for N classes or a list of N prior probability images.
See Atropos in ANTs for full set of options.
mrf parameters as a string, usually "[smoothingFactor,radius]"
where smoothingFactor
determines the amount of smoothing and radius determines the MRF neighborhood, as an ANTs style neighborhood
vector eg "1x1x1" for a 3D image. The radius must match the dimensionality of the image, eg 1x1 for 2D and
The default in ANTs is smoothingFactor=0.3
and radius=1
. See Atropos for more options.
convergence parameters, "[numberOfIterations,convergenceThreshold]"
. A threshold of 0 runs
the full numberOfIterations
, otherwise Atropos tests convergence by comparing the mean maximum posterior
probability over the whole region of interest defined by the mask x
.
usually 0 (priors used for initialization only), 0.25 or 0.5.
boolean
Initialize internal random number generator with a random seed.
Otherwise, initialize with a constant seed number. If this is TRUE
,
the results are not fully reproducible.
more parameters, see Atropos help in ANTs
0 – Success
1 – Failure
img <- antsImageRead(getANTsRData("r16"), 2)
img <- resampleImage(img, c(64, 64), 1, 0)
mask <- getMask(img)
segs1 <- atropos(
a = img, m = "[0.2,1x1]",
c = "[2,0]", i = "kmeans[3]", x = mask
)
# Use probabilities from k-means seg as priors
segs2 <- atropos(
a = img, m = "[0.2,1x1]",
c = "[2,0]", i = segs1$probabilityimages, x = mask
)
feats <- list(img, iMath(img, "Laplacian"), iMath(img, "Grad"))
segs3 <- atropos(
a = feats, m = "[0.2,1x1]",
c = "[2,0]", i = segs1$probabilityimages, x = mask
)