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
dfc33e6c
Commit
dfc33e6c
authored
8 years ago
by
Nicola Vigano
Browse files
Options
Downloads
Patches
Plain Diff
gtPlaceSubVolume: temporary workaround for the breakage of the C++ functions
Signed-off-by:
Nicola Vigano
<
nicola.vigano@esrf.fr
>
parent
6b6d40f7
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_Imaging/gtPlaceSubVolume.m
+9
-16
9 additions, 16 deletions
zUtil_Imaging/gtPlaceSubVolume.m
with
9 additions
and
16 deletions
zUtil_Imaging/gtPlaceSubVolume.m
+
9
−
16
View file @
dfc33e6c
...
...
@@ -28,7 +28,7 @@ function output = gtPlaceSubVolume(output, input, shift, index, assign_op, use_c
% all the voxels will have value of the index
if
(
~
exist
(
'use_c_functions'
,
'var'
)
||
isempty
(
use_c_functions
))
use_c_functions
=
tru
e
;
use_c_functions
=
fals
e
;
end
if
(
~
exist
(
'index'
,
'var'
)
||
isempty
(
index
))
index
=
0
;
...
...
@@ -136,6 +136,7 @@ function output = place_sub_volume(output, input, shift, assign_op, use_c_functi
output
=
logical
(
output
);
end
else
% please keep them around, in case you break the C function
input
=
input
(
...
inLims
(
1
,
1
):
inLims
(
2
,
1
),
...
inLims
(
1
,
2
):
inLims
(
2
,
2
),
...
...
...
@@ -153,32 +154,24 @@ function output = place_sub_volume(output, input, shift, assign_op, use_c_functi
output
=
full_output
(:,
:,
:,
extra_dims_shift
{:});
end
temp_out
=
output
(
lims
(
1
):
lims
(
2
),
lims
(
3
):
lims
(
4
),
lims
(
5
):
lims
(
6
));
switch
(
assign_op
)
case
{
'zero'
,
'conflict'
,
'adaptive'
}
% Matlab sugars to do the same that 'internal_gtAssignGrainToVol_interf'
% does: (please keep them around, in case you break the C function)
temp_out
=
output
(
lims
(
1
):
lims
(
2
),
lims
(
3
):
lims
(
4
),
lims
(
5
):
lims
(
6
));
temp_out
(
temp_out
&
input
)
=
-
1
;
indexes
=
((
temp_out
==
0
)
&
input
);
temp_out
(
indexes
)
=
input
(
indexes
);
output
(
lims
(
1
):
lims
(
2
),
lims
(
3
):
lims
(
4
),
lims
(
5
):
lims
(
6
))
=
temp_out
;
case
'summed'
% Matlab sugar to do the same that 'internal_gtAssignGrainToVol_sum'
% does: (please keep them around, in case you break the C function)
output
(
lims
(
1
):
lims
(
2
),
lims
(
3
):
lims
(
4
),
lims
(
5
):
lims
(
6
))
...
=
output
(
lims
(
1
):
lims
(
2
),
lims
(
3
):
lims
(
4
),
lims
(
5
):
lims
(
6
))
...
+
input
;
temp_out
=
temp_out
+
input
;
case
{
'assign'
,
'parent'
}
% Matlab sugar to do the same that 'internal_gtAssignGrainToVol'
% does: (please keep them around, in case you break the C function)
output
(
lims
(
1
):
lims
(
2
),
lims
(
3
):
lims
(
4
),
lims
(
5
):
lims
(
6
))
=
input
;
indexes
=
input
~=
0
;
temp_out
(
indexes
)
=
input
(
indexes
);
otherwise
error
(
'PLACE:wrong_argument'
,
'No option for "%s"'
,
assign_op
);
end
output
(
lims
(
1
):
lims
(
2
),
lims
(
3
):
lims
(
4
),
lims
(
5
):
lims
(
6
))
=
temp_out
;
if
(
~
isempty
(
extra_dims_shift
))
full_output
(:,
:,
:,
extra_dims_shift
{:})
=
output
;
output
=
full_output
;
...
...
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