function msfwindows = msfize(data,meanSubtract)

[r,c] = size(data);
msfwindows = cell(r,c);
for ri = 1:r
  for ci = 1:c
    windows = data{ri,ci};
    nwin = length(windows);
    msfwindowsTrial = cell(1,nwin);
    for w = 1:nwin
      if meanSubtract
	windows{w} = windows{w} - ...
	    repmat(mean(windows{w},2),1,size(windows{w},2));
      end
      [u,s] = mnf2(windows{w});
      u = s';
      for col = 1:size(u,2)
	if u(1,col) < 0
	  u(:,col) = u(:,col) * -1;
	end
      end
      msfwindowsTrial{w} = u;
    end
    msfwindows{ri,ci} = msfwindowsTrial;
  end
end

