Rank: 107 based on 739 downloads (last 30 days) and 16 files submitted
photo

Sven

E-mail
Company/University
University of Michigan

Personal Profile:

Aussie living in the US. Engineering with MATLAB.

Some Interests:
-3D Volume Processing (CT, mri)
-Finite Element Analysis (human body simulation)
-Geometry Analysis (human body morphomics)

Professional Interests:
Image processing, Finite Element Analysis, Human Body Biomechanics

 

Watch this Author's files

 

Files Posted by Sven View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
05 Sep 2014 Screenshot octree - partitioning 3D points into spatial subvolumes OcTree recursively splits a large set of points into smaller subvolumes. A QuadTree but in 3D. Author: Sven stl, space, volume, quadtree, octree, tree 72 19
  • 4.85714
4.9 | 7 ratings
24 Jun 2014 Screenshot splitFV - split a mesh Splits a 2D or 3D mesh defined by faces and vertices into separately connected mesh pieces. Author: Sven mesh, separate, split, stl, faces, vertices 13 4
  • 5.0
5.0 | 4 ratings
01 May 2014 Screenshot interpmask - interpolate (tween) logical masks interpmask interpolates (or tweens) masks to transition smoothly between shapes in masks Author: Sven mask, interp1, interpolation, distance, tween, inbetween 16 0
01 May 2014 Screenshot mpoly2mask - converts multiple polygons to a mask Converts an object with multiple boundary contours to a logical mask Author: Sven poly2mask, bwboundaries, polygon, multiple, mask, logical 29 1
  • 5.0
5.0 | 1 rating
07 Mar 2014 Screenshot dbarray - pack and unpack database arrays to matlab arrays dbarray lets you directly send/fetch array[] type database fields into native MATLAB variables Author: Sven database, array, multidimensional, connection 22 0
Comments and Ratings by Sven View all
Updated File Comments Rating
30 Oct 2014 octree - partitioning 3D points into spatial subvolumes OcTree recursively splits a large set of points into smaller subvolumes. A QuadTree but in 3D. Author: Sven

Hi Jonathan,

I haven't implemented specifically a nearest neighbour routine. You could use OcTree to find which bin your query location belongs to, and then find the nearest neighbour within that bin. This will be faster than querying all points in a large point cloud, however this alone won't guarantee correctness (since a point in an adjacent bin may be closer) unless the distance to the found nearest neighbour is less than the distance from your query point to any edges of its bin.

Did that help you out? If your point cloud isn't massive (or even if it is), John D'Errico's ipdm is pretty efficient, and there are some nearest neighbour kdtree implementations that may be helpful too.

30 Sep 2014 octree - partitioning 3D points into spatial subvolumes OcTree recursively splits a large set of points into smaller subvolumes. A QuadTree but in 3D. Author: Sven

Hi Christophe, for your second question, you can force the decomposition to go to a specific level with the optional parameters:
OT = OcTree(pts,'binCapacity',inf,'maxDepth',3,'maxSize',0);

The OT will still contain the higher levels above that, but you can easily get only the desired level bins with a mask such as:
OT.BinDepths==2

For the neighbours that's an interesting question. It will be easy to find the 3 "siblings" of a given bin (they will be the same level and have the same parent bin No. as that bin). It might need a bit more work to find all neighbours... what exactly would you define as a neighbour? Can only "leaf-node" bins be neighbours or do you include any level's bin that shares a face with your target a neighbour?

05 Sep 2014 octree - partitioning 3D points into spatial subvolumes OcTree recursively splits a large set of points into smaller subvolumes. A QuadTree but in 3D. Author: Sven

@Jing: Yep, thanks for finding that bug. Fixed now.

05 Sep 2014 octree - partitioning 3D points into spatial subvolumes OcTree recursively splits a large set of points into smaller subvolumes. A QuadTree but in 3D. Author: Sven

@Wu Jun: It's strange but QuadTree decomposition in images is a different beast to QuadTree decomposition of 2d points, but they both have the same name. I'm afraid it's the same situation for OcTree decomposition (of image volumes vs 3d points). OcTree.m is targeted at points rather than image volume data.

05 Sep 2014 octree - partitioning 3D points into spatial subvolumes OcTree recursively splits a large set of points into smaller subvolumes. A QuadTree but in 3D. Author: Sven

@Greg: (sorry for the late reply) This is best done *after* plotting the bins. You can just find which bins don't contain a point and then delete or deactivate that bin's plot handle:

% Run example 1 and then:
binHasPts = ismember(1:OT.BinCount, OT.PointBins)
set(boxH(~binHasPts),'Visible','off')

Comments and Ratings on Sven's Files View all
Updated File Comment by Comments Rating
30 Oct 2014 octree - partitioning 3D points into spatial subvolumes OcTree recursively splits a large set of points into smaller subvolumes. A QuadTree but in 3D. Author: Sven Sven

Hi Jonathan,

I haven't implemented specifically a nearest neighbour routine. You could use OcTree to find which bin your query location belongs to, and then find the nearest neighbour within that bin. This will be faster than querying all points in a large point cloud, however this alone won't guarantee correctness (since a point in an adjacent bin may be closer) unless the distance to the found nearest neighbour is less than the distance from your query point to any edges of its bin.

Did that help you out? If your point cloud isn't massive (or even if it is), John D'Errico's ipdm is pretty efficient, and there are some nearest neighbour kdtree implementations that may be helpful too.

27 Oct 2014 Growbubbles - maximum radius packing Growbubbles takes centroid points and returns the maximum radius circles or spheres without overlap Author: Sven Meng, Jingjing

perfect

19 Oct 2014 mpoly2mask - converts multiple polygons to a mask Converts an object with multiple boundary contours to a logical mask Author: Sven Craig

Thanks very much Sven for a very useful code. I'm using it to convert polygons from shapefiles into raster masks for extracting pixels from GeoTIFF files. mpoly2mask is about 100 times faster than anything I came up with.

10 Oct 2014 octree - partitioning 3D points into spatial subvolumes OcTree recursively splits a large set of points into smaller subvolumes. A QuadTree but in 3D. Author: Sven Jonathan

Hello Sven,
I would like to use your Octree code in order to find the N closest point of an arbitrary position in my domain. I was using the quedtree code on the Matlab File Exchange but now that I am going to 3D, I would like to use your code for this for a fast localisation of neighbour points of a specific coordinates. Is it something already possible with your code? I found the OT.query function but this is not exactly what I want to do. Any idea of I can make it from your code? Thank you very much anyway for your great code. Best regards,Jonathan

04 Oct 2014 octree - partitioning 3D points into spatial subvolumes OcTree recursively splits a large set of points into smaller subvolumes. A QuadTree but in 3D. Author: Sven Xi, Zhouxin

Contact us