% cat_xy.m
% prep the cat data so that it is in [x,y,d] order not [y,x,d] order
% Jeff Fessler, 2017-09-28

load cat % contains I L M
data = permute(I, [2 1 3]); % y,x -> x,y
% L = L([2 1 3],:); % not needed, interestingly
L(2,:) = -L(2,:); % trick to avoid -DY fuss in notebook
M = M'; % y,x -> x,y
data = single(data); % adequate!
readme = 'Data is in [x,y,lighting] order'
% I = data; save cat_xy
if 1
	fp = fopen('cat_xy_data.float32', 'w')
	fwrite(fp, data, 'float32')
	fclose(fp)

	fp = fopen('cat_xy_mask.uint8', 'w')
	fwrite(fp, uint8(M), 'uint8')
	fclose(fp)

	fp = fopen('cat_xy_L.float32', 'w')
	fwrite(fp, single(L), 'float32')
	fclose(fp)

%	op fld 430 550 12
end
