Home > NoiseTools > nt_growmask.m

# nt_growmask

## PURPOSE

ww=nt_growmask(w,margin) - widen mask

## SYNOPSIS

function w=nt_growmask(w,margin)

## DESCRIPTION

    ww=nt_growmask(w,margin) - widen mask

      ww: widened mask (samples * 1 or samples * 1 * trials)

      w: mask
      margin: samples, number of samples by which to widen the mask

     NoiseTools

## CROSS-REFERENCE INFORMATION

This function calls:

- nt_fold y=fold(x,epochsize) - fold 2D to 3D
- nt_unfold y=nt_fold(x) - unfold 3D to 2D

This function is called by:

- nt_star2 [y,w,ww]=nt_star2(x,thresh,closest,w) - sensor noise suppression

## SOURCE CODE

    0001 function w=nt_growmask(w,margin)
    0002 %ww=nt_growmask(w,margin) - widen mask
    0003 %
    0004 %  ww: widened mask (samples * 1 or samples * 1 * trials)
    0005 %
    0006 %  w: mask
    0007 %  margin: samples, number of samples by which to widen the mask
    0008 %
    0009 % NoiseTools
    0010
    0011 [m,n,o]=size(w);
    0012 w=(w~=0);
    0013 w=nt_unfold(w);
    0014 w=filter(ones(margin+1,1),1,w)>0;
    0015 w=flipud(filter(ones(margin+1,1),1,flipud(w))>0);
    0016 w=(w~=0);
    0017 w=nt_fold(w,m);