Skip to content
Snippets Groups Projects
Commit 79dd2d5e authored by ac_fx's avatar ac_fx
Browse files

getcliplimits imquantize

parent 2b7ad96d
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,7 @@ parfor ff = 1:length(flist)
end
res.Properties.VariableNames = {'idx','class','d'};
res.class=cellfun(@upper,res.class,'UniformOutput',false);
figure;
boxplot(res.d,res.class,'notch','on');
ylabel('NCD( Akt_{SSF}, Velocity_{SSF} )','FontSize',12)
xlabel('experimental condition','FontSize',12)
......
......@@ -34,14 +34,18 @@ for c = 1:size(kymoPixels,2)
kp = kp{:};
% clipLimits{c} = quantile(kp,1/255:1/255:1-1/255);
% clipLimits{c} = prctile(kp,linspace(0,100,254));
if all(kp>0) || all(kp<0)
cx = SSF.getClipQuantiles(kp,254);
else
clip_neg = SSF.getClipQuantiles(kp(kp<0),127);
clip_pos = SSF.getClipQuantiles(kp(kp>0),127);
cx = [clip_neg,clip_pos];
end
% if all(kp>0) || all(kp<0)
% cx = SSF.getClipQuantiles(kp,254);
% else
% clip_neg = SSF.getClipQuantiles(kp(kp<0),127);
% clip_pos = SSF.getClipQuantiles(kp(kp>0),127);
% cx = [clip_neg,clip_pos];
% end
clipLimits{c} = cx;
end
clipLimits = repmat(clipLimits,length(flist),1);
4;
......@@ -3,11 +3,18 @@ function clipLimits = getClipQuantiles(voxels,nQuant)
mx = mean(voxels);
sx = std(voxels);
cl = [mx-sx, mx+sx];
if all(voxels<0)
cl(2) = max(voxels);
end
if all(voxels>0)
cl(1) = min(voxels);
end
% if all(voxels<0)
% cl(2) = max(voxels);
% end
% if all(voxels>0)
% cl(1) = min(voxels);
% end
% linear quantization
clipLimits = linspace(cl(1),cl(2),nQuant);
% % equiprobable quantization
% ep1 = length(find(voxels<=cl(1)))./length(voxels);
% ep2 = 1-length(find(voxels>cl(2)))./length(voxels);
% clipLimits = quantile(voxels,linspace(ep1,ep2,nQuant));
4;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment