Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RSF
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenSource
RSF
Commits
9d4ae29d
Commit
9d4ae29d
authored
2 weeks ago
by
ac
Browse files
Options
Downloads
Patches
Plain Diff
darkTubes moved into imPreprocess
parent
7627e448
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/MATLAB/+RSF/getImf.m
+1
-6
1 addition, 6 deletions
src/MATLAB/+RSF/getImf.m
src/MATLAB/+RSF/imPreProcess.m
+30
-8
30 additions, 8 deletions
src/MATLAB/+RSF/imPreProcess.m
src/MATLAB/clusterExamples/goVideoDarkTubes.m
+25
-19
25 additions, 19 deletions
src/MATLAB/clusterExamples/goVideoDarkTubes.m
with
56 additions
and
33 deletions
src/MATLAB/+RSF/getImf.m
+
1
−
6
View file @
9d4ae29d
...
@@ -29,17 +29,12 @@ while startTarget <= size(pData,1)
...
@@ -29,17 +29,12 @@ while startTarget <= size(pData,1)
for
c
=
1
:
length
(
radii
)
for
c
=
1
:
length
(
radii
)
if
all
(
0
==
radii
{
c
})
if
all
(
0
==
radii
{
c
})
im1
(:,:,:,
c
)
=
zeros
(
size
(
im
));
im1
(:,:,:,
c
)
=
zeros
(
size
(
im
));
else
if
length
(
radii
{
c
})
==
1
% hardcode for darktubes...careful...ACK
im1
(:,:,:,
c
)
=
RSF
.
darkTubes
(
im
,
CONSTANTS
,
radii
{
c
});
else
else
im1
(:,:,:,
c
)
=
RSF
.
imPreProcess
(
im
,
radii
{
c
});
im1
(:,:,:,
c
)
=
RSF
.
imPreProcess
(
im
,
radii
{
c
});
end
end
end
end
end
end
end
end
end
startTarget
=
startTarget
+
N_CUDA_PROCS
;
startTarget
=
startTarget
+
N_CUDA_PROCS
;
for
i
=
1
:
N_CUDA_PROCS
for
i
=
1
:
N_CUDA_PROCS
if
pp
{
i
}
<=
size
(
pData
,
1
)
if
pp
{
i
}
<=
size
(
pData
,
1
)
...
...
This diff is collapsed.
Click to expand it.
src/MATLAB/+RSF/imPreProcess.m
+
30
−
8
View file @
9d4ae29d
function
[
imf
,
bw
]
=
imPreProcess
(
im
,
radii
)
function
[
imf
]
=
imPreProcess
(
im
,
radii
)
% threshold mask
% threshold mask
if
isempty
(
radii
)
if
isempty
(
radii
)
...
@@ -10,16 +11,37 @@ if isempty(radii)
...
@@ -10,16 +11,37 @@ if isempty(radii)
return
return
end
end
im
=
uint8
(
im
);
% values are already uint8, just wrapped in a double
% previous dark tubes did a mat2gray on im???
% mat2gray? or im2double? TBD
im
=
im2double
(
uint8
(
im
));
% values are already uint8, just wrapped in a double
AX
=
1
/
sqrt
(
3
);
AX
=
1
/
sqrt
(
3
);
sx
=
AX
.*
radii
;
if
length
(
radii
)
==
1
radii
=
repmat
(
radii
,
1
,
3
);
bTubes
=
true
;
else
bTubes
=
false
;
end
sigma
=
AX
.*
radii
;
cudaTarget
=
getCudaTarget
();
imf
=
HIP
.
LoG
(
im
,
sigma
,
cudaTarget
);
[
~
,
imp
,
imn
]
=
RSF
.
LoG
(
im
,
radii
);
if
any
(
radii
<
0
)
imn
=
imn
.*
imregionalmax
(
imn
);
% bright !
imp
=
imp
.*
imregionalmax
(
imp
);
imf
(
imf
>
0
)
=
0
;
imf
=
abs
(
imf
);
else
% dark !
imf
(
imf
<
0
)
=
0
;
end
if
bTubes
imf
=
fibermetric
(
imf
);
end
imf
=
im
p
;
imf
=
im
f
.*
imregionalmax
(
imfm
)
;
im
f
(
imn
>=
imp
)
=
-
1
*
imn
(
imn
>=
imp
)
;
im
Out
=
imfm
;
4
;
4
;
...
...
This diff is collapsed.
Click to expand it.
src/MATLAB/clusterExamples/goVideoDarkTubes.m
+
25
−
19
View file @
9d4ae29d
path
(
path
,
fullfile
(
'../clusterExamples'
))
ROOT
=
'/g/leverjs/Schuman_OCT/OCT/qualifiedYes'
;
% ROOT = '/g/leverjs/Schuman_OCT/OCT/qualifiedYes';
PID
=
'P10010'
% PID = 'P10010'
thickness
=
5
% thickness = 5
flist
=
dir
(
fullfile
(
ROOT
,[
'/'
PID
'*.LEVER'
]));
% flist = dir(fullfile(ROOT,['/' PID '*.LEVER']));
mx
=
regexp
({
flist
.
name
},
'P(?<PID>\d+)_(?<scanType>.+)_(?<date>\d+-\d+-\d+)_(?<time>\d+-\d+-\d+)_(?<eye>\w\w)_(?<scanID>.+?)_.*.LEVER'
,
'names'
);
% mx = regexp({flist.name},'P(?<PID>\d+)_(?<scanType>.+)_(?<date>\d+-\d+-\d+)_(?<time>\d+-\d+-\d+)_(?<eye>\w\w)_(?<scanID>.+?)_.*.LEVER','names');
tblMeta
=
struct2table
(
vertcat
(
mx
{:}));
% tblMeta = struct2table(vertcat(mx{:}));
tblMeta
.
PID
=
str2double
(
tblMeta
.
PID
);
% tblMeta.PID = str2double(tblMeta.PID);
tblMeta
.
folder
=
{
flist
.
folder
}
'
;
% tblMeta.folder = {flist.folder}';
tblMeta
.
filename
=
{
flist
.
name
}
'
;
% tblMeta.filename = {flist.name}';
tblMeta
=
tblMeta
(
contains
(
tblMeta
.
scanType
,
'Optic'
),:);
% tblMeta = tblMeta(contains(tblMeta.scanType,'Optic'),:);
% iid = 1;
% fname = fullfile(tblMeta.folder{iid},tblMeta.filename{iid})
iid
=
1
;
ROOT
=
'/g/leverjs/Schuman_OCT/OCT/nonHumanPrimate'
;
fname
=
fullfile
(
tblMeta
.
folder
{
iid
},
tblMeta
.
filename
{
iid
})
fname
=
fullfile
(
ROOT
,
'31344_OS_V_5x5_0_0004257.LEVER'
);
[
im
,
CONSTANTS
]
=
leversc
.
loadImage
(
fname
,
1
,
1
);
[
imraw
,
~
]
=
leversc
.
loadImage
(
fname
,
1
,
2
);
% [im,CONSTANTS] = leversc.loadImage(fname,1,1);
im
=
mat2gray
(
im
);
% [imraw,~] = leversc.loadImage(fname,1,2);
% im = mat2gray(im);
voxelSize
=
CONSTANTS
.
imageData
.
PixelPhysicalSize
;
voxelSize
=
CONSTANTS
.
imageData
.
PixelPhysicalSize
;
voxelSize
([
1
,
2
])
=
voxelSize
([
2
,
1
]);
% swap (x,y,z) to matlab column major (y,x,z)
voxelSize
([
1
,
2
])
=
voxelSize
([
2
,
1
]);
% swap (x,y,z) to matlab column major (y,x,z)
vx
=
max
(
voxelSize
)
.
/
voxelSize
;
vx
=
max
(
voxelSize
)
.
/
voxelSize
;
...
@@ -29,7 +33,7 @@ imp=imf;imp(imp<0)=0;
...
@@ -29,7 +33,7 @@ imp=imf;imp(imp<0)=0;
imfm
=
fibermetric
((
imp
));
imfm
=
fibermetric
((
imp
));
% imfmn = fibermetric(imn);
% imfmn = fibermetric(imn);
% fig = figure('units','normalized','outerposition',[0 0 1 1])
% fig = figure('units','normalized','outerposition',[0 0 1 1])
outfile
=
'metricEmbeddings.tif'
;
outfile
=
'
nhp_
metricEmbeddings.tif'
;
% v = VideoWriter('metricEmbeddings.avi','Uncompressed AVI');
% v = VideoWriter('metricEmbeddings.avi','Uncompressed AVI');
% v.open();
% v.open();
%
%
...
@@ -43,11 +47,12 @@ imfPlate = HIP.LoG(imn,sigmaPlate,cudaTarget);
...
@@ -43,11 +47,12 @@ imfPlate = HIP.LoG(imn,sigmaPlate,cudaTarget);
imnPlate
=
imfPlate
;
imnPlate
=
imfPlate
;
imnPlate
(
imnPlate
>
0
)
=
0
;
imnPlate
(
imnPlate
>
0
)
=
0
;
imnPlate
=
abs
(
imnPlate
);
imnPlate
=
abs
(
imnPlate
);
imnPlate
=
mat2gray
(
imnPlate
);
% ACK not scaled yet !!
imnPlateX
=
imnPlate
.*
imregionalmax
(
imnPlate
,
6
);
imnPlateX
=
imnPlate
.*
imregionalmax
(
imnPlate
,
6
);
sliceThickness
=
10
;
sliceThickness
=
10
;
bClear
=
true
;
bClear
=
true
;
for
Z
=
100
:
1
:
size
(
im
,
1
)
-
100
for
Z
=
401
:
1
:
size
(
im
,
1
)
-
100
clipLimits
=
[];
clipLimits
=
[];
clipLimits
.
dim
=
1
;
clipLimits
.
dim
=
1
;
...
@@ -61,8 +66,9 @@ for Z = 100: 1 :size(im,1)-100
...
@@ -61,8 +66,9 @@ for Z = 100: 1 :size(im,1)-100
im4
=
getClipFrame
(
imfm
,
clipLimits
);
im4
=
getClipFrame
(
imfm
,
clipLimits
);
im6
=
getClipFrame
(
imraw
,
clipLimits
,
gray
());
im6
=
getClipFrame
(
imraw
,
clipLimits
,
gray
());
im7
=
getClipFrame
(
imfmX
,
clipLimits
);
im7
=
getClipFrame
(
imfmX
,
clipLimits
);
im8
=
getClipFrame
(
mat2gray
(
imnPlate
),
clipLimits
);
im8
=
getClipFrame
(
imnPlate
,
clipLimits
);
imOut
=
[
im6
,
im2
,
im8
;
im3
,
im4
,
im7
];
% imOut = [ im6,im2, im8 ; im3, im4, im7 ];
clf
;
imagesc
(
imOut
);
drawnow
clf
;
imagesc
(
imOut
);
drawnow
title
(
num2str
(
Z
))
title
(
num2str
(
Z
))
if
bClear
if
bClear
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment