image thumbnail

Image Section Generator

by

 

21 May 2009 (Updated )

Image Section Generator grabs cursor-designated linescans from microscope images

get_image_depth(imagearray)
%--------------------------------------------------------------------%
%	    Alison Chaiken, sole author and maintainer     			     %
%        ------------------------------------------------------      %
%	    GUI-based Matlab and FEMLAB data analysis, instrument	     %
%	    control, statistical analysis, finite-element modelling,     %
%	    image acquisition and analysis          				     %
%       -------------------------------------------------------      %
%	    alchaiken@gmail.com			                    		     %
%	    http://www.exerciseforthereader.org/         			     %
%	    (001)650-279-5600					                         %
%--------------------------------------------------------------------%

function depth = get_image_depth(imagearray)
% Extract size in bits of color specification from string used to describe
% image format.

switch (class(imagearray))
    case 'uint8'
        depth=8;
    case 'uint16'
        depth=16;
    case 'uint32'
        depth=32;
    case 'uint64'
        depth=64;
    otherwise
        error('Unknown data type.')
end

Contact us