ripmmarcPop.Rd
Patch-based and rotation invariant image decomposition. This is similar to patch-based dictionary learning in N-dimensions. This implementation is more efficient for building a basis from image populations.
ripmmarcPop(ilist, mask, patchRadius = 3, patchSamples = 1000, patchVarEx = 0.95, meanCenter = TRUE, seed)
ilist | list of antsImages from which to learn basis |
---|---|
mask | Binary mask defining regions in which to decompose or a list of masks corresponding to ilist. |
patchRadius | Scalar radius defining the patch size. |
patchSamples | Scalar defining the number of random patches to sample. |
patchVarEx | Scalar defining the target variance explained. If this is greater than one, then it defines the number of eigenvectors. Otherwise, it defines the target variance explained. |
meanCenter | boolean whether we mean center the patches. |
seed | seed to pass to |
list including the canonical frame, the matrix basis and its eigenvalues
pop = getANTsRData( "population" ) # list of example images popmasks = list( ) for ( i in 1:length( pop ) ) popmasks[[ i ]] = getMask( pop[[ i ]] ) set.seed(1234) rp = ripmmarcPop( pop, popmasks, patchRadius=3, meanCenter = TRUE, patchSamples=1000 ) set.seed(1234) rp2 = ripmmarcPop( pop, popmasks, patchRadius=3, meanCenter = TRUE, patchSamples=1000 ) testthat::expect_equal(rp, rp2) rp3 = ripmmarcPop( pop, popmasks, patchRadius=3, meanCenter = TRUE, patchSamples=1000, seed = 1234 ) testthat::expect_failure(testthat::expect_equal(rp, rp3))# NOT RUN { nv = 15 rippedTest <- ripmmarc( pop[[3]], popmasks[[3]], patchRadius = 3, evecBasis = rp$basisMat[1:nv,], patchVarEx = nv, meanCenter = TRUE, canonicalFrame = rp$canonicalFrame, regressProjections = TRUE ) mm = makeImage( popmasks[[3]], rippedTest$evecCoeffs[,1] ) # }