substituteWaveletCoef substitutes the wavelet coefficients stored wavelet object generated through 2D wavelet transform with user-given values and returns the modified wavelet object.

substituteWaveletCoef(grid, waveletobj, values)

Arguments

grid

The number of voxels in one row (or, one column) of the brain slice of interest. Must be a power of 2. The total number of voxels is grid^2. The maximum value of grid for this package is 512.

waveletobj

A wavelet object of class imwd.object, usually obtained by performing 2D wavelet transformion through the function imwd of package wavethresh.

values

The values with which the wavelet coefficients are to be replaced. The order should be consistent with imwd.object class.

Value

A wavelet object of class imwd.object with updated wavelet coefficients.

Details

The maximum value of grid for this package is 512.

Author

Nilotpal Sanyal, Marco Ferreira

Maintainer: Nilotpal Sanyal <nilotpal.sanyal@gmail.com>

See also

Examples

set.seed(1)
n <- 3
grid <- 8
ntime <- 10
designmat <- cbind( rep(1,10), c(rep(c(1,0),5)) )
data <- array(dim=c(n,grid,grid,ntime),
  rnorm(n*grid*grid*ntime))
glm.fit <- glmcoef(n, grid, data, designmat)
#> Error in glmcoef_sub(grid, data[i, , , ], designmat): object '_BHMSMAfMRI_glmcoef_sub' not found
glmcoefstd <- glm.fit$GLMCoefStandardized[,,,1]
#> Error in glm.fit$GLMCoefStandardized: object of type 'closure' is not subsettable
dwt = wavethresh::imwd(glmcoefstd[1,,],type="wavelet",
  family="DaubLeAsymm",filter.number=6,bc="periodic")
#> Error in eval(expr, envir, enclos): object 'glmcoefstd' not found
dwt
#> Error in eval(expr, envir, enclos): object 'dwt' not found

values = rnorm(grid^2-1)
dwtnew = substituteWaveletCoef(grid,dwt,values)
#> Error in eval(expr, envir, enclos): object 'dwt' not found
dwtnew
#> Error in eval(expr, envir, enclos): object 'dwtnew' not found