diff --git a/TIFFStack.m b/TIFFStack.m index 6fc666a..6f4bd02 100755 --- a/TIFFStack.m +++ b/TIFFStack.m @@ -144,6 +144,7 @@ end properties (SetAccess = private, GetAccess = private) + bForceTiffread % - forcing tiffread, rather than libTiff vnDataSize; % - Cached size of the TIFF stack vnApparentSize; % - Apparent size of the TIFF stack TIF; % \_ Cached header info for tiffread29 speedups @@ -151,7 +152,7 @@ bUseTiffLib; % - Flag indicating whether TiffLib is being used fhReadFun; % - When using Tiff class, function for reading data fhSetDirFun; % - When using Tiff class, function for setting the directory - vnDimensionOrder; % - Internal dimensions order to support permution + vnDimensionOrder; % - Internal dimensions order to support permutation fhRepSum; % - Function handle to (hopefully) accellerated repsum function fhCastFun; % - The matlab function that casts data to the required return class end @@ -170,6 +171,7 @@ if (~exist('bForceTiffread', 'var') || isempty(bForceTiffread)) bForceTiffread = false; end + oStack.bForceTiffread = bForceTiffread; % - Can we use the accelerated TIFF library? if (exist('tifflib') ~= 3) %#ok @@ -727,7 +729,21 @@ function diagnostic(oStack) oStack.bInvert = bInvert; end end - + + end + + methods (Static) + % Overloaded loadobj + function oStack = loadobj(sSavedVar) + % Create a new TIFFStack + oStack = TIFFStack(sSavedVar.strFilename, sSavedVar.bInvert, [], ... + sSavedVar.bForceTiffread); + + % Adjust dimensions to look like saved stack + oStack.vnApparentSize = sSavedVar.vnApparentSize; + oStack.vnDimensionOrder = sSavedVar.vnDimensionOrder; + end + end end