Lightweight Matlas class which wraps multichannel ImageStacks
Image data tensor is X by Y by channels by frames.
.data % stores underlying data
.name % descriptive string
.frameRate % used for tvec, play, and saveVideo
.imageSize - [nX nY]
.nChannels
.nFrames
s = ImageStack.fromAllInDirectory(dir, ...)
s = ImageStack.fromTif(file, ...)
s(maskX, maskY, channels, frames) % same as s.data(...)
s{frame} % grab single frame as matrix
s = s.getFrames(select) % same as s.data(:, :, :, select);
[meanVsTime, tvec] = s.vsTime() % mean over time, precede with s.crop
s = s.frames(select) % get ImageStack with selected frames
s = s.everyNthFrame(skip) % get 1:skip:end frames
s = s.channels(select) % get ImageStack with selected frames
s = s.crop(selectX, selectY) % get ImageStack with selected image region
s.minProj
s.maxProj
s.meanProj
s.globalMin
s.globalMax
s.globalMinMax % [min max]
Many stats functions are supported directly and act on s.data
min(s, ...)
max(s, ...)
nanmin(s, ...)
nanmax(s, ...)
mean(s, ...)
nanmean(s, ...)
var(s, ...)
nanvar(s, ...)
Standard arithmetic operators are overloaded to apply to s.data and are automatically passed through bsxfun, e.g.
dfoverf = s ./ mean(s, 4);
change = s - s{1};
sAlign = alignToReferenceTranslation(s, reference)
sAlign = alignToMeanTranslation(s) % shifts each image to align with s.meanProj
sNorm = normalize(s) % normalizes all values to [0 1] range
s.show % imagesc on first frame
s.play % implay on s.data
s.imcat % output to iTerm2 terminal as an image
s.montage(...) % montage on s.data
load mri
s = ImageStack(D);
s.everyNthFrame(2).frames(1:12).normalize.montage();
colormap gray;