Skip to content

Commit

Permalink
Add loadobj method, useable with default saveobj
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxime RIO committed Jan 15, 2016
1 parent 9e73c53 commit 0e3df90
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions TIFFStack.m
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,15 @@
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
HEADER; % /
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
Expand All @@ -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<EXIST>
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 0e3df90

Please sign in to comment.