# Function iasedisk

namespace: morph iasedisk

# Synopse

Create a disk or a semi-sphere structuring element.

• B = iasedisk(r=3, DIM="2D", METRIC="EUCLIDEAN", FLAT="FLAT", h=0)
• B: Structuring Element
• DIM: String '1D', '2D, or '3D'.
• METRIC: String 'EUCLIDEAN', ' CITY-BLOCK', 'OCTAGON', or ' CHESSBOARD'.
• FLAT: String 'FLAT' or 'NON-FLAT'.
• h: Double Elevation of the center of the semi-sphere.

# Description

iasedisk creates a flat structuring element B that is disk under the metric METRIC , centered at the origin and with radius r or a non-flat structuring element that is a semi-sphere under the metric METRIC, centered at (0, h) and with radius r. This structuring element can be created on the 1D, 2D or 3D space.

# Examples

## Example 1

```01. from ia870 import iasedisk
02. from ia870 import iaseshow
03.
04.
05. a=iaseshow( iasedisk(10,'2D','CITY-BLOCK'))
06. b=iaseshow( iasedisk(10,'2D','EUCLIDEAN'))
07. c=iaseshow( iasedisk(10,'2D','OCTAGON'))
08. iashow(a)
09. iashow(b)
10. iashow(c)```

## Example 2

```1. d=iaseshow( iasedisk(10,'2D','CITY-BLOCK','NON-FLAT'))
2. e=iaseshow( iasedisk(10,'2D','EUCLIDEAN','NON-FLAT'))
3. f=iaseshow( iasedisk(10,'2D','OCTAGON','NON-FLAT'))
4. iashow(d)
5. iashow(e)
6. iashow(f)```
```Warning: downcasting image from int32 to uint16 (may lose precision)
Warning: downcasting image from int32 to uint16 (may lose precision)
Warning: downcasting image from int32 to uint16 (may lose precision)
```

## Example 3

```1. g=iasedisk(3,'2D','EUCLIDEAN','NON-FLAT')
2. print iaseshow(g)
3.
4. h=iasedisk(3,'2D','EUCLIDEAN','NON-FLAT',5)
5. print iaseshow(h)```
```[[-2147483647 -2147483647           1           1           1 -2147483647
-2147483647]
[-2147483647           2           2           2           2           2
-2147483647]
[          1           2           3           3           3           2
1]
[          1           2           3           3           3           2
1]
[          1           2           3           3           3           2
1]
[-2147483647           2           2           2           2           2
-2147483647]
[-2147483647 -2147483647           1           1           1 -2147483647
-2147483647]]
[[-2147483647 -2147483647           6           6           6 -2147483647
-2147483647]
[-2147483647           7           7           7           7           7
-2147483647]
[          6           7           8           8           8           7
6]
[          6           7           8           8           8           7
6]
[          6           7           8           8           8           7
6]
[-2147483647           7           7           7           7           7
-2147483647]
[-2147483647 -2147483647           6           6           6 -2147483647
-2147483647]]
```

## Example 3D da toolbox morph

```1. g = mmsedisk(1,'3D','CITY-BLOCK')
2. print mmseshow(g)```
```[[[False False False]
[False  True False]
[False False False]]

[[False  True False]
[ True  True  True]
[False  True False]]

[[False False False]
[False  True False]
[False False False]]]
```