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
5cd01bf1
Commit
5cd01bf1
authored
6 years ago
by
Nicola Vigano
Browse files
Options
Downloads
Patches
Plain Diff
Fixed and improved projection correction computation
Signed-off-by:
Nicola Vigano
<
nicola.vigano@esrf.fr
>
parent
07112c9d
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/Gt6DReconstructionAlgorithmFactory.m
+44
-20
44 additions, 20 deletions
zUtil_Deformation/Gt6DReconstructionAlgorithmFactory.m
with
44 additions
and
20 deletions
zUtil_Deformation/Gt6DReconstructionAlgorithmFactory.m
+
44
−
20
View file @
5cd01bf1
...
...
@@ -499,7 +499,7 @@ classdef Gt6DReconstructionAlgorithmFactory < handle
fprintf
(
' * Using blobs
''
intensities\n'
)
scatter_ints_avg
=
[
bl
(:)
.
intensity
]
'
;
scatter_ints_avg
=
scatter_ints_avg
.
/
mean
([
bl
(:)
.
intensity
]);
scatter_ints_ors
=
[
scatter_ints_avg
,
scatter_ints_avg
]
;
scatter_ints_ors
=
scatter_ints_avg
(:,
ones
(
1
,
numel
(
ors_allblobs
)))
;
end
fprintf
(
' - Dealing with paddings:\n'
)
...
...
@@ -1311,25 +1311,33 @@ classdef Gt6DReconstructionAlgorithmFactory < handle
try
fprintf
(
' - Applying incoming beam intensity corrections\n'
)
[
beam_intensities
,
refs
]
=
gtGrainComputeIncomingBeamIntensity
(
ref_or
,
self
.
parameters
,
det_ind
);
beam_ints_avg
=
beam_intensities
(
sel
);
beam_ints_avg
=
beam_ints_avg
/
mean
(
beam_ints_avg
);
beam_in_ints_avg
=
beam_intensities
(
sel
);
beam_in_ints_avg
=
beam_in_ints_avg
/
mean
(
beam_in_ints_avg
);
catch
mexc
gtPrintException
(
mexc
,
'Reverting to non-corrected beam intensities'
)
beam_in_ints_avg
=
1
;
end
try
fprintf
(
' - Applying beam attenuation corrections\n'
)
[
atts_tot
,
~
,
abs_vol
]
=
gtGrainComputeBeamAttenuation
(
ref_or
,
self
.
parameters
,
det_ind
);
beam_
ints_avg
=
beam
_ints_avg
.*
atts_tot
(
sel
);
beam_
out
_ints_avg
=
atts_tot
(
sel
);
catch
mexc
gtPrintException
(
mexc
,
'Reverting to non-corrected beam
in
ten
sitie
s'
)
beam_ints_avg
=
1
;
gtPrintException
(
mexc
,
'Reverting to non-corrected beam
at
ten
uation
s'
)
beam_
out_
ints_avg
=
1
;
end
else
beam_ints_avg
=
1
;
beam_in_ints_avg
=
1
;
beam_out_ints_avg
=
1
;
end
scatter_ints_avg
=
scatter_ints
.*
ref_or
.
allblobs
.
lorentzfac
(
ab_sel
)
.*
beam_ints_avg
;
scatter_ints_avg
=
scatter_ints
.*
ref_or
.
allblobs
.
lorentzfac
(
ab_sel
)
.*
beam_in_ints_avg
.*
beam_out_ints_avg
;
fprintf
(
' - Computing each orientation
''
s corrections..'
)
c
=
tic
();
if
(
self
.
use_predicted_scatter_ints
>
2
&&
numel
(
beam_ints_avg
)
>
1
)
if
(
self
.
use_predicted_scatter_ints
>
2
...
&&
(
numel
(
beam_in_ints_avg
)
>
1
||
numel
(
beam_out_ints_avg
)
>
1
))
num_ors
=
numel
(
ors_allbls
);
scatter_ints_ors
=
scatter_ints
(:,
ones
(
num_ors
,
1
));
fprintf
(
'\b\b: '
)
...
...
@@ -1337,20 +1345,35 @@ classdef Gt6DReconstructionAlgorithmFactory < handle
if
(
mod
(
ii_o
,
10
)
==
1
)
num_chars
=
fprintf
(
'%05d/%05d'
,
ii_o
,
num_ors
);
end
try
[
beam_int_or
,
refs
]
=
gtGrainComputeIncomingBeamIntensity
(
ref_or
,
self
.
parameters
,
det_ind
,
refs
);
beam_int_or
=
beam_int_or
(
sel
);
beam_int_or
=
beam_int_or
/
mean
(
beam_int_or
);
or
=
ref_or
;
or
.
allblobs
=
ors_allbls
(
ii_o
);
if
(
numel
(
beam_in_ints_avg
)
>
1
)
try
[
beam_in_int_or
,
refs
]
=
gtGrainComputeIncomingBeamIntensity
(
or
,
self
.
parameters
,
det_ind
,
refs
);
beam_in_int_or
=
beam_in_int_or
(
sel
);
beam_in_int_or
=
beam_in_int_or
/
mean
(
beam_in_int_or
);
catch
mexc
gtPrintException
(
mexc
,
'Reverting to non-corrected beam intensities'
)
beam_in_int_or
=
1
;
end
else
beam_in_int_or
=
1
;
end
atts_tot
=
gtGrainComputeBeamAttenuation
(
ref_or
,
self
.
parameters
,
det_ind
,
abs_vol
);
if
(
numel
(
beam_out_ints_avg
)
>
1
)
try
atts_tot
=
gtGrainComputeBeamAttenuation
(
or
,
self
.
parameters
,
det_ind
,
abs_vol
);
beam_int_or
=
beam_int_or
.*
atts_tot
(
sel
);
catch
mexc
gtPrintException
(
mexc
,
'Reverting to non-corrected beam intensities'
)
beam_int_or
=
1
;
beam_out_int_or
=
atts_tot
(
sel
);
catch
mexc
gtPrintException
(
mexc
,
'Reverting to non-corrected beam intensities'
)
beam_out_int_or
=
1
;
end
else
beam_out_int_or
=
1
;
end
scatter_ints_ors
(:,
ii_o
)
=
scatter_ints_ors
(:,
ii_o
)
.*
ors_allbls
(
ii_o
)
.
lorentzfac
(
ab_sel
,
:)
.*
beam_int_or
;
scatter_ints_ors
(:,
ii_o
)
=
scatter_ints_ors
(:,
ii_o
)
.*
ors_allbls
(
ii_o
)
.
lorentzfac
(
ab_sel
,
:)
.*
beam_
in_int_or
.*
beam_out_
int_or
;
if
(
mod
(
ii_o
,
10
)
==
1
)
fprintf
(
repmat
(
'\b'
,
[
1
num_chars
]));
...
...
@@ -1358,7 +1381,8 @@ classdef Gt6DReconstructionAlgorithmFactory < handle
end
else
lfacs
=
cat
(
2
,
ors_allbls
(:)
.
lorentzfac
);
scatter_ints_ors
=
bsxfun
(
@
times
,
scatter_ints
.*
beam_ints_avg
,
lfacs
(
ab_sel
,
:));
scatter_ints_ors
=
scatter_ints
.*
beam_in_ints_avg
.*
beam_out_ints_avg
;
scatter_ints_ors
=
bsxfun
(
@
times
,
scatter_ints_ors
,
lfacs
(
ab_sel
,
:));
end
fprintf
(
'\b\b: Done in %g seconds.\n'
,
toc
(
c
))
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