Azzera filtri
Azzera filtri

3D dilation of a nifti file

3 visualizzazioni (ultimi 30 giorni)
elisa scaccianoce
elisa scaccianoce il 22 Ago 2013
Hi, I`m trying to manipulate a nifti file. In particular I have a 3D spot that I dilated with the function imdilate(), but I saw that it works only in 2 dimensions (x and y plans). Is there a function that does the same in 3 dimensions?
Thank you
elisa

Risposte (1)

Mark
Mark il 26 Ago 2013
imgDilated = imdilate( img, structuringElement )
If you use a 3D array as a structuring element (for example, ones(3,3,3)), imdilate will work on 3D images (see http://www.mathworks.com/matlabcentral/newsreader/view_thread/66040).
I don't know whether it is possible to create a structuring element in 3D using the function strel. This is not in the documentation, so I doubt it. But it's not very difficult to make your own '3D-ball-shaped' structuring element. (Please note that strel('ball',N,R) is not a 3D-ball in this sense: it just refers to the fact that the generated structuring element is not 'flat', but has height differences).
Mark

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by