Skip to content
Snippets Groups Projects
Commit 546457fe authored by ac_fx's avatar ac_fx
Browse files

SSF clip quantiles

parent 74c97f24
No related branches found
No related tags found
No related merge requests found
......@@ -29,10 +29,9 @@ parfor ff=1:length(flist)
end
kymoPixels = vertcat(kymoPixels{:});
cl = [mean(kymoPixels)-std(kymoPixels), mean(kymoPixels)+std(kymoPixels)];
q1 = length(find(kymoPixels<cl(1)))./length(kymoPixels);
q2 = 1 - length(find(kymoPixels>cl(2)))./length(kymoPixels);
pxTarget = linspace(q1,q2,254);
clipLimits = quantile(kymoPixels,pxTarget);
clip_neg = SSF.getClipQuantiles(kymoPixels(kymoPixels<0),127);
clip_pos = SSF.getClipQuantiles(kymoPixels(kymoPixels>0),127);
clipLimits = [clip_neg,clip_pos];
clipLimits = repmat({clipLimits},length(flist),1);
4;
function clipLimits = getClipQuantiles(voxels,nQuant)
%
% mx = mean(voxels);
% sx = std(voxels);
% cl = [mx-sx, mx+sx];
% q1 = length(find(voxels<cl(1)))./length(voxels);
% q2 = 1 - length(find(voxels>cl(2)))./length(voxels);
% pxTarget = linspace(q1,q2,nQuant);
% clipLimits = quantile(voxels,pxTarget);
pxTarget = linspace(2.5,97.5,nQuant);
clipLimits = prctile(voxels,pxTarget);
......@@ -24,7 +24,7 @@ kymoPixels = {};
p = ljsStartParallel();
%
if ~exist('clipLimits','var')
if ~exist('clipLimits','var') || isempty(clipLimits)
clipLimits = SSF.getClipLimits(flist,targetChannels,nKeep,tClip);
end
%
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment