ImageMorphology in 3D
finn
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
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.
October 11, 2012 at 08:41 am - Permalink
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.October 11, 2012 at 09:16 am - Permalink
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 (
<
and>
) or you can surround your Igor code in <igor></igor> brackets.October 11, 2012 at 10:51 am - Permalink
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
October 12, 2012 at 08:11 am - Permalink
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.
October 12, 2012 at 03:26 pm - Permalink
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
October 15, 2012 at 01:32 am - Permalink
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.
October 16, 2012 at 11:29 am - Permalink
Best regards,
Finn
October 18, 2012 at 01:36 am - Permalink