- Just make a filter of ones that has a 3x3x3x3x3.... (n-dimensions) and divide that by numel(filter).
- Use ffts or imfilter or something similar to run this filter over your image.
- Find the locations that have values near your isovalue. (TADA)
Extracting iso-surface in n dimensional space
6 views (last 30 days)
[f,v] = isosurface(X,Y,Z,V,isovalue) extracts the iso-surface of value 'isovalue' and vertices are stored in 'v'. Above function works only in 3-D space.But can some one let me know how to do the same for n-dimensional space. I have a 10-dimensional spaces and I need to extract the vertices of the iso-surface. Any help would be appreciated. Thanks
Ahmet Cecen on 25 Mar 2018
Edited: Ahmet Cecen on 25 Mar 2018
You can actually get a semi-accurate pixelized estimation of this very fast (O(nlogn)) regardless of dimensions using a mean filter (which assumes linear interpolation). I would prefer this especially if your 10D space is large and pixelized dimensions are not causing much of an error.
If you wanted to be more accurate, you can instead start by converting your entire n-d space into an adjacency matrix, and operate on a 2D graph instead. This will enable you to systematically locate actual coordinate intersects for the isosurface by traversing the graph only at the locations near the isovalue. O(n^2) ish
John D'Errico on 25 Mar 2018
You won't do this easily. It would be a significant computational effort. No, there is no code that I know of (in the public domain) that would do this.
isosurface takes an array in 3 dimensions, then looks for places where the iso-level crosses through cells of the array.
Suppose you start with a 20x20x20 array, in 3-d. Much smaller than that, and the linear interpolation just won't be adequate.
But in 10 dimensions? How many cells are there in a 20^10 array?
So something like 6 trillion cells to investigate. Yes, you can do things where you chase the surface across the domain. Do some reading about marching cubes on line. The link will get you started. Regardless, in 10 dimensions, it will get complex, and still VERY time consuming.
A common way of doing the linear interpolation across a cell in R^n would be to dissect the n-cube into simplices. And, well, you will need to determine how the surface passes through a given hypercube. A simplicial dissection of the hypercube allows you to do exactly that.
In two dimensions, we would dissect a square into two triangles. In three dimensions, a unit cube gets dissected into 6 tetrahedra. In n-dimensions, we dissect a unit hypercube into factorial(n) simplexes.
So this becomes a huge problem very fast, growing exponentially with dimension, because you will be chasing a surface through a lattice in 10 dimensions, and inside each hypercube of that lattice, you will need to chase the surface through hundreds of thousands of simplexes.
In fact, I played around with similar problems in lower dimensions. Typically I found that my code started to get bogged down when I went past 6 dimensions, and even an iso-surface on a 6-dimensional lattice that was only 8x8x8x8x8x8, so of size 8^6 was barely tractable. Yes, that was at least 15 years ago. I was unable to solve a similar problem in 7 dimensions at that time, but I was also uninterested in going as far as 10 dimensions then. Computers are faster now, so I might be able to go further now, and I have gained more experience in the area since. And maybe you are better at writing MATLAB code than I am.