Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DeProj
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
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
IAH public
DeProj
Commits
2633fda0
Commit
2633fda0
authored
5 years ago
by
Jean-Yves TINEVEZ
Browse files
Options
Downloads
Patches
Plain Diff
Refactor center point into a function.
parent
7ba91408
No related branches found
No related tags found
1 merge request
!9
Rework the whole code for the upcoming publication.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/area3d.m
+2
-6
2 additions, 6 deletions
src/area3d.m
src/centered_points.m
+12
-0
12 additions, 0 deletions
src/centered_points.m
with
14 additions
and
6 deletions
src/area3d.m
+
2
−
6
View file @
2633fda0
...
@@ -3,15 +3,11 @@ function [ area, uncorr_area ] = area3d( o )
...
@@ -3,15 +3,11 @@ function [ area, uncorr_area ] = area3d( o )
%% Deprojected 3D version.
%% Deprojected 3D version.
p
=
o
.
boundary
;
% Put all vertex coordinates with respect to center.
p
=
centered_points
(
o
);
n_vertices
=
size
(
p
,
1
);
n_vertices
=
size
(
p
,
1
);
% Put all vertex coordinates with respect to center.
center
=
mean
(
p
);
center
=
repmat
(
center
,
[
n_vertices
,
1
]
);
p
=
p
-
center
;
% Build small triangles.
% Build small triangles.
index
=
[
2
:
n_vertices
1
];
index
=
[
2
:
n_vertices
1
];
p1
=
p
;
p1
=
p
;
...
...
This diff is collapsed.
Click to expand it.
src/centered_points.m
0 → 100644
+
12
−
0
View file @
2633fda0
function
p
=
centered_points
(
o
)
%CENTERED_POINTS Returns the 3D coordinates of the object bounds, with
%respect to its center.
p
=
o
.
boundary
;
n_vertices
=
size
(
p
,
1
);
center
=
mean
(
p
);
center
=
repmat
(
center
,
[
n_vertices
,
1
]
);
p
=
p
-
center
;
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