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/andor/andor_nrframes.m
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
25 lines (19 sloc)
862 Bytes
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
function nrframes = andor_nrframes(absfilepath, varargin) | |
%function nrframes = andor_nrframes(filename, varargin) | |
%get number of frames in sif file | |
%adapted from sifreadexample | |
%Written by Marcel | |
params.signal = 0; | |
params = omex_read_params(params, varargin); | |
rc=atsif_setfileaccessmode(1); %sets up the sif library to set the access property to load the entire file | |
rc=atsif_readfromfile(absfilepath); % attempt to open the file | |
if (rc == 22002) % check that the file was successfully opened | |
signal=0; | |
[rc,present]=atsif_isdatasourcepresent(signal); % check there is a signal present | |
if present | |
[rc,nrframes]=atsif_getnumberframes(signal); % query the number of frames contained in the file (e.g. in the instance of a kinetic series there may be more than 1 | |
end | |
else | |
error('Could not find or load file. ERROR - '); | |
%disp(rc); | |
end |