[filename, pathname] = uigetfile({'*.vid','BU lossless (zlib compressed) VID file'},'Choose a VID format video file');

vid_file = [pathname, filename];

[out_vid_handle, out_vid_info] = vidOpenMex(vid_file);

view_frames = [0:10:out_vid_info(3)-1];

figure( 1000 ); clf; axes_handle = axes('position',[0,0,1,0.94]);

for framei = view_frames;

    vid_frame = vidReadMex(out_vid_handle, framei);
    
	if ispc; axes(axes_handle); end

	if size(vid_frame, 1) < 800;
		imshow( uint8(vid_frame), 'InitialMagnification', 100 );
	else
		imshow(uint8(imresize(vid_frame, 0.5, 'bilinear')));
	end

	title(sprintf('%5d of %5d', framei, out_vid_info(3)));
	pause(0.01);
end

vidCloseMex(out_vid_handle);
