Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
inPhase code repository
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fritsch
inPhase code repository
Commits
ce3addf3
Commit
ce3addf3
authored
2 years ago
by
fritsch
Browse files
Options
Downloads
Patches
Plain Diff
Replace inPhase_Segmentation_v11.m
parent
a85cab59
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
inPhase_Segmentation_v11.m
+15
-5
15 additions, 5 deletions
inPhase_Segmentation_v11.m
with
15 additions
and
5 deletions
inPhase_Segmentation_v11.m
+
15
−
5
View file @
ce3addf3
%% inPhase segemntation routine
%% inPhase segemntation routine
% It assumes pairs of BF images and fluorescent maximum projections in .tif format
% It assumes pairs of BF images and fluorescent maximum projections in .tif format
% These pairs should have the same name with "BF" and "Max" as labels.
% These pairs should have the same name with "BF" and "Max" as labels.
%
t
hese pairs are supposed to have the used temperature in the name of the file (_xxC_)
%
T
hese pairs are supposed to have the used temperature in the name of the file (_xxC_)
% Example:
% Example:
% BF_proteinName_20C
% BF_proteinName_20C
% Max_proteinName_20C
% Max_proteinName_20C
...
@@ -13,7 +13,7 @@ filesTiff = dir([pathi '/**/*.tif']);
...
@@ -13,7 +13,7 @@ filesTiff = dir([pathi '/**/*.tif']);
folderExp
=
unique
({
filesTiff
.
folder
});
folderExp
=
unique
({
filesTiff
.
folder
});
% Save images of segmentation for all individual emulsion droplets
% Save images of segmentation for all individual emulsion droplets
saveImage
=
tru
e
;
saveImage
=
fals
e
;
% Experimental setup related constants
% Experimental setup related constants
pixelSize
=
0.1625
;
pixelSize
=
0.1625
;
...
@@ -300,7 +300,18 @@ for k = 1 : length(folderExp)
...
@@ -300,7 +300,18 @@ for k = 1 : length(folderExp)
currImageCropBF
=
imgaussfilt
(
currImageCropBF
,
3
);
currImageCropBF
=
imgaussfilt
(
currImageCropBF
,
3
);
currImageCropBF2
=
imgradient
(
currImageCropBF
);
currImageCropBF2
=
imgradient
(
currImageCropBF
);
currImageCropBF2
(
~
emulsionMask
)
=
mean
(
currImageCropBF2
(
emulsionMask
));
currImageCropBF2
(
~
emulsionMask
)
=
mean
(
currImageCropBF2
(
emulsionMask
));
[
centerBF
,
radiusBF
,
metricBF
]
=
imfindcircles
(
imadjust
(
currImageCropBF2
),
[
10
,
round
(
size
(
currImageCropBF2
,
1
)/
5
)],
'Sensitivity'
,
0.6
,
'ObjectPolarity'
,
'dark'
);
[
centerBF
,
radiusBF
,
~
]
=
imfindcircles
(
imadjust
(
currImageCropBF2
),
[
10
,
round
(
size
(
currImageCropBF2
,
1
)/
5
)],
'Sensitivity'
,
0.6
,
'ObjectPolarity'
,
'dark'
);
% remove misdetection of bright spots
if
~
isempty
(
centerBF
)
currImageCropBF_Mask
=
createCirclesMask
(
size
(
currImageCropBF
),
centerBF
,
radiusBF
);
currImageCropBF_Mask
=
regionprops
(
currImageCropBF_Mask
,
currImageCropBF
,
'MeanIntensity'
,
'Centroid'
);
currImageCropBF_Int
=
vertcat
(
currImageCropBF_Mask
.
MeanIntensity
);
currImageCropBF_Centroid
=
vertcat
(
currImageCropBF_Mask
.
Centroid
);
currIndx
=
currImageCropBF_Int
<=
mean
(
currImageCropBF
(
emulsionMask
));
currIndx
=
sum
(
abs
(
centerBF
-
currImageCropBF_Centroid
(
currIndx
,
:)),
2
)
<=
2
;
centerBF
=
centerBF
(
currIndx
,
:);
radiusBF
=
radiusBF
(
currIndx
);
end
if
saveImage
if
saveImage
hf1
=
figure
(
'visible'
,
'off'
);
hf1
=
figure
(
'visible'
,
'off'
);
imshow
(
currImageCropBF
)
imshow
(
currImageCropBF
)
...
@@ -370,5 +381,4 @@ for k = 1 : length(folderExp)
...
@@ -370,5 +381,4 @@ for k = 1 : length(folderExp)
% save Output data as .mat
% save Output data as .mat
save
([
currFolderExp
{
1
},
filesep
,
'ResultsNew.mat'
],
'Results'
)
save
([
currFolderExp
{
1
},
filesep
,
'ResultsNew.mat'
],
'Results'
)
end
end
\ No newline at end of file
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