Displaying a 3D structuring element with isosurface
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I want to create some 3D structuring elements (such as an oblate spheroid) to use with imdilate. I'd like to see them with isosurface and I've tried the examples in the isosurface documentation, e.g.,
BW = false(100,100,100);
BW(25,25,25) = true;
BW(75,75,75) = true;
se = strel('sphere',25);
dilatedBW = imdilate(BW,se);
figure
isosurface(dilatedBW);
which works just fine:
However, if I make the sphere smaller (se = strel('sphere',20);) then the figure shows nothing:
(even if I change the all the axis ranges to 1:100.) In fact, any sphere smaller than 24 does not display, but larger spheres (30, for example) display properly. In a similar vein, if I start with just one initial point in BW and dilate, some initial points display properly (BW(25,25,25) = true;) but others (BW(50,50,50) = true;) don't! I've tried changing the colormaps, adjusting the axis ranges - what an I missing?
(Using version 2016a)
Thanks for any advice ...
0 Commenti
Risposte (1)
Carl
il 3 Apr 2017
Modificato: Carl
il 3 Apr 2017
This seems to be a bug with the 'isosurface' function. If you run the following code,
fv = isosurface(dilatedBW)
You can see that the output matrices are empty when the figure shows nothing. This is why changing the axes and other display elements are not solving the issue - the 'isosurface' function is not returning the isosurface data in the first place.
I have submitted this issue to its respective MathWorks development team.
2 Commenti
Carl
il 5 Apr 2017
Modificato: Carl
il 5 Apr 2017
I'd like to amend my previous answer. It turns out calling 'isosurface' without providing an isovalue is not the recommended workflow (although, as you saw, it does show up in some examples). When you do not provide an isovalue, the function will try to determine one for you, and this might not always work as desired.
The following code, with an isovalue provided, should graph the surface correctly:
se = strel('sphere',20);
isosurface(dilatedBW, 0.5)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!