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
bc0fcd3a
Commit
bc0fcd3a
authored
8 years ago
by
Nicola Vigano
Browse files
Options
Downloads
Patches
Plain Diff
Reformatting
Signed-off-by:
Nicola Vigano
<
vigano@yoda.esrf.fr
>
parent
c4a90f17
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
zUtil_Geo/gtGeoProjForReconstruction.m
+39
-40
39 additions, 40 deletions
zUtil_Geo/gtGeoProjForReconstruction.m
with
39 additions
and
40 deletions
zUtil_Geo/gtGeoProjForReconstruction.m
+
39
−
40
View file @
bc0fcd3a
...
@@ -44,57 +44,56 @@ function proj_geom = gtGeoProjForReconstruction(projvec, omega, graincenter,...
...
@@ -44,57 +44,56 @@ function proj_geom = gtGeoProjForReconstruction(projvec, omega, graincenter,...
%
%
%
%
if
isempty
(
bboff
)
if
isempty
(
bboff
)
bboff
=
zeros
(
size
(
bbpos
,
1
),
2
);
bboff
=
zeros
(
size
(
bbpos
,
1
),
2
);
end
end
if
(
isempty
(
detgeo
))
if
(
isempty
(
detgeo
))
detgeo
=
gtGeoConvertLegacyLabgeo2Detgeo
(
labgeo
);
detgeo
=
gtGeoConvertLegacyLabgeo2Detgeo
(
labgeo
);
end
end
% Bounding box center U,V coordinates
% Bounding box center U,V coordinates
bbcent_det
=
[
bbpos
(:,
1
)
+
(
bbpos
(:,
3
)
-
1
)
/
2
+
bboff
(:,
1
)
,
...
bbcent_det
=
[
bbpos
(:,
1
)
+
(
bbpos
(:,
3
)
-
1
)
/
2
+
bboff
(:,
1
)
,
...
bbpos
(:,
2
)
+
(
bbpos
(:,
4
)
-
1
)
/
2
+
bboff
(:,
2
)
];
bbpos
(:,
2
)
+
(
bbpos
(:,
4
)
-
1
)
/
2
+
bboff
(:,
2
)
];
% All functions that use the same omegas, need the same rotation tensors:
% All functions that use the same omegas, need the same rotation tensors:
rot_comp_w
=
gtMathsRotationMatrixComp
(
labgeo
.
rotdir
', '
col
'
);
rot_comp_w
=
gtMathsRotationMatrixComp
(
labgeo
.
rotdir
', '
col
'
);
rot_omega
=
gtMathsRotationTensor
(
omega
,
rot_comp_w
);
rot_omega
=
gtMathsRotationTensor
(
omega
,
rot_comp_w
);
% Bounding box center X,Y,Z coordinates in LAB and REC reference
% Bounding box center X,Y,Z coordinates in LAB and REC reference
bbcent_lab
=
gtGeoDet2Lab
(
bbcent_det
,
detgeo
,
0
);
bbcent_lab
=
gtGeoDet2Lab
(
bbcent_det
,
detgeo
,
0
);
bbcent_rec
=
gtGeoLab2Sam
(
bbcent_lab
,
rot_omega
,
labgeo
,
recgeo
,
0
,
0
);
bbcent_rec
=
gtGeoLab2Sam
(
bbcent_lab
,
rot_omega
,
labgeo
,
recgeo
,
0
,
0
);
% Detector orientation vectors in REC reference
% Detector orientation vectors in REC reference
detdiru
=
detgeo
.
detdiru
.
/
sqrt
(
sum
(
detgeo
.
detdiru
.^
2
))
*
detgeo
.
pixelsizeu
;
detdiru
=
detgeo
.
detdiru
.
/
sqrt
(
sum
(
detgeo
.
detdiru
.^
2
))
*
detgeo
.
pixelsizeu
;
detdirv
=
detgeo
.
detdirv
.
/
sqrt
(
sum
(
detgeo
.
detdirv
.^
2
))
*
detgeo
.
pixelsizev
;
detdirv
=
detgeo
.
detdirv
.
/
sqrt
(
sum
(
detgeo
.
detdirv
.^
2
))
*
detgeo
.
pixelsizev
;
ones_omega
=
ones
(
length
(
omega
),
1
);
ones_omega
=
ones
(
length
(
omega
),
1
);
detdiru_rec
=
gtGeoLab2Sam
(
detdiru
(
ones_omega
,
:),
rot_omega
,
labgeo
,
recgeo
,
1
,
0
);
detdiru_rec
=
gtGeoLab2Sam
(
detdiru
(
ones_omega
,
:),
rot_omega
,
labgeo
,
recgeo
,
1
,
0
);
detdirv_rec
=
gtGeoLab2Sam
(
detdirv
(
ones_omega
,
:),
rot_omega
,
labgeo
,
recgeo
,
1
,
0
);
detdirv_rec
=
gtGeoLab2Sam
(
detdirv
(
ones_omega
,
:),
rot_omega
,
labgeo
,
recgeo
,
1
,
0
);
if
(
strcmpi
(
rectype
,
'ASTRA_absorption'
))
if
(
strcmpi
(
rectype
,
'ASTRA_absorption'
))
projvec
=
labgeo
.
beamdir
(
ones_omega
,
:);
projvec
=
labgeo
.
beamdir
(
ones_omega
,
:);
projvec
=
gtGeoLab2Sam
(
projvec
,
rot_omega
,
labgeo
,
recgeo
,
1
,
0
);
projvec
=
gtGeoLab2Sam
(
projvec
,
rot_omega
,
labgeo
,
recgeo
,
1
,
0
);
end
end
% Normalised projection vector in REC reference
% Normalised projection vector in REC reference
projvec_rec
=
gtGeoSam2Sam
(
projvec
,
samgeo
,
recgeo
,
1
,
0
);
projvec_rec
=
gtGeoSam2Sam
(
projvec
,
samgeo
,
recgeo
,
1
,
0
);
projvec_rec
=
gtMathsNormalizeVectorsList
(
projvec_rec
);
projvec_rec
=
gtMathsNormalizeVectorsList
(
projvec_rec
);
switch
(
rectype
)
switch
(
rectype
)
case
{
'ASTRA_grain'
}
case
{
'ASTRA_grain'
}
% Grain center in REC reference
% Grain center in REC reference
graincenter_rec
=
gtGeoSam2Sam
(
graincenter
,
samgeo
,
recgeo
,
0
,
0
);
graincenter_rec
=
gtGeoSam2Sam
(
graincenter
,
samgeo
,
recgeo
,
0
,
0
);
graincenter_rec
=
graincenter_rec
(
ones
(
size
(
bbcent_rec
,
1
),
1
),
:);
graincenter_rec
=
graincenter_rec
(
ones
(
size
(
bbcent_rec
,
1
),
1
),
:);
bbcent_rec
=
bbcent_rec
-
graincenter_rec
;
bbcent_rec
=
bbcent_rec
-
graincenter_rec
;
proj_geom
=
[
projvec_rec
,
bbcent_rec
,
detdiru_rec
,
detdirv_rec
];
case
{
'ASTRA_full'
,
'ASTRA_absorption'
}
proj_geom
=
[
projvec_rec
,
bbcent_rec
,
detdiru_rec
,
detdirv_rec
];
proj_geom
=
[
projvec_rec
,
bbcent_rec
,
detdiru_rec
,
detdirv_rec
];
end
end
% of function
case
{
'ASTRA_full'
,
'ASTRA_absorption'
}
proj_geom
=
[
projvec_rec
,
bbcent_rec
,
detdiru_rec
,
detdirv_rec
];
end
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