Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AxonTracker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
AxonTracker
Commits
6db8ed3e
Commit
6db8ed3e
authored
12 years ago
by
Mark Winter
Committed by
Mark Winter
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Bug fixes for UI code.
parent
76e2d085
Branches
mKymoUI
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/matlab/GetKymoPt.m
+1
-1
1 addition, 1 deletion
src/matlab/GetKymoPt.m
src/matlab/GetPath.m
+4
-4
4 additions, 4 deletions
src/matlab/GetPath.m
src/matlab/GoKymo.m
+8
-6
8 additions, 6 deletions
src/matlab/GoKymo.m
src/matlab/mKymoUI.m
+60
-6
60 additions, 6 deletions
src/matlab/mKymoUI.m
with
73 additions
and
17 deletions
src/matlab/GetKymoPt.m
+
1
−
1
View file @
6db8ed3e
...
...
@@ -4,7 +4,7 @@ function arcPoints = GetKymoPt(imagePoints)
arcPoints = zeros(1,size(imagePoints,1));
for i=1:size(imagePoints,1)
arcPoints(i) = Trace.LKymo(imagePoints(i,1),imagePoints(i,2));
arcPoints(i) = Trace.LKymo(
round(
imagePoints(i,1)
)
,
round(
imagePoints(i,2))
)
;
if ( arcPoints(i) == 0 )
dd = (Trace.jPath - double(imagePoints(i,2))).^2 + (Trace.iPath - double(imagePoints(i,1))).^2;
[mindist arcPoints(i)] = min(dd);
...
...
This diff is collapsed.
Click to expand it.
src/matlab/GetPath.m
+
4
−
4
View file @
6db8ed3e
...
...
@@ -44,10 +44,10 @@ colormap(gray);hold all
plot
(
p1
(
2
),
p1
(
1
),
'ro'
)
plot
(
p2
(
2
),
p2
(
1
),
'bx'
)
drawnow
p
rogressbar
(
0
);
P
rogressbar
(
0
);
gIm
=
sparse
([],[],[],
prod
(
size
(
im
)),
prod
(
size
(
im
)),
8
*
sum
(
size
(
im
)));
for
i
=
2
:
size
(
im
,
1
)
-
1
p
rogressbar
(
i
/
size
(
im
,
1
));
P
rogressbar
(
i
/
size
(
im
,
1
));
for
j
=
2
:
size
(
im
,
2
)
-
2
if
0
==
im
(
i
,
j
),
continue
,
end
for
ni
=-
1
:
1
...
...
@@ -77,8 +77,8 @@ for i=2:size(im,1)-1
end
end
end
p
rogressbar
(
1
);
path
(
path
,
'..\matlab_bgl'
)
P
rogressbar
(
1
);
ind1
=
sub2ind
(
size
(
im
),
p1
(
1
),
p1
(
2
));
ind2
=
sub2ind
(
size
(
im
),
p2
(
1
),
p2
(
2
));
options
.
target
=
ind2
;
...
...
This diff is collapsed.
Click to expand it.
src/matlab/GoKymo.m
+
8
−
6
View file @
6db8ed3e
...
...
@@ -99,15 +99,17 @@ for t=1: nframes
im
(
im
>
stats
(
2
))
=
stats
(
2
);
im
=
mat2gray
(
im
);
% h = fspecial('gaussian', 7, 5);
% imfilt = imfilter(im, h, 'symmetric');
% for j=1:50
% imfilt = imfilter(imfilt, h, 'symmetric');
% end
% imhfreq = max((im - imfilt), zeros(size(im)));
h
=
fspecial
(
'gaussian'
,
7
,
5
);
imfilt
=
imfilter
(
im
,
h
,
'symmetric'
);
for
j
=
1
:
50
imfilt
=
imfilter
(
imfilt
,
h
,
'symmetric'
);
end
imhfreq
=
max
((
im
-
imfilt
),
zeros
(
size
(
im
)));
im
=
mat2gray
(
imhfreq
);
% medim = medfilt2(imhfreq,[4,4]);
%
% medim = mat2gray(medim);
% im = medim;
ii
=
[];
for
i
=
1
:
length
(
PathNorms
)
% iPath=y,jPath=x
...
...
This diff is collapsed.
Click to expand it.
src/matlab/mKymoUI.m
+
60
−
6
View file @
6db8ed3e
...
...
@@ -37,23 +37,49 @@ CONSTANTS.pixelSize = str2double(movProps{1});
CONSTANTS
.
frameTime
=
str2double
(
movProps
{
2
});
CONSTANTS
.
expTime
=
str2double
(
movProps
{
3
});
FileNameGFP
=
0
;
[
FileNameGFP
,
PathNameGFP
]
=
uigetfile
([
PathNameGFP
'*.tif'
],
'open gfp file to generate path'
);
if
(
0
==
FileNameGFP
)
% FileNameGFP=0;
% [FileNameGFP,PathNameGFP] = uigetfile([PathNameGFP '*.tif'],'open gfp file to generate path');
% if (0==FileNameGFP)
% close all;
% return;
% end
[
FileNameGFP
,
PathNameGFP
]
=
uigetfile
([
PathNameGFP
'*.tif'
],
'open movie and gfp files to generate path'
,
'MultiSelect'
,
'on'
);
if
(
iscell
(
FileNameGFP
)
)
imGFP
=
loadAveragedImage
(
fullfile
(
PathNameGFP
,
FileNameGFP
{
1
}));
for
i
=
2
:
length
(
FileNameGFP
)
imGFP
=
imGFP
+
loadAveragedImage
(
fullfile
(
PathNameGFP
,
FileNameGFP
{
i
}));
end
elseif
(
FileNameGFP
==
0
)
close
all
;
return
;
else
imGFP
=
loadAveragedImage
(
fullfile
(
PathNameGFP
,
FileNameGFP
));
end
save
(
'mKymoUI_settings.mat'
,
'PathNameGFP'
,
'CONSTANTS'
);
gfpFile
=
fullfile
(
PathNameGFP
,
FileNameGFP
);
[
imGFP
]
=
imread
(
gfpFile
);
%
gfpFile=fullfile(PathNameGFP, FileNameGFP);
%
[imGFP]=imread(gfpFile);
hold
off
imagesc
(
imGFP
);
colormap
gray
hold
on
end
function
avgIm
=
loadAveragedImage
(
imagePath
)
iminfo
=
imfinfo
(
imagePath
);
avgIm
=
zeros
(
iminfo
(
1
)
.
Height
,
iminfo
(
1
)
.
Width
);
for
i
=
1
:
length
(
iminfo
)
im
=
double
(
imread
(
imagePath
,
i
));
avgIm
=
avgIm
+
im
;
end
avgIm
=
mat2gray
(
avgIm
);
end
function
ButtonDown
(
src
,
eventdata
)
global
ptProximal
ptDistal
imGFP
;
...
...
@@ -84,6 +110,15 @@ global ptProximal ptDistal imGFP gfpFile CONSTANTS Trace Hulls HashedHulls Blur
if
(
strcmp
(
eventdata
.
Key
,
'return'
))
[
iPath
,
jPath
,
bKymo
]
=
GetPath
(
imGFP
,
round
(
ptProximal
),
round
(
ptDistal
));
if
(
isempty
(
jPath
)
)
[
iPath
,
jPath
,
bKymo
]
=
mkLinePath
(
round
(
ptProximal
),
round
(
ptDistal
));
% msgHandle = msgbox('Unable to find path between specified points.');
% uiwait(msgHandle);
% return;
end
plot
(
jPath
,
iPath
,
'-b'
);
ff
=
dir
(
'mKymoUI_settings.mat'
);
if
~
isempty
(
ff
)
load
(
'mKymoUI_settings.mat'
);
...
...
@@ -95,7 +130,6 @@ if (strcmp(eventdata.Key,'return'))
[
'open movie file to generate kymograph for gfp file '
gfpFile
]);
if
(
FileNameMovie
==
0
)
close
all
;
return
;
end
...
...
@@ -164,5 +198,25 @@ elseif ( strcmpi(eventdata.Key,'space') )
end
end
function
[
iPath
,
jPath
,
bKymo
]
=
mkLinePath
(
ptProximal
,
ptDistal
)
startX
=
ptProximal
(
2
);
endX
=
ptDistal
(
2
);
startY
=
ptProximal
(
1
);
endY
=
ptDistal
(
1
);
numX
=
round
(
abs
(
endX
-
startX
));
slope
=
(
endY
-
startY
)
/
numX
;
intercept
=
startY
-
slope
*
startX
;
stepX
=
sign
(
endX
-
startX
);
jPath
=
round
(
startX
:
stepX
:
endX
);
iPath
=
round
(
slope
*
jPath
+
intercept
);
bKymo
=
nan
*
ones
(
length
(
iPath
),
4
);
bKymo
(:,
3
:
4
)
=
ones
(
length
(
iPath
),
1
)
*
[
slope
intercept
];
end
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