Below is a demonstration of the features of the getInnerPoint function


clear; close all; clc;


% |[varargout]=getInnerPoint(varargin);|


This function computes an arbitrary interior point for the input geometry. The function uses patch2Im to convert the geometry to an image description. Next the interior voxel set is convolution with a spherical kernel of a desired size. An interior point is then chosen based on the location with the maximum output in the convoluted image. In plainer English this means that an attempt is made to find a point that is inside the geometry and approximately the spherical kernel radius offset inwards from the boundary. Input consists of the faces F, the vertices V, the searchRadius (kernel radius), the voxelSize, and a plotting option plotOn. The voxel size should be shall enough such that interior (and not just boundary) voxels can be found. Interior voxels and fully inside the geometry and do not touch the boundary.

Plot settings



Example 1: Basic use to find an arbitrary point inside the input geometry

Create example geometry

switch testCase
    case 1
    case 2
    case 3

Find interior point using default settings

subplot(1,2,1); hold on;
axisGeom; camlight headlight;

subplot(1,2,2); hold on;
axisGeom; camlight headlight;

Example: using full input/output set

D=patchEdgeLengths(F,V); %Get edge lengths
voxelSize=mean(D)/2; %Set voxel size as half of the mean edge length
searchRadius=3*voxelSize; %Use 3 voxel search radius

Visualize geometry interior/boundary label image


Visualize geometry convoluted interior image

sv3(ML,voxelSize); colormap gjet;


Kevin Mattheus Moerman, [email protected]

GIBBON footer text


GIBBON: The Geometry and Image-based Bioengineering add-On. A toolbox for image segmentation, image-based modeling, meshing, and finite element analysis.

Copyright (C) 2006-2022 Kevin Mattheus Moerman and the GIBBON contributors

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see