Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loadobj for TIFFStack #5

Merged
merged 1 commit into from
Jan 20, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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