diff --git a/src/MATLAB/+NCD/ncd_ssf_volume.m b/src/MATLAB/+NCD/ncd_ssf_volume.m index cfcfab3164b36220c0293e7bd7d261ed429ceb7d..939d13a2cf64f9db61187f2a5e282d85c89d5e2d 100644 --- a/src/MATLAB/+NCD/ncd_ssf_volume.m +++ b/src/MATLAB/+NCD/ncd_ssf_volume.m @@ -1,6 +1,7 @@ -% i1 and i2 are signal kymos (x,y,t,c)outdir -% we want images {t}(x,y,c) -% package to cell array by t and then pass to in memory FLI%F compressor +% i1 and i2 are each 3.3D images, e.g. (x,y,z) or (x,y,t), etc. +% package to cell array by z or t and then pass to in memory FLIF compressor +% if images are not uint8, they will be quantized to uint8 (FLIF does not +% like floats) function ncd = ncd_ssf_volume(i1,i2) [i1,i2] = NCD.quantizePair(i1,i2); diff --git a/src/MATLAB/+NCD/quantizePair.m b/src/MATLAB/+NCD/quantizePair.m index 4233c1ce5030da64f5316d458bd0b05caa403f4e..527353a067505b91dbc619afd2bdce26dbe94a98 100644 --- a/src/MATLAB/+NCD/quantizePair.m +++ b/src/MATLAB/+NCD/quantizePair.m @@ -1,11 +1,19 @@ % clip image pairs and quantize, per channel (x,y,z,c) +% best practice -- quantize all embedded data jointly +% if images already quantized (uint8), just return them +% otherwise quantize image pair function [i1q,i2q] = quantizePair(i1,i2,clipLimits) + if isa(i1,'uint8') && isa(i2,'uint8') + i1q = i1; + i2q = i2; return end + if ~exist('clipLimits','var') clipLimits = [0,100]; end + if size(i1,4) ~= size(i2,4) fprintf(2,'WARNING : quantizePair : input images of different color channel dimension\n'); end