Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DCT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container 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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
graintracking
DCT
Commits
8b8b30d8
Commit
8b8b30d8
authored
10 years ago
by
Andrew King
Browse files
Options
Downloads
Patches
Plain Diff
Replace imreconstruct to go faster
Signed-off-by:
Andrew King
<
andrew.king@esrf.fr
>
parent
0708a7b5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
2_difspot/gtSegmentDiffractionBlobs2D.m
+20
-10
20 additions, 10 deletions
2_difspot/gtSegmentDiffractionBlobs2D.m
with
20 additions
and
10 deletions
2_difspot/gtSegmentDiffractionBlobs2D.m
+
20
−
10
View file @
8b8b30d8
...
...
@@ -39,15 +39,15 @@ function gtSegmentDiffractionBlobs2D(first, last, workingdirectory)
% Segmented diffraction blobs in the databse.
%
%
if
0
OAR_make
(
'gtSegmentDiffractionBlobs2D'
,
0
,
totproj
-
1
,
30
,
parameters
.
acq
.
dir
,
true
,
...
'walltime'
,
OAR_parameters
.
walltime
);
end
% test1=zeros(768, 960);
% test2=test1;
if
isdeployed
global
GT_DB
global
GT_MATLAB_HOME
load
(
'workspaceGlobal.mat'
);
% first=str2double(first);
% last=str2double(last);
% don't show all the messages - as this makes the .out file very large
out
=
GtConditionalOutput
(
false
);
disp
(
'running compiled, so will show minimal messages only'
)
...
...
@@ -105,6 +105,7 @@ for imagez=first:last
% label (2D only)
marker_im
=
bwlabel
(
marker_im
);
mask_im
=
bwlabel
(
mask_im
);
L
=
max
(
marker_im
(:))
for
j
=
1
:
L
...
...
@@ -116,12 +117,21 @@ for imagez=first:last
continue
end
spot
=
imreconstruct
(
marker
,
mask_im
);
%spot=imreconstruct(marker, mask_im);
mask_id
=
unique
(
mask_im
(
find
(
marker
)));
spot
=
mask_im
==
mask_id
;
% test size
bb
=
regionprops
(
double
(
spot
),
'BoundingBox'
);
bb
=
bb
.
BoundingBox
;
bb
=
ceil
(
bb
);
%bb=regionprops(double(spot), 'BoundingBox');
%bb=bb.BoundingBox;
%bb=ceil(bb);
indicies
=
find
(
spot
);
[
yy
,
xx
]
=
ind2sub
(
size
(
spot
),
indicies
);
bb
(
3
)
=
max
(
xx
)
-
min
(
xx
)
+
1
;
bb
(
4
)
=
max
(
yy
)
-
min
(
yy
)
+
1
;
if
all
(
bb
(
3
:
4
)
>
MinBlobSize
(
1
:
2
))
&&
all
(
bb
(
3
:
4
)
<
MaxBlobSize
(
1
:
2
))
% size test
% update marker and mask to avoid duplicating spots
...
...
@@ -167,12 +177,12 @@ indicies=find(greyspot>0);
vals
=
greyspot
(
indicies
);
% from original gtSegmentDiffractionBlobs
mym
(
db
Insert
(
table_difblob
,{
'difblobID'
},
0
))
mym
(
gtDB
Insert
(
table_difblob
,{
'difblobID'
},
0
))
difblobID
=
mym
(
'select last_insert_id()'
);
disp
(
'***DB WRITE A BLOB *** '
)
db
InsertMultiple
(
table_difblobdetails
,
...
gtDB
InsertMultiple
(
table_difblobdetails
,
...
'difblobID'
,
repmat
(
difblobID
,
1
,
length
(
xx
)),
...
'xIndex'
,
xx
,
...
'yIndex'
,
yy
,
...
...
...
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