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
12af71de
Commit
12af71de
authored
10 years ago
by
Nicola Vigano
Browse files
Options
Downloads
Patches
Plain Diff
6D-Phantom/Cluster: fixed bug with std included blob output
Signed-off-by:
Nicola Vigano
<
nicola.vigano@esrf.fr
>
parent
f1874db5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
zUtil_Deformation/gt6DCreateProjDataFromGrainCluster.m
+38
-21
38 additions, 21 deletions
zUtil_Deformation/gt6DCreateProjDataFromGrainCluster.m
with
38 additions
and
21 deletions
zUtil_Deformation/gt6DCreateProjDataFromGrainCluster.m
+
38
−
21
View file @
12af71de
...
...
@@ -204,7 +204,7 @@ function [proj, refor, or] = gt6DCreateProjDataFromGrainCluster(grs_list, phase_
img_sizes
=
img_sizes
(
~
inconvenient_etas
,
:);
fprintf
(
'Loading raw images: '
)
num_blobs
=
size
(
img_bboxes
,
1
);
num_blobs
=
numel
(
ref_included
);
blobs
(
1
:
num_blobs
)
=
struct
(
...
'intm'
,
[],
...
% The normalized blob
...
...
@@ -225,8 +225,11 @@ function [proj, refor, or] = gt6DCreateProjDataFromGrainCluster(grs_list, phase_
sel_reflections
=
find
(
ref_selected
);
sel_reflections
=
sel_reflections
(
~
inconvenient_etas
);
for
ii_i
=
1
:
num_blobs
num_chars
=
fprintf
(
'%02d/%02d'
,
ii_i
,
num_blobs
);
num_sel_refl
=
numel
(
sel_reflections
);
for
ii_i
=
1
:
num_sel_refl
num_chars
=
fprintf
(
'%02d/%02d'
,
ii_i
,
num_sel_refl
);
ii_b
=
sel_reflections
(
ii_i
);
bb
=
[
img_bboxes
(
ii_i
,
1
:
2
),
img_sizes
(
ii_i
,
1
:
2
)];
blob_vol
=
gtGetRawRoi
(
img_bboxes
(
ii_i
,
3
),
img_bboxes
(
ii_i
,
6
),
p
.
acq
,
bb
);
...
...
@@ -235,59 +238,59 @@ function [proj, refor, or] = gt6DCreateProjDataFromGrainCluster(grs_list, phase_
% Transposing to keep the same convention as spots
blob_vol
=
permute
(
blob_vol
,
[
2
1
3
]);
blobs
(
ii_
i
)
.
mbbsize
=
blob_bb
(
4
:
6
);
blobs
(
ii_
i
)
.
mbbu
=
[
blob_bb
(
1
),
blob_bb
(
1
)
+
blob_bb
(
4
)
+
1
];
blobs
(
ii_
i
)
.
mbbv
=
[
blob_bb
(
2
),
blob_bb
(
2
)
+
blob_bb
(
5
)
+
1
];
blobs
(
ii_
i
)
.
mbbw
=
[
blob_bb
(
3
),
blob_bb
(
3
)
+
blob_bb
(
6
)
+
1
];
blobs
(
ii_
b
)
.
mbbsize
=
blob_bb
(
4
:
6
);
blobs
(
ii_
b
)
.
mbbu
=
[
blob_bb
(
1
),
blob_bb
(
1
)
+
blob_bb
(
4
)
+
1
];
blobs
(
ii_
b
)
.
mbbv
=
[
blob_bb
(
2
),
blob_bb
(
2
)
+
blob_bb
(
5
)
+
1
];
blobs
(
ii_
b
)
.
mbbw
=
[
blob_bb
(
3
),
blob_bb
(
3
)
+
blob_bb
(
6
)
+
1
];
blob_size_im
=
[
stackUSize
,
stackVSize
,
blob_bb
(
6
)
+
2
];
shifts_blob
=
gtFwdSimGetStackShifts
(
stackUSize
,
stackVSize
,
blob_bb
,
false
);
shifts_blob
=
[
shifts_blob
.
u
,
shifts_blob
.
v
,
1
];
blobs
(
ii_
i
)
.
intm
=
gtPlaceSubVolume
(
...
blobs
(
ii_
b
)
.
intm
=
gtPlaceSubVolume
(
...
zeros
(
blob_size_im
,
'single'
),
blob_vol
,
shifts_blob
);
blobs
(
ii_
i
)
.
bbsize
=
blob_size_im
;
blobs
(
ii_
b
)
.
bbsize
=
blob_size_im
;
blob_bb_im
=
[
blob_bb
(
1
:
3
)
-
shifts_blob
,
blob_size_im
];
blobs
(
ii_
i
)
.
bbuim
=
[
blob_bb_im
(
1
),
blob_bb_im
(
1
)
+
blob_bb_im
(
4
)
-
1
];
blobs
(
ii_
i
)
.
bbvim
=
[
blob_bb_im
(
2
),
blob_bb_im
(
2
)
+
blob_bb_im
(
5
)
-
1
];
blobs
(
ii_
i
)
.
bbwim
=
[
blob_bb_im
(
3
),
blob_bb_im
(
3
)
+
blob_bb_im
(
6
)
-
1
];
blobs
(
ii_
b
)
.
bbuim
=
[
blob_bb_im
(
1
),
blob_bb_im
(
1
)
+
blob_bb_im
(
4
)
-
1
];
blobs
(
ii_
b
)
.
bbvim
=
[
blob_bb_im
(
2
),
blob_bb_im
(
2
)
+
blob_bb_im
(
5
)
-
1
];
blobs
(
ii_
b
)
.
bbwim
=
[
blob_bb_im
(
3
),
blob_bb_im
(
3
)
+
blob_bb_im
(
6
)
-
1
];
% We should build the mask from the segmented reflections of the
% grains
% for the moment we only use one (the reference one), to
% renormalize the different reflections
blobs
(
ii_
i
)
.
mask
=
false
(
blob_size_im
);
blobs
(
ii_
b
)
.
mask
=
false
(
blob_size_im
);
for
ii_g
=
1
gbl
=
refgr
.
proj
.
bl
(
sel_reflections
(
ii_
i
)
);
% gbl = grs(ii_g).proj.bl(
sel_reflections(
ii_
i)
);
gbl
=
refgr
.
proj
.
bl
(
ii_
b
);
% gbl = grs(ii_g).proj.bl(ii_
b
);
grain_mask
=
gbl
.
mask
;
gbl_shifts_im
=
[
gbl
.
bbuim
(
1
),
gbl
.
bbvim
(
1
),
gbl
.
bbwim
(
1
)];
blob_shifts_im
=
[
...
blobs
(
ii_
i
)
.
bbuim
(
1
),
blobs
(
ii_
i
)
.
bbvim
(
1
),
blobs
(
ii_
i
)
.
bbwim
(
1
)];
blobs
(
ii_
b
)
.
bbuim
(
1
),
blobs
(
ii_
b
)
.
bbvim
(
1
),
blobs
(
ii_
b
)
.
bbwim
(
1
)];
mask_shifts
=
gbl_shifts_im
-
blob_shifts_im
;
blobs
(
ii_
i
)
.
mask
=
gtPlaceSubVolume
(
blobs
(
ii_
i
)
.
mask
,
...
blobs
(
ii_
b
)
.
mask
=
gtPlaceSubVolume
(
blobs
(
ii_
b
)
.
mask
,
...
grain_mask
,
mask_shifts
);
end
blob_int
=
sum
(
blobs
(
ii_
i
)
.
intm
(
blobs
(
ii_
i
)
.
mask
));
blobs
(
ii_
i
)
.
intm
=
blobs
(
ii_
i
)
.
intm
/
blob_int
;
blob_int
=
sum
(
blobs
(
ii_
b
)
.
intm
(
blobs
(
ii_
b
)
.
mask
));
blobs
(
ii_
b
)
.
intm
=
blobs
(
ii_
b
)
.
intm
/
blob_int
;
% Since we need to build the mask from the reflections of the
% grains, and we might not have them all, we in the end reset the
% mask to 1 but we used it for renormalization purpouses
if
(
true
)
blobs
(
ii_
i
)
.
mask
=
gtPlaceSubVolume
(
...
blobs
(
ii_
b
)
.
mask
=
gtPlaceSubVolume
(
...
false
(
blob_size_im
),
true
(
size
(
blob_vol
)),
shifts_blob
);
end
blobs
(
ii_
i
)
.
intensity
=
blob_int
;
blobs
(
ii_
b
)
.
intensity
=
blob_int
;
fprintf
(
repmat
(
'\b'
,
[
1
num_chars
]));
fprintf
(
repmat
(
' '
,
[
1
num_chars
]));
...
...
@@ -295,6 +298,20 @@ function [proj, refor, or] = gt6DCreateProjDataFromGrainCluster(grs_list, phase_
end
fprintf
(
'Done.\n'
)
% Now filling the remaining blobs with the blobs from refgr
% (even if they won't be used)
% ! this might change in the future ! to maybe include fwd projected
% regions on the detector
not_sel_reflections
=
true
(
size
(
ref_included
));
not_sel_reflections
(
sel_reflections
)
=
false
;
not_sel_reflections
=
find
(
not_sel_reflections
);
blobs
(
not_sel_reflections
)
=
refgr
.
proj
.
bl
(
not_sel_reflections
);
for
ii_i
=
1
:
numel
(
not_sel_reflections
)
ii_b
=
not_sel_reflections
(
ii_i
);
blobs
(
ii_b
)
.
intm
=
[];
blobs
(
ii_b
)
.
mask
=
[];
end
spots
=
arrayfun
(
@
(
x
){
sum
(
x
.
intm
,
3
)},
blobs
);
spots
=
permute
(
cat
(
3
,
spots
{:}),
[
1
3
2
]);
...
...
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