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

ssf kymo reference

parent 6eaaa77c
Branches
No related tags found
No related merge requests found
......@@ -28,7 +28,8 @@ if ~exist(outfolder,'dir')
end
imd={};
p = ljsStartParallel(16);
nGPU = HIP.Cuda.DeviceCount();
p = ljsStartParallel(8*nGPU);
parfor ff=1:L
% for ff=1:L
......@@ -42,7 +43,9 @@ parfor ff=1:L
if isempty(imVolume)
continue
end
% imVolume(:,:,:,length(targetChannelNumbers)+1) = SSF.velocity_kymo(str_ff);
if contains(targetChannelNames{end},'velocity ssf','IgnoreCase',true)
imVolume(:,:,:,length(targetChannelNumbers)+1) = SSF.velocity_kymo(str_ff,bDownscale);
end
imVolume = imVolume(:,:,startFrame:end,:); % trim off first 30 frames
imd{ff}=MicroscopeData.MakeMetadataFromImage(imVolume);
imd{ff}.DatasetName=[flist(ff).name '_ssf_cache'];
......
......@@ -12,8 +12,8 @@ flist = dir(fullfile(kROOT,'*.LEVER'));
d = zeros(length(flist));
kymoPixels = {};
p = ljsStartParallel(32);
p = ljsStartParallel();
%
parfor ff=1:length(flist)
strDB_ff = fullfile(flist(ff).folder,flist(ff).name);
im_ff = SSF.loadImage(strDB_ff,targetChannels);
......@@ -21,8 +21,9 @@ parfor ff=1:length(flist)
kymoPixels{ff} = kp;
end
kymoPixels = vertcat(kymoPixels{:});
erkClipLimits = [prctile(kymoPixels,2.5),prctile(kymoPixels,97.5)]
% erkClipLimits = [0,prctile(kymoPixels,99)];
% erkClipLimits = [prctile(kymoPixels,2.5),prctile(kymoPixels,97.5)]
erkClipLimits = [0,prctile(kymoPixels,99)];
% erkClipLimits = [-1,1];
%
cmdList = NCD.dParallelCommandList(ones(length(flist)),p.NumWorkers);
......
......@@ -5,7 +5,7 @@ im = Segment.denoise(im,segParams,false);
im = double(im)./2^16;
% scale refMax by actual image statistics. median estimates background,
% 99.99% represents max foreground intensity.
refMax = refMax * ( prctile(im(:),99.99) - median(im(:)));
%refMax * ( prctile(im(:),99.99) - median(im(:)));
[imLoG, imp, imn] = LoG.getCompositeLoG(im,CONSTANTS,segParams);
......
function im_v_kymo = velocity_kymo(strDB)
function im_v_kymo = velocity_kymo(strDB,bDownscale)
[conn,CONSTANTS,segParams]=openDB(strDB);
szIm = Helpers.volumeSize(CONSTANTS);
% kymo is (x,y,t)
if bDownscale
szIm(1:2) = round(szIm(1:2) ./ 2);
end
im_v_kymo = zeros([szIm(2),szIm(1),szIm(5)]);
for time = 1:CONSTANTS.imageData.NumberOfFrames
......@@ -27,7 +30,11 @@ for time = 1:CONSTANTS.imageData.NumberOfFrames
v = (vsrc+vdst)/2.0; % average in velocity and out velocity
maxRadius = max([q.maxRadius(i),q.dst_maxRadius(i),q.src_maxRadius(i)]);
v = v / (3*maxRadius); % 3*maxRadius is the velocity gate
if bDownscale
cx = cx ./2;
end
cx = round(cx);
im_v_kymo(cx(2),cx(1),time) = v;
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment