This repository has been archived by the owner. It is now read-only.
Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
ImageIO/utils/lsmClasses/@LSMImageDirectory/LSMImageDirectory.m
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
40 lines (34 sloc)
1.25 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
classdef LSMImageDirectory | |
%LSMIMAGEDIRECTORY Implementation of Image Directories for LSM data | |
% The class represents the information stored in the Image Directory schema, | |
% according to the LSM File Format specification | |
% | |
% AUTHOR: Stefano Masneri | |
% Date: 13.3.2017 | |
properties | |
numDirectories; % number of directory entries | |
dirEntryArray; % array of directory entries | |
offsetNextImageDir; % offset to the next image directory | |
end | |
methods | |
function obj = LSMImageDirectory() | |
%LSMIMAGEDIRECTORY Constructor | |
%does nothing | |
end | |
function obj = init(obj, lsmPtr, byteOrder) | |
%INIT Initializes the LSMImageDirectory object | |
%INPUT | |
% lsmPtr: file identifier of the lsm file. It is assumed that the | |
% position in the file is at the start at the Image Directory | |
% field | |
% OUTPUT | |
% obj: the instance of the class | |
obj.numDirectories = fread(lsmPtr, 1, 'uint16', byteOrder); | |
obj.dirEntryArray = repmat(LSMDirectoryEntry(), 1, obj.numDirectories); | |
for k = 1:obj.numDirectories | |
obj.dirEntryArray(k) = obj.dirEntryArray(k).init(lsmPtr, byteOrder); | |
end | |
obj.offsetNextImageDir = fread(lsmPtr, 1, 'uint32', byteOrder); | |
end | |
end | |
end | |