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
6c8d0e20
Commit
6c8d0e20
authored
9 years ago
by
Nicola Vigano
Browse files
Options
Downloads
Patches
Plain Diff
Allblobs: Fixed reordering of included
Signed-off-by:
Nicola Vigano
<
nicola.vigano@esrf.fr
>
parent
d2422b5a
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
4_grains/gtGrainAllblobsFilterOrder.m
+81
-62
81 additions, 62 deletions
4_grains/gtGrainAllblobsFilterOrder.m
with
81 additions
and
62 deletions
4_grains/gtGrainAllblobsFilterOrder.m
+
81
−
62
View file @
6c8d0e20
function
gr
=
gtGrainAllblobsFilterOrder
(
gr
,
refgr_omind_ind
,
included
)
gr_omind
=
gr
.
allblobs
.
omind
;
gr_omind_ind
=
[
...
find
(
gr_omind
==
1
);
find
(
gr_omind
==
2
);
...
find
(
gr_omind
==
3
);
find
(
gr_omind
==
4
)
];
gr_omind
=
gr
.
allblobs
.
omind
;
gr_omind_ind
=
[
...
find
(
gr_omind
==
1
);
find
(
gr_omind
==
2
);
...
find
(
gr_omind
==
3
);
find
(
gr_omind
==
4
)
];
if
(
~
exist
(
'refgr_omind_ind'
,
'var'
)
||
isempty
(
refgr_omind_ind
))
refgr_omind_ind
=
gr_omind_ind
;
end
if
(
~
exist
(
'included'
,
'var'
)
||
isempty
(
included
))
included
=
1
:
numel
(
gr_omind
);
end
if
(
~
exist
(
'refgr_omind_ind'
,
'var'
)
||
isempty
(
refgr_omind_ind
))
refgr_omind_ind
=
gr_omind_ind
;
end
if
(
~
exist
(
'included'
,
'var'
)
||
isempty
(
included
))
included
=
1
:
numel
(
gr_omind
);
end
fnames
=
fieldnames
(
gr
.
allblobs
);
for
ii_f
=
1
:
numel
(
fnames
)
fname
=
fnames
{
ii_f
};
switch
(
fname
)
case
'srot'
srot
=
gr
.
allblobs
.
(
fname
);
srot
(:,
:,
refgr_omind_ind
)
=
srot
(:,
:,
gr_omind_ind
);
gr
.
allblobs
.
(
fname
)
=
srot
(:,
:,
included
);
case
'detector'
num_dets
=
numel
(
gr
.
allblobs
.
detector
);
for
ii_d
=
1
:
num_dets
subfnames
=
fieldnames
(
gr
.
allblobs
.
detector
(
ii_d
));
for
ii_sf
=
1
:
numel
(
subfnames
)
subfname
=
subfnames
{
ii_sf
};
prop
=
gr
.
allblobs
.
detector
(
ii_d
)
.
(
subfname
);
prop
(
refgr_omind_ind
,
:)
=
prop
(
gr_omind_ind
,
:);
gr
.
allblobs
.
detector
(
ii_d
)
.
(
subfname
)
=
prop
(
included
,
:);
end
fnames
=
fieldnames
(
gr
.
allblobs
);
for
ii_f
=
1
:
numel
(
fnames
)
fname
=
fnames
{
ii_f
};
switch
(
fname
)
case
'srot'
srot
=
gr
.
allblobs
.
(
fname
);
srot
(:,
:,
refgr_omind_ind
)
=
srot
(:,
:,
gr_omind_ind
);
gr
.
allblobs
.
(
fname
)
=
srot
(:,
:,
included
);
case
'detector'
num_dets
=
numel
(
gr
.
allblobs
.
detector
);
for
ii_d
=
1
:
num_dets
subfnames
=
fieldnames
(
gr
.
allblobs
.
detector
(
ii_d
));
for
ii_sf
=
1
:
numel
(
subfnames
)
subfname
=
subfnames
{
ii_sf
};
prop
=
gr
.
allblobs
.
detector
(
ii_d
)
.
(
subfname
);
prop
(
refgr_omind_ind
,
:)
=
prop
(
gr_omind_ind
,
:);
gr
.
allblobs
.
detector
(
ii_d
)
.
(
subfname
)
=
prop
(
included
,
:);
end
otherwise
prop
=
gr
.
allblobs
.
(
fname
);
prop
(
refgr_omind_ind
,
:)
=
prop
(
gr_omind_ind
,
:
);
gr
.
allblobs
.
(
fname
)
=
prop
(
include
d
,
:);
end
end
otherwise
prop
=
gr
.
allblobs
.
(
fname
);
prop
(
refgr_omind_ind
,
:)
=
prop
(
gr_omind_in
d
,
:);
gr
.
allblobs
.
(
fname
)
=
prop
(
included
,
:);
end
end
% Taking care of FwdSim/Reconstruction fields
if
(
isfield
(
gr
,
'ondet'
))
ondet_logical
=
false
(
numel
(
gr_omind
),
1
);
ondet_logical
(
gr
.
ondet
)
=
true
;
included_logical
=
false
(
numel
(
gr_omind
),
1
);
included_logical
(
gr
.
ondet
(
gr
.
included
))
=
true
;
selected_logical
=
false
(
numel
(
gr_omind
),
1
);
selected_logical
(
gr
.
ondet
(
gr
.
included
(
gr
.
selected
)))
=
true
;
% Taking care of FwdSim/Reconstruction fields
if
(
isfield
(
gr
,
'ondet'
))
ondet_logical
=
false
(
numel
(
gr_omind
),
1
);
ondet_logical
(
gr
.
ondet
)
=
true
;
included_logical
=
false
(
numel
(
gr_omind
),
1
);
included_logical
(
gr
.
ondet
(
gr
.
included
))
=
true
;
selected_logical
=
false
(
numel
(
gr_omind
),
1
);
selected_logical
(
gr
.
ondet
(
gr
.
included
(
gr
.
selected
)))
=
true
;
ondet_logical
(
refgr_omind_ind
)
=
ondet_logical
(
gr_omind_ind
);
included_logical
(
refgr_omind_ind
)
=
included_logical
(
gr_omind_ind
);
selected_logical
(
refgr_omind_ind
)
=
selected_logical
(
gr_omind_ind
);
included_pos
=
zeros
(
numel
(
gr_omind
),
1
);
included_pos
(
included_logical
)
=
1
:
numel
(
gr
.
included
);
gr
.
ondet
=
find
(
ondet_logical
);
gr
.
included
=
find
(
included_logical
(
gr
.
ondet
));
gr
.
selected
=
selected_logical
(
gr
.
ondet
(
gr
.
included
));
elseif
(
isfield
(
gr
,
'proj'
)
&&
isfield
(
gr
.
proj
,
'ondet'
))
ondet_logical
=
false
(
numel
(
gr_omind
),
1
);
ondet_logical
(
gr
.
proj
.
ondet
)
=
true
;
included_logical
=
false
(
numel
(
gr_omind
),
1
);
included_logical
(
gr
.
proj
.
ondet
(
gr
.
proj
.
included
))
=
true
;
selected_logical
=
false
(
numel
(
gr_omind
),
1
);
selected_logical
(
gr
.
proj
.
ondet
(
gr
.
proj
.
included
(
gr
.
proj
.
selected
)))
=
true
;
ondet_logical
(
refgr_omind_ind
)
=
ondet_logical
(
gr_omind_ind
);
included_logical
(
refgr_omind_ind
)
=
included_logical
(
gr_omind_ind
);
selected_logical
(
refgr_omind_ind
)
=
selected_logical
(
gr_omind_ind
);
ondet_logical
(
refgr_omind_ind
)
=
ondet_logical
(
gr_omind_ind
);
included_logical
(
refgr_omind_ind
)
=
included_logical
(
gr_omind_ind
);
selected_logical
(
refgr_omind_ind
)
=
selected_logical
(
gr_omind_ind
);
included_pos
(
refgr_omind_ind
)
=
included_pos
(
gr_omind_ind
);
gr
.
proj
.
ondet
=
find
(
ondet_logical
);
gr
.
proj
.
included
=
find
(
included_logical
(
gr
.
proj
.
ondet
));
gr
.
proj
.
selected
=
selected_logical
(
gr
.
proj
.
ondet
(
gr
.
proj
.
included
));
end
end
\ No newline at end of file
gr
.
ondet
=
find
(
ondet_logical
);
gr
.
included
=
find
(
included_logical
(
gr
.
ondet
));
gr
.
selected
=
selected_logical
(
gr
.
ondet
(
gr
.
included
));
included_pos
=
included_pos
(
gr
.
ondet
(
gr
.
included
));
elseif
(
isfield
(
gr
,
'proj'
)
&&
isfield
(
gr
.
proj
,
'ondet'
))
ondet_logical
=
false
(
numel
(
gr_omind
),
1
);
ondet_logical
(
gr
.
proj
.
ondet
)
=
true
;
included_logical
=
false
(
numel
(
gr_omind
),
1
);
included_logical
(
gr
.
proj
.
ondet
(
gr
.
proj
.
included
))
=
true
;
selected_logical
=
false
(
numel
(
gr_omind
),
1
);
selected_logical
(
gr
.
proj
.
ondet
(
gr
.
proj
.
included
(
gr
.
proj
.
selected
)))
=
true
;
included_pos
=
zeros
(
numel
(
gr_omind
),
1
);
included_pos
(
included_logical
)
=
1
:
numel
(
gr
.
proj
.
included
);
ondet_logical
(
refgr_omind_ind
)
=
ondet_logical
(
gr_omind_ind
);
included_logical
(
refgr_omind_ind
)
=
included_logical
(
gr_omind_ind
);
selected_logical
(
refgr_omind_ind
)
=
selected_logical
(
gr_omind_ind
);
included_pos
(
refgr_omind_ind
)
=
included_pos
(
gr_omind_ind
);
gr
.
proj
.
ondet
=
find
(
ondet_logical
);
gr
.
proj
.
included
=
find
(
included_logical
(
gr
.
proj
.
ondet
));
gr
.
proj
.
selected
=
selected_logical
(
gr
.
proj
.
ondet
(
gr
.
proj
.
included
));
included_pos
=
included_pos
(
gr
.
proj
.
ondet
(
gr
.
proj
.
included
));
end
if
(
isfield
(
gr
,
'proj'
)
&&
isfield
(
gr
.
proj
,
'bl'
))
gr
.
proj
.
bl
=
gr
.
proj
.
bl
(
included_pos
);
gr
.
proj
.
stack
=
gr
.
proj
.
stack
(:,
included_pos
,
:);
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