ImageMorphology in 3D

Hey,

I want to use the ImageMorphology function to determine the volume that is located within a certain range of a given volume. For this I tried the following code, which already worked in 2D when omitting /Z=(C1):



Both waves (wave1 and wave2) have 3 dimensions and are of type unsigned 8bit with values of either 0 or 255. Wave2 contains an amorph distribution of 255 voxels, while wave1 contains a sphere. Normally this should provide an output wave M_ImageMorph that contains the structure in wave2 dilated by the radius of the sphere provided with wave1. However the following error is returned:



Am I doing something wrong or is the ImageMorphology function not yet able to work in 3D?

Thanks for your help,

Cheers Finn
I have put code and error message in brackets which somehow hides the text. So once again:

code:
ImageMorphology/S=wave1/X=(C1)/Y=(C1)/Z=(C1) binarydilation wave2

error message:
ImageMorphology, the follwoing error occurred: This feature is not yet implemented.
ImageMorphology/S=wave1/X=(C1)/Y=(C1)/Z=(C1) binarydilation wave2
 
ImageMorphology, the follwoing error occurred: This feature is not yet implemented.


You seem to have omitted the /E=id flag appropriate for the non-default dimensionality of the ImageMatrix.


[quote=finn]I have put code and error message in brackets which somehow hides the text.[/quote]
Text within angle brackets, which you used in your original post, is likely to be removed by the system unless that text is a valid HTML tag.

You can either use the HTML escape characters for the angle brackets (&amp;lt; and &amp;gt;) or you can surround your Igor code in <igor></igor> brackets.
Hi,

thanks for your replies. I rather prefer to provide a user-defined structure using the S-flag instead of the E-flag. However, even when using the E-flag it produces the same error.

e.g. this code doesnt work neither.
ImageMorphology/E=200 binarydilation W1

Using a 2D-wave both versions work properly. It seems that 3D doesnt work.

Best regards,

Finn
[quote]

thanks for your replies. I rather prefer to provide a user-defined structure using the S-flag instead of the E-flag. However, even when using the E-flag it produces the same error.

e.g. this code doesnt work neither.
ImageMorphology/E=200 binarydilation W1

Using a 2D-wave both versions work properly. It seems that 3D doesnt work.
[/quote]

If you intend to work with a 3D wave it might be a good start to use a 3D structure element. All 3D structure elements start at id=300.

A.G.
WaveMetrics, Inc.
Hey,

according to the manual Id=200 is a 3d 2x2x2 cube. However as you proposed I just tried it with id=300 (code as in "function test3D()"). But it does not work. On the other hand the 2D-version ("function test2D()") works fine.

In case there is no solution, I have now written a work-around. It is quite slow but works ok. Thanks anyways for your suggestions.

Cheers,
Finn

Function test3D()
Make/B/U/O/N=(11,11,11) wave1
wave1[5][5][5]=255
ImageMorphology/E=300 binarydilation wave1
End

Function test2D()
Make/B/U/O/N=(11,11) wave1
wave1[5][5]=255
ImageMorphology/E=4 binarydilation wave1
End


[quote=finn]Hey,

according to the manual Id=200 is a 3d 2x2x2 cube. However as you proposed I just tried it with id=300 (code as in "function test3D()"). But it does not work. On the other hand the 2D-version ("function test2D()") works fine.
[/quote]

According to the manual: "Erosion, Dilation, Opening and Closing are the only methods supported for 3D " so naturally binarydilation would return an error.

A.G.
WaveMetrics, Inc.
Ok now it works. Thank you very much! I overlooked that I have to take dilation instead of binarydilation for that.

Best regards,

Finn