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

Merge branch 'log_seg' of git-bioimage.coe.drexel.edu:bioimage/leverjs into log_seg

parents c2546bf7 7bdcce29
No related branches found
No related tags found
No related merge requests found
......@@ -12,12 +12,13 @@ eraseAll=ljsPath('eraseAll.js');
if isempty(eraseAll)
ctcEraseAll(strTarget);
else
system(['node ' eraseAll ' ' strTarget]);
system(['/home/ac/.nvm/versions/node/v16.13.0/bin/node ' eraseAll ' ' strTarget]);
end
[conn,CONSTANTS]=openDB(strTarget);
if exist('segParams','var') && ~isempty(segParams)
Write.setSegParams(conn,segParams);
end
% set source image dir
[cx,bFound] = Read.findImageFolder(conn,CONSTANTS);
if ~bFound
......
......@@ -17,10 +17,10 @@ if length(rawFolder) > EMPTY_STRLEN
if exist(rawFolder,'dir')
MicroscopeData.Original.ConvertDir('h5',rawFolder,leverFolder);
elseif exist(rawFolder,'file')
[imDir,imName,ext]=fileparts(rawFolder);
[imDir,imName,ext]=fileparts(rawFolder);importAgneOri
MicroscopeData.Original.ConvertData(imDir,[imName ext],leverFolder,'h5');
end
importAgneOri
Import.convertTif(rawFolder,leverFolder);
end
......@@ -74,6 +74,7 @@ for ff=1:length(flist)
rc=system(['/usr/local/bin/node ' j2lPath ' "' jsname '"']);
else
nodePath=Helpers.linuxFindNode();
nodePath = '/home/ac/.nvm/versions/node/v16.13.0/bin/node'
rc=system([nodePath ' ' j2lPath ' "' jsname '"']);
end
end
......
......@@ -5,7 +5,9 @@ function clipLimits = getClipLimits(flist,targetChannelNumbers,clipRange,nKeep)
if ~exist('clipRange','var')
clipRange= [2.5,97.5];
end
if ~exist('nKeep','var')
nKeep = 0;
end
p = ljsStartParallel();
kymoPixels = {};
parfor ff=1:length(flist)
......@@ -36,4 +38,6 @@ for c = 1:size(kymoPixels,2)
end
clipLimits(c,find(clipRange==0)) = 0;
end
4;
\ No newline at end of file
......@@ -8,14 +8,24 @@ function d=go_ssf_ncd(kROOT,targetChannels,clipRange, nKeep)
tStart = tic();
if ~exist('nKeep','var')
nKeep = 0;
end
if ~exist('clipRange','var')
clipRange = [2.5,97.5];
end
flist = dir(fullfile(kROOT,'*.LEVER'));
d = zeros(length(flist));
kymoPixels = {};
p = ljsStartParallel();
%
if iscell(clipRange)
clipLimits = clipRange;
else
clipLimits = SSF.getClipLimits(flist,targetChannels,clipRange,nKeep);
end
%
cmdList = NCD.dParallelCommandList(ones(length(flist)),p.NumWorkers);
W = size(cmdList,2); % for slicing j in parfor
......@@ -34,8 +44,13 @@ parfor i=1:H
end
strDB_ff = fullfile(flist(ff).folder, flist(ff).name);
if ~strcmp(strDB_ff,str_ff_prev)
im_ff = SSF.loadImage(strDB_ff, targetChannels, clipRange, nKeep);
im_ff = SSF.quantize8(im_ff,clipLimits);
im_ff = SSF.loadImage(strDB_ff, targetChannels, nKeep);
if iscell(clipLimits)
cx = clipLimits{ff};
else
cx = clipLimits;
end
im_ff = SSF.quantize8(im_ff,cx);
str_ff_prev = strDB_ff;
end
......@@ -44,8 +59,13 @@ parfor i=1:H
dxx(i,j) = d1;
else
strDB_gg = fullfile(flist(gg).folder,flist(gg).name);
im_gg = SSF.loadImage(strDB_gg,targetChannels, clipRange, nKeep);
im_gg = SSF.quantize8(im_gg,clipLimits);
im_gg = SSF.loadImage(strDB_gg,targetChannels, nKeep);
if iscell(clipLimits)
cx = clipLimits{gg};
else
cx = clipLimits;
end
im_gg = SSF.quantize8(im_gg,cx);
d1 = SSF.ncd_ssf_volume(im_ff,im_gg);
d2 = SSF.ncd_ssf_volume(im_gg,im_ff);
......
function im = loadImage(strDB, channelList, clipRange, nKeep)
function im = loadImage(strDB, channelList, nKeep)
if ~exist('bDouble','var')
bDouble = false;
......@@ -9,11 +9,9 @@ time = 1; % kymo is single time point
for c=1:length(channelList)
im(:,:,:,c) = leversc.loadImage(strDB,time,channelList(c));
end
% HACK ACK HACK
im = im(:,:,:,:);
if ~exist('clipRange','var')
return;
if ~exist('nKeep','var')
return
end
if nKeep > 0
im(im<0) = 0;
......
......@@ -27,6 +27,7 @@ if 0== sensitivity
% distribution?
epsThresh = 0.05;
else
% epsThresh = 5e-3;
epsThresh = 1e-3;
end
bwn = logical(imn>epsThresh);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment