Skip to content
Snippets Groups Projects
Commit e7cbc2db authored by ac's avatar ac
Browse files

dark tubes with bright plate

parent d0cbfa54
Branches
No related tags found
No related merge requests found
function imfm = darkTubes(im,CONSTANTS,thickness)
function imOut = darkTubes(im,CONSTANTS,thicknessIn)
thickness = abs(thicknessIn);
voxelSize = CONSTANTS.imageData.PixelPhysicalSize;
voxelSize([1,2]) = voxelSize([2,1]); % swap (x,y,z) to matlab column major (y,x,z)
vx = max(voxelSize)./voxelSize;
......@@ -8,13 +9,26 @@ sigma = 1/sqrt(3) * (thickness ./ 2) * vx;
cudaTarget = getCudaTarget;
imf = HIP.LoG(im,sigma,cudaTarget);
if thicknessIn < 0
% bright plate
imn = imf;
imn(imn>0)=0;
imn=abs(imn);
sigmaPlate = [5,1,1].*sigma;
imfPlate = HIP.LoG(imn,sigmaPlate,cudaTarget);
imnPlate = imfPlate;
imnPlate(imnPlate>0) = 0;
imnPlate = abs(imnPlate);
imnPlate = imnPlate .* imregionalmax(imnPlate);
imOut = imnPlate;
else
% dark blob
imp=imf;imp(imp<0)=0;
imfm = fibermetric(imp);
imfm = imfm .* imregionalmax(imfm);
% imfm = RSF.clipRSF(imfm);
imOut = imfm;
end
4;
......
......@@ -37,8 +37,17 @@ imfmX = imfm.*imregionalmax(imfm);
% imp = imp .* imregionalmax(imp,6);
% imn = imn .* imregionalmax(imn,6);
sliceThickness = 100;
for Z = sliceThickness: 1 :size(im,1)-sliceThickness
% bright plate
sigmaPlate = [5,1,1].*sigma;
imfPlate = HIP.LoG(imn,sigmaPlate,cudaTarget);
imnPlate = imfPlate;
imnPlate(imnPlate>0) = 0;
imnPlate = abs(imnPlate);
imnPlateX = imnPlate.*imregionalmax(imnPlate,6);
sliceThickness = 10;
bClear = true;
for Z = 100: 1 :size(im,1)-100
clipLimits=[];
clipLimits.dim = 1;
......@@ -50,13 +59,15 @@ for Z = sliceThickness: 1 :size(im,1)-sliceThickness
im2 = getClipFrame(imn,clipLimits);
im3 = getClipFrame(imp,clipLimits);
im4 = getClipFrame(imfm,clipLimits);
im5 = getClipFrame(imfmn,clipLimits);
im6 = getClipFrame(imraw,clipLimits,gray());
im7 = getClipFrame(imfmX,clipLimits);
imOut = [ im1,im2, im7 ; im6, im3, im4 ];
if sliceThickness == Z
im8 = getClipFrame(mat2gray(imnPlate),clipLimits);
imOut = [ im6,im2, im8 ; im3, im4, im7 ];
clf;imagesc(imOut);drawnow
title(num2str(Z))
if bClear
imwrite(imOut,outfile);
bClear = false;
else
imwrite(imOut,outfile,'writemode','append');
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment