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
7673ed54
Commit
7673ed54
authored
10 years ago
by
Nicola Vigano
Browse files
Options
Downloads
Patches
Plain Diff
6G-Reconstruction/VolumeDownscaling: moved to linear interpolation for the upscaling
Signed-off-by:
Nicola Vigano
<
nicola.vigano@esrf.fr
>
parent
21013ec7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
zUtil_Deformation/Gt6DReconstructionAlgorithmFactory.m
+1
-1
1 addition, 1 deletion
zUtil_Deformation/Gt6DReconstructionAlgorithmFactory.m
zUtil_Maths/gtMathsUpsampleVolume.m
+20
-1
20 additions, 1 deletion
zUtil_Maths/gtMathsUpsampleVolume.m
with
21 additions
and
2 deletions
zUtil_Deformation/Gt6DReconstructionAlgorithmFactory.m
+
1
−
1
View file @
7673ed54
...
...
@@ -214,7 +214,7 @@ classdef Gt6DReconstructionAlgorithmFactory < handle
end
if
(
self
.
volume_downscaling
>
1
)
volume_size
=
round
(
volume_size
/
self
.
volume_downscaling
);
volume_size
=
ceil
(
volume_size
/
self
.
volume_downscaling
);
for
ii
=
1
:
num_geoms
geometries
{
ii
}(:,
4
:
12
)
=
geometries
{
ii
}(:,
4
:
12
)
/
self
.
volume_downscaling
;
end
...
...
This diff is collapsed.
Click to expand it.
zUtil_Maths/gtMathsUpsampleVolume.m
+
20
−
1
View file @
7673ed54
...
...
@@ -6,11 +6,12 @@ function vol = gtMathsUpsampleVolume(vol, scale)
vol
{
ii
}
=
gtMathsUpsampleVolume
(
vol
{
ii
},
scale
);
end
else
vol
=
upsample
(
vol
,
scale
);
vol
=
upsample
_interp_interleaving
(
vol
,
scale
);
end
end
function
vol
=
upsample
(
vol
,
scale
)
% The fastest!
vol_in_size
=
size
(
vol
);
for
ii_dim
=
numel
(
vol_in_size
):
-
1
:
1
indx
{
ii_dim
}
=
1
:
vol_in_size
(
ii_dim
);
...
...
@@ -19,3 +20,21 @@ function vol = upsample(vol, scale)
end
vol
=
vol
(
indx
{:});
end
function
vol
=
upsample_interp_interleaving
(
vol
,
scale
)
% Faster than the custom made, bu still way slower than the simple one
vol
=
interpn
(
vol
,
scale
-
1
,
'linear'
,
0
);
end
function
vol
=
upsample_interp
(
vol
,
scale
)
% It does exactly what the interleaving does, but it is here as a tutorial
% for future reerence
vol_in_size
=
size
(
vol
);
num_dims
=
numel
(
vol_in_size
);
for
ii_dim
=
num_dims
:
-
1
:
1
indx_out
{
ii_dim
}
=
1
:(
1
/
scale
):
vol_in_size
(
ii_dim
);
end
grid_out
=
cell
(
1
,
num_dims
);
[
grid_out
{:}]
=
ndgrid
(
indx_out
{:});
vol
=
interpn
(
vol
,
grid_out
{:},
'linear'
);
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