Skip to content
Snippets Groups Projects
Commit 61ed9f19 authored by ac (tb)'s avatar ac (tb)
Browse files
parents 60323d1b ca3d73af
No related branches found
No related tags found
No related merge requests found
% eval all the datasets in the release folder
ROOT='/f/leverjs/ctc2020rc'
ROOT='/g/leverjs/ctc2021a/3d'
flist=dir(fullfile(ROOT,'**/*training*.LEVER'));
results=[];
for ff=1:length(flist)
......@@ -18,4 +18,4 @@ for ff=1:length(flist)
res.Properties.VariableNames{2}='strDB';
results=[results;res]
end
writetable(results,'/f/leverjs/ctc2020rc/results.txt')
\ No newline at end of file
writetable(results,'/g/leverjs/ctc2021a/3d/results.txt')
\ No newline at end of file
root = 'F:\leverjs\ctc\huh7\refined';
gtPath = '\\BIOIMAGE20\G\gRaw\ctc2020';
root = '/g/leverjs/ctc2021a/huh7/refined/diModified';
gtPath = '/g/gRaw/ctc2020';
flist = dir(fullfile(root,'*.LEVER'));
results = [];
for ff = 1:length(flist)
strDB = fullfile(flist(ff).folder,flist(ff).name);
Dilation.huh7Refine(strDB);
huh7Refine(strDB);
end
flist = dir(fullfile(root,'*training*.LEVER'));
......
......@@ -12,7 +12,6 @@ for i = 1:CONSTANTS.imageData.NumberOfFrames
im = DenoiseCache.readImages(i,CONSTANTS,segParams,[]);
di = dilationThreshold(im);
imx=mat2gray(0*im);
for j=1:length(cx)
......@@ -20,6 +19,8 @@ for i = 1:CONSTANTS.imageData.NumberOfFrames
imx(dx(2),dx(1)) = j;
end
di = logical(imreconstruct(imx,mat2gray(di)));
[~,idxd]=bwdist(imx);
rp = regionprops((imx(idxd).*di),im, 'PixelList');
......@@ -28,15 +29,32 @@ for i = 1:CONSTANTS.imageData.NumberOfFrames
if isempty(rp(j).PixelList)
continue
end
cx(j).pts = rp(j).PixelList;
idxPixels = sub2ind(imSize,cx(j).pts(:,2),cx(j).pts(:,1));
[r,c] = ind2sub(imSize,idxPixels);
idxPixels = sub2ind(imSize,rp(j).PixelList(:,2),rp(j).PixelList(:,1));
bw = logical(zeros(imSize));
bw(idxPixels) = 1;
bounds = bwboundaries(bw);
% keep only the connected components with the centroid
bw2 = logical(0*bw);
centroid = round(cx(j).centroid);
% todo - make sure 1 <= centroid<imSize
bw2(centroid(2),centroid(1)) = 1;
bw2 = imreconstruct(bw2,bw);
idxPixels = find(bw2);
[r,c] = find(bw2);
bounds = bwboundaries(bw2);
% use r,c idxPixels to build new cell struct
if isempty(bounds)
continue
end
cx(j).pts = [c,r];
cx(j).idxPixels = idxPixels;
cx(j).surface = [bounds{1}(:,2),bounds{1}(:,1)];
cx(j).centroid = [mean([c,r]) 0];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment