+
    /i                       ^ RI t^ RIHtHtHtHtHtHtH	t	 ^ RI
t
^ RI
Ht ^ RIHt ^RIHt ]
P"                  P$                  t]
P"                  P&                  t ! R R4      t]! ]P*                  ]P,                  4       ! R R	4      4       t]! ]P0                  ]P2                  4       ! R
 R4      4       t]! ]P6                  4      R 4       t]! ]P*                  4      R 4       t]! ]P0                  4      R 4       t]! ]P2                  4      R 4       t]! RRR7      ]! ]P6                  4      R 4       4       t ]! RR.RR7      ]! RRR7      ]
P"                  PC                  R]	! ]P6                  4      ]	! ]P*                  4      ]	! ]P0                  4      ]	! ]P2                  4      .4      ]
P"                  PC                  R^^.4      ]
P"                  PC                  RRR.4      R 4       4       4       4       4       t"]! RR.RR7      ]! ]PF                  4      R 4       4       t$]! ]PJ                  4      R 4       t&R# )    N)is_cupyis_numpyxp_assert_closexp_assert_equalassert_array_almost_equalmake_xp_test_casemake_xp_pytest_param)raises)ndimage)typesc                   l9  a  ] tR t^t o ]! ]P                  4      ]P                  P                  R]
4      R 4       4       t]! ]P                  4      ]P                  P                  R]
4      R 4       4       t]! ]P                  4      ]P                  P                  R]
4      R 4       4       t]! RRR7      ]! ]P                  4      ]P                  P                  R]
4      R 4       4       4       t]! R	R
R7      ]! ]P                  4      ]P                  P                  R]
4      R 4       4       4       t]! ]P                  4      ]P                  P                  R]
4      R 4       4       t]! ]P                  4      R 4       t]! ]P                  ]P(                  4      ]P                  P                  R]
4      R 4       4       t]! ]P                  ]P(                  4      ]P                  P                  R]
4      R 4       4       t]! RRR7      ]! ]P(                  4      ]P                  P                  R]
4      R 4       4       4       t]! RRR7      ]! ]P(                  4      R 4       4       t]! RRR7      ]! ]P(                  4      ]P                  P                  R]
4      R 4       4       4       t]! R	R
R7      ]! ]P4                  ]P                  4      ]P                  P                  R]
4      R 4       4       4       t]! RRR7      ]! ]P4                  ]P                  4      ]P                  P                  R]
4      R 4       4       4       t]! ]P4                  ]P                  4      ]P                  P                  R]
4      R 4       4       t]! ]P4                  ]P                  4      ]P                  P                  R]
4      R 4       4       t]! R	RR7      ]! ]P4                  4      R 4       4       t]! RRR7      ]! ]P4                  4      R 4       4       t ]! ]PB                  4      R  4       t"]! ]PB                  4      R! 4       t#]! ]PB                  4      R" 4       t$]! ]PB                  4      R# 4       t%]! ]PL                  4      R$ 4       t']! ]PL                  4      R% 4       t(]! ]PL                  4      R& 4       t)]! ]PT                  4      ]P                  P                  R]
4      R' 4       4       t+]! ]PT                  4      ]P                  P                  R]
4      R( 4       4       t,]! ]PT                  4      ]P                  P                  R]
4      R) 4       4       t-]! ]PT                  4      ]P                  P                  R]
4      R* 4       4       t.]! ]PT                  4      ]P                  P                  R]
4      R+ 4       4       t/]! R	R,R7      ]! ]PT                  4      ]P                  P                  R]
4      R- 4       4       4       t0]! ]PT                  4      ]P                  P                  R]
4      R. 4       4       t1]! ]PT                  4      ]P                  P                  R]
4      R/ 4       4       t2]! ]PT                  4      ]P                  P                  R]
4      R0 4       4       t3]! ]PT                  4      ]P                  P                  R]
4      R1 4       4       t4]! ]PT                  4      ]P                  P                  R]
4      R2 4       4       t5]! ]PT                  4      ]P                  P                  R]
4      R3 4       4       t6]! ]PT                  4      ]P                  P                  R]
4      R4 4       4       t7]! ]PT                  4      ]P                  P                  R]
4      R5 4       4       t8]! ]PT                  4      ]P                  P                  R]
4      R6 4       4       t9]! ]PT                  4      ]P                  P                  R]
4      R7 4       4       t:]! ]PT                  4      ]P                  P                  R]
4      R8 4       4       t;]! ]PT                  4      ]P                  P                  R]
4      R9 4       4       t<]! ]PT                  4      ]P                  P                  R]
4      R: 4       4       t=]! ]PT                  4      ]P                  P                  R]
4      R; 4       4       t>]! ]PT                  4      ]P                  P                  R]
4      R< 4       4       t?]! ]PT                  4      ]P                  P                  R]
4      R= 4       4       t@]! ]PT                  4      ]P                  P                  R]
4      R> 4       4       tA]! ]PT                  4      ]P                  P                  R]
4      R? 4       4       tB]! ]PT                  4      ]P                  P                  R]
4      R@ 4       4       tC]! ]PT                  4      ]P                  P                  R]
4      RA 4       4       tD]! ]PT                  4      ]P                  P                  R]
4      RB 4       4       tE]! R	RCR7      ]! ]PT                  4      RD 4       4       tF]! RR	.RERF7      ]! R	RGR7      ]! ]PT                  4      RH 4       4       4       tG]! R	RCR7      ]! ]PT                  4      RI 4       4       tH]! RR	.RERF7      ]! R	RGR7      ]! ]PT                  4      RJ 4       4       4       tI]! RR	.RERF7      ]! ]PT                  4      RK 4       4       tJ]! R	RGR7      ]! ]PT                  4      RL 4       4       tK]! R	RGR7      ]! ]PT                  4      RM 4       4       tL]! ]PT                  4      RN 4       tM]! RR	.RERF7      ]! ]PT                  4      RO 4       4       tN]! R	RGR7      ]! ]PT                  4      RP 4       4       tO]! RR	.RERF7      ]! R	RGR7      ]! ]PT                  4      RQ 4       4       4       tP]! ]PT                  4      RR 4       tQ]! RR	.RERF7      ]! R	RGR7      ]! ]PT                  4      RS 4       4       4       tR]! RR	.RERF7      ]! R	RGR7      ]! ]PT                  4      RT 4       4       4       tS]P                  P                  R]
4      ]! ]P                  4      RU 4       4       tU]P                  P                  R]
4      ]! ]P                  4      RV 4       4       tV]P                  P                  R]
4      ]! ]P                  4      RW 4       4       tW]P                  P                  R]
4      ]! ]P                  4      RX 4       4       tX]P                  P                  R]
4      ]! ]P                  4      RY 4       4       tY]P                  P                  R]
4      ]! ]P                  4      RZ 4       4       tZ]P                  P                  R]
4      ]! ]P                  4      R[ 4       4       t[]P                  P                  R]
4      ]! ]P                  4      R\ 4       4       t\]P                  P                  R]
4      ]! ]P                  4      R] 4       4       t]]P                  P                  R]
4      ]! ]P                  4      R^ 4       4       t^]P                  P                  R]
4      ]! ]P                  4      R_ 4       4       t_]P                  P                  R]
4      ]! ]P                  4      R` 4       4       t`]P                  P                  R]
4      ]! ]P                  4      Ra 4       4       ta]P                  P                  R]
4      ]! ]P                  4      Rb 4       4       tb]P                  P                  R]
4      ]! ]P                  4      Rc 4       4       tc]P                  P                  R]
4      ]! ]P                  4      Rd 4       4       td]P                  P                  R]
4      ]! ]P                  4      Re 4       4       te]P                  P                  R]
4      ]! ]P                  4      Rf 4       4       tf]P                  P                  R]
4      ]! ]P                  4      Rg 4       4       tg]P                  P                  R]
4      ]! ]P                  4      Rh 4       4       th]P                  P                  R]
4      ]! ]P                  4      Ri 4       4       ti]P                  P                  R]
4      ]! ]P                  4      Rj 4       4       tj]P                  P                  R]
4      ]! ]P                  4      Rk 4       4       tk]P                  P                  R]
4      ]! ]P                  4      Rl 4       4       tl]P                  P                  R]
4      ]! ]P                  4      Rm 4       4       tm]P                  P                  R]
4      ]! ]P                  4      Rn 4       4       tn]P                  P                  R]
4      ]! ]P                  4      Ro 4       4       to]P                  P                  R]
4      ]! ]P                  4      Rp 4       4       tp]P                  P                  R]
4      ]! ]P                  4      Rq 4       4       tq]! R	RGR7      ]! ]P                  4      Rr 4       4       tr]! RR	.RsRF7      ]! R	RGR7      ]! ]P                  4      Rt 4       4       4       ts]! R	RGR7      ]! ]P                  4      Ru 4       4       tt]! RR	.RsRF7      ]! R	RGR7      ]! ]P                  4      Rv 4       4       4       tu]! R	RGR7      ]! ]P                  4      Rw 4       4       tv]! RR	.RxRF7      ]! R	RGR7      ]! ]P                  4      Ry 4       4       4       tw]P                  P                  R]
4      ]! ]P                  4      Rz 4       4       tx]! ]P                  4      R{ 4       ty]! ]P                  4      R| 4       t{]! ]P                  4      R} 4       t|]! ]P                  4      R~ 4       t}]! ]P                  4      ]P                  P                  R]
4      R 4       4       t]! ]P                  4      ]P                  P                  R]
4      R 4       4       t]P                  P                  R]
4      ]! ]EP                  4      R 4       4       t]P                  P                  R]
4      ]! ]EP                  4      R 4       4       t]! ]EP                  4      R 4       t]! ]EP                  4      R 4       t]! ]EP                  4      R 4       t]! RR7      ]! R	RR7      ]! RRR7      ]P                  P                  R^ ^.4      ]P                  P                  RRR.4      ]P                  P                  R. RO4      ]P                  P                  R]! ]PT                  4      ]! ]P                  4      ]! ]P                  4      ]! ]EP                  4      ]! ]EP                  4      ]! ]P                  4      ]! ]EP                  4      .4      R 4       4       4       4       4       4       4       t]! ]EP                  4      R 4       t]! RRR7      ]! RRR7      ]! R	RR7      ]! ]EP                  4      R 4       4       4       4       t]! ]EP                  4      R 4       t]! ]EP                  4      R 4       t]! ]EP                   4      R 4       t]! ]EP                   4      R 4       t]! ]EP                   4      R 4       t]! ]EP(                  4      R 4       t]! ]EP(                  4      R 4       t]! ]EP.                  4      R 4       t]! ]EP.                  4      R 4       t]! RRsR7      ]! ]EP                   ]EP                  ]EP4                  4      R 4       4       t]! ]EP                   ]EP                  ]EP4                  4      R 4       t]! RRsR7      ]! ]EP                   ]EP                  ]EP:                  4      R 4       4       t]! ]EP                   ]EP                  ]EP:                  4      R 4       t]! RRR7      ]! RRR7      ]! ]EP(                  ]EP@                  4      R 4       4       4       t]! ]EP(                  ]EP@                  4      R 4       t]! R	RR7      ]! ]EP@                  4      R 4       4       t]! RRR7      ]! RRR7      ]! ]EP@                  4      R 4       4       4       t]! RRR7      ]! RRR7      ]! ]EP.                  ]EPJ                  4      R 4       4       4       t]! ]EP.                  ]EPJ                  4      R 4       t]! R	RR7      ]! ]EPJ                  4      R 4       4       t]! RRR7      ]! RRR7      ]! ]EPJ                  4      R 4       4       4       t]! RR7      ]! R	RR7      ]! RRR7      ]P                  P                  RRR.4      ]P                  P                  R. RO4      ]P                  P                  R. RO4      ]P                  P                  R. RO4      ]P                  P                  R]! ]EP                  4      ]! ]EP                   4      ]! ]EP(                  4      ]! ]EP.                  4      ]! ]EP:                  4      ]! ]EP4                  4      ]! ]EP@                  4      ]! ]EPJ                  4      .4      R 4       4       4       4       4       4       4       4       t]! RR	.RRF7      ]! ]EP                  4      ]P                  P                  R]
4      R 4       4       4       t]! ]EP                  4      ]P                  P                  R]
4      R 4       4       t]! ]EP                  4      ]P                  P                  R]
4      R 4       4       tRtV tR# )TestNdimageMorphologydtypec                   \        W!4      pVP                  . RO. RO. RO. RO. RO. RO. RO. RO. RO.	VR7      p\        P                  ! VRRR7      w  rE. RO. RO. RO. R	O. R
O. R	O. RO. RO. RO.	pVP                  V4      p\	        WD,          V4       . RO. RO. RO. RO. RO. RO. RO. RO. RO.	. RO. RO. RO. RO. RO. RO. RO. RO. RO.	.pVP                  V4      p\	        WV4       R# )r   r   	euclideanTreturn_indicesN	r   r   r   r   r   r   r   r   r   	r   r   r      r   r   r   r   r   	r   r   r   r   r   r   r   r   r   )	r   r   r         r   r   r   r   	r   r   r   r      r   r   r   r   	r   r   r   r   r   r   r   r   r   	r   r   r   r   r   r   r   r   r   	   r    r    r   r   r   r    r    r    	r   r   r   r      r   r   r   r   	   r$   r"   r"      r"   r"   r$   r$   	r"   r"   r"   r%   r%   r%   r"   r"   r"   	r%   r%   r%   r%   r%   r%   r%   r%   r%   	r   r   r   r   r   r   r   r   r   	r   r   r   r    r   r$   r"   r%   r   	r   r   r   r   r   r"   r"   r%   r   	r   r   r   r   r   r"   r%   r%   r   	r   r   r   r   r"   r%   r%   r%   r   getattrasarrayr   distance_transform_bfr   selfr   xpdataoutftexpecteds   &&&    a/var/www/html/photoedit/myenv/lib/python3.14/site-packages/scipy/ndimage/tests/test_morphology.pytest_distance_transform_bf012TestNdimageMorphology.test_distance_transform_bf01   s    " zz6666666668 @E  F //k?CE/////////1 ::h'!#)X60000000002 10000000023$ ::h'!"/    c                   \        W!4      pVP                  . RO. RO. RO. RO. RO. RO. RO. RO. RO.	VR7      p\        P                  ! VRRR7      w  rE. RO. RO. RO. R	O. R
O. R	O. RO. RO. RO.	pVP                  V4      p\	        WF4       . RO. RO. RO. RO. RO. RO. RO. RO. RO.	. RO. RO. RO. RO. RO. RO. RO. RO. RO.	.pVP                  V4      p\	        WV4       R# )r   r   	cityblockTr   Nr   r   r   	r   r   r   r   r   r   r   r   r   )	r   r   r   r   r    r   r   r   r   r   r   )	r    r    r    r    r   r    r    r    r    )	r   r   r   r   r%   r   r   r   r   )	r$   r$   r"   r%   r%   r%   r"   r$   r$   r&   r'   r(   r)   r*   	r   r   r   r   r   r%   r%   r%   r   r-   r1   s   &&&    r8   test_distance_transform_bf022TestNdimageMorphology.test_distance_transform_bf02G   s    "zz6666666668 @E  F //k?CE 0////////1 ::h'!#00000000002 10000000023$ ::h'!"/r;   c                   \        W!4      pVP                  . RO. RO. RO. RO. RO. RO. RO. RO. RO.	VR7      p\        P                  ! VRRR7      w  rE. RO. RO. RO. R	O. R
O. R	O. RO. RO. RO.	pVP                  V4      p\	        WF4       . RO. RO. RO. RO. RO. RO. RO. RO. RO.	. RO. RO. RO. RO. RO. RO. RO. RO. RO.	.pVP                  V4      p\	        WV4       R# )r   r   
chessboardTr   Nr   r   r   )	r   r   r   r   r   r   r   r   r   r>   r   r   )	r    r    r   r   r   r   r   r    r    )	r   r   r$   r"   r"   r"   r$   r   r   r#   r&   r'   r(   r)   	r   r   r   r   r$   r"   r"   r%   r   	r   r   r   r   r"   r"   r%   r%   r   )	r   r   r   r   r"   r%   r%   r%   r   )	r   r   r   r   r"   r"   r%   r%   r   )	r   r   r   r   r$   r"   r"   r%   r   r-   r1   s   &&&    r8   test_distance_transform_bf032TestNdimageMorphology.test_distance_transform_bf03y   s    "zz6666666668 @E  F //l?CE 0////////1 ::h'!#00000000002 10000000023$ ::h'!"/r;   Tz,inplace distances= arrays are numpy-specific)np_onlyreasonc                   \        W!4      pVP                  . RO. RO. RO. RO. RO. RO. RO. RO. RO.	VR7      p\        P                  ! V^R7      w  rE. p. pVP	                  VP
                  VP                  R7      p\        P                  ! W8R7       VP                  V4       \        P                  ! VR^R7      p	VP                  V	4       \        P                  ! VP
                  VP                  R7      p	\        P                  ! VRRV	R7       VP                  V	4       \        P                  ! V^R7      w  rVP                  V4       VP                  V	4       VP	                  VP
                  VP                  R7      p\        P                  ! W8RR7      p	VP                  V4       VP                  V	4       \        P                  ! VP
                  VP                  R7      p	\        P                  ! VRV	R	7      pVP                  V4       VP                  V	4       VP	                  VP
                  VP                  R7      p\        P                  ! VP
                  VP                  R7      p	\        P                  ! W8RV	R
7       VP                  V4       VP                  V	4       V F  p\        WH4       K  	  V F  p	\        WY4       K  	  R# )r   r   r   	distancesFreturn_distancesr   TrN   r   indicesrL   r   r   rP   rL   r   rP   Nr   r   r   )r.   r/   r   r0   zerosshapefloat64appendnprP   int32r   
r2   r   r3   r4   tdttftdtsftsdtr6   s
   &&&       r8   test_distance_transform_bf042TestNdimageMorphology.test_distance_transform_bf04   s2    "zz6666666668 @E  F 00aHXXdjj

X3%%d9

2**5<

2ZZ

"((3%%5r	K

2..$

2

2XXdjj

X3**t5

2

2ZZ

"((3**r3

2

2XXdjj

X3ZZ

"((3%%tR	A

2

2B%c. B%c. r;   cupyz(CuPy does not have distance_transform_bfrI   c                   \        W!4      pVP                  . RO. RO. RO. RO. RO. RO. RO. RO. RO.	VR7      p\        P                  ! VRR^^.R7      w  rE. RO. RO. R	O. R
O. RO. R
O. R	O. RO. RO.	pVP                  V4      p\	        WD,          V4       . RO. RO. RO. RO. RO. RO. RO. RO. RO.	. RO. RO. RO. RO. RO. RO. RO. RO. RO.	.pVP                  V4      p\	        WV4       R# )r   r   r   Tr   samplingNr   r   r   )	r   r   r   r   r   r   r   r   r   )	r   r   r   r      r   r   r   r   )	r   r   r   rg       rg   r   r   r   r   r   r   r!   r#   r&   r'   r(   r)   r*   r+   r,   r-   r1   s   &&&    r8   test_distance_transform_bf052TestNdimageMorphology.test_distance_transform_bf05   s
    "zz6666666668 @E  F //+daVE///020///1 ::h'!#)X60000000002 10000000023$ ::h'!"/r;   c                   \        W!4      pVP                  . RO. RO. RO. RO. RO. RO. RO. RO. RO.	VR7      p\        P                  ! VRR^^.R7      w  rE. RO. RO. R	O. R
O. RO. R
O. R	O. RO. RO.	pVP                  V4      p\	        WD,          V4       . RO. RO. RO. RO. RO. RO. RO. RO. RO.	. RO. RO. RO. RO. RO. RO. RO. RO. RO.	.pVP                  V4      p\	        WV4       R# )r   r   r   Tre   Nr   r   r   )	r   r   r   r   r   r   r   r   r   r   )	r   r   r   r   	   r   r   r   r   r   )	r   r   r   r   r   r   r   r   r   )	r    r    r    r    r   r    r    r    r    )	r   r   r   r   r   r   r   r   r   )	r$   r$   r$   r$   r"   r$   r$   r$   r$   )	r"   r"   r"   r"   r%   r"   r"   r"   r"   r'   r(   r)   )	r   r   r   r   r"   r"   r"   r%   r   r,   )	r   r   r   r   r%   r%   r%   r%   r   r*   r-   r1   s   &&&    r8   test_distance_transform_bf062TestNdimageMorphology.test_distance_transform_bf06  s
    "zz6666666668 @E  F //+daVE/////////1 ::h'!#)X60000000002 10000000023$ ::h'!"/r;   c                    VP                  . RO. RO. RO. RO. RO. RO. RO. RO. RO.	4      p\        \        4      ;_uu_ 4        \        P                  ! VRRR7       RRR4       R#   + '       g   i     R# ; i)r   FrM   Nr   r   r   )r/   assert_raisesRuntimeErrorr   r0   )r2   r3   r4   s   && r8   test_distance_transform_bf072TestNdimageMorphology.test_distance_transform_bf07F  sc     zz6666666668 9 <(())uU )(((s   A((A9	c                   \        W!4      pVP                  . RO. RO. RO. RO. RO. RO. RO. RO. RO.	VR7      p\        P                  ! VRRR7      w  rE\        P                  ! VR4      p\        Wd4       . RO. R	O. R
O. RO. RO. RO. RO. RO. RO.	. RO. RO. RO. RO. RO. RO. RO. RO. RO.	.pVP                  V4      p\        WW4       R# )r   r   r=   Tr   Nr   r   r   r   	r   r   r   r   r   r   r   r   r   )	r    r    r   r   r   r   r   r    r    )	r   r   r   r   r   r   r   r   r   )	r$   r$   r$   r$   r%   r%   r"   r$   r$   	r"   r"   r"   r"   r%   r%   r"   r"   r"   r'   r(   r)   r?   )	r   r   r   r   r   r$   r"   r%   r   )	r   r   r   r   r   r$   r"   r%   r   r.   r/   r   distance_transform_cdtr0   r   r2   r   r3   r4   r5   r6   bfr7   s   &&&     r8   test_distance_transform_cdt013TestNdimageMorphology.test_distance_transform_cdt01W  s     " zz6666666668 @E  F 00+d4**4=!"*0000000002 10000000023$ ::h'!"/r;   c                   \        W!4      pVP                  . RO. RO. RO. RO. RO. RO. RO. RO. RO.	VR7      p\        P                  ! VRRR7      w  rE\        P                  ! VR4      p\        Wd4       . RO. R	O. R
O. RO. RO. RO. RO. RO. RO.	. RO. RO. RO. RO. RO. RO. RO. RO. RO.	.pVP                  V4      p\        WW4       R# )r   r   rC   Tr   Nr   r   r   r   ru   )	r    r    r   r   r   r   r   r    r    )	r   r   r    r   r   r   r    r   r   )	r$   r$   r   r"   r%   r"   r   r$   r$   rv   r'   r(   r)   )	r   r   r   r   r    r   r"   r%   r   )	r   r   r   r   r   r"   r"   r%   r   )	r   r   r   r   r   r"   r%   r%   r   rE   rD   rw   ry   s   &&&     r8   test_distance_transform_cdt023TestNdimageMorphology.test_distance_transform_cdt02  s     "zz6666666668 @E  F 00|@DF**4>!"*0000000002 10000000023$ ::h'!"/r;   z*inplace indices= arrays are numpy-specificc                :   \        W!4      pVP                  . RO. RO. RO. RO. RO. RO. RO. RO. RO.	VR7      p\        P                  ! VRR7      w  rE. p. pVP	                  VP
                  VP                  R7      p\        P                  ! W8R7       VP                  V4       \        P                  ! VRRR7      p	VP                  V	4       VP                  \        P                  ! VP
                  \        P                  R7      4      p	\        P                  ! VRRV	R7       VP                  V	4       \        P                  ! VRR7      w  rVP                  V4       VP                  V	4       VP	                  VP
                  VP                  R7      p\        P                  ! W8RR7      p	VP                  V4       VP                  V	4       VP                  \        P                  ! VP
                  \        P                  R7      4      p	\        P                  ! VRV	R	7      pVP                  V4       VP                  V	4       VP	                  VP
                  VP                  R7      pVP                  \        P                  ! VP
                  \        P                  R7      4      p	\        P                  ! W8RV	R
7       VP                  V4       VP                  V	4       V F  p\        WH4       K  	  V F  p	\        WY4       K  	  R# )r   r   Tr   rK   FrM   rO   rQ   rR   rS   Nr   r   r   )r.   r/   r   rx   rT   rU   rY   rW   rX   rP   r   rZ   s
   &&&       r8   test_distance_transform_cdt033TestNdimageMorphology.test_distance_transform_cdt03  sM    "zz6666666668 @E  F 11$tLXXdjjX1&&t:

2++5?

2ZZ

4::RXX>?&&5r	K

2//'

2

2XXdjjX1++t5

2

2ZZ

4::RXX>?++r3

2

2XXdjjX1ZZ

4::RXX>?&&t6:B	H

2

2B%c. B%c. r;   z3XXX: does not raise unless indices is a numpy arrayc                l   VP                  . RO. RO. RO. RO. RO. RO. RO. RO. RO.	4      pVP                  VP                  3VP                  ,           VP                  R7      p\        \        4      ;_uu_ 4        \        P                  ! VRRVR7       RRR4       R#   + '       g   i     R# ; i)	r   r   TFrO   Nr   r   r   )	r/   rT   ndimrU   rY   rp   rq   r   r0   )r2   r3   r4   indices_outs   &&  r8   test_distance_transform_cdt043TestNdimageMorphology.test_distance_transform_cdt04  s     zz6666666668 9 hh		|djj8hI<(())!%$#	 )(((s   =B""B3	torchzint overflowc                    \        W!4      pVP                  . RO. RO. RO. RO. RO. RO. RO. RO. RO.	VR7      pVP                  R4      p\        P                  ! W4R7      pVP                  V4      R8X  g   Q hR# )	r   r   metricNr   r   r   r    r    i)r.   r/   onesr   rx   sum)r2   r   r3   r4   
metric_argactuals   &&&   r8   test_distance_transform_cdt053TestNdimageMorphology.test_distance_transform_cdt05  s     " zz6666666668 @E  F WWV_
//Hvvf~$$$r;   c                   \        W!4      pVP                  . RO. RO. R	O. R
O. R
O. R
O. R	O. RO. RO.	VR7      p\        P                  ! VRR7      w  rE\        P                  ! VR4      p\        Wd4       \        P                  ! V4      pV\        P                  ! VP                  R,          VP                  R7      ,
          pVP                  \        P                  4      p\        P                  ! WV4       \        P                  P                  V^ R7      p\        P                  ! W4       VP                  V4      p\        Wh4       R# )r   r   Tr   r   :r   NNaxisNr   r   r   )r.   r/   r   distance_transform_edtr0   r   rX   rP   rU   r   astyperV   multiplyaddreducesqrt)	r2   r   r3   r4   r5   r6   rz   np_ftr_   s	   &&&      r8   test_distance_transform_edt013TestNdimageMorphology.test_distance_transform_edt01  s   
 " zz6666666668 @E  F 00dK**4=!"* 

2RZZBu{{CCYYrzz"
BBVV]]2A]&
ZZ^!")r;   z%inplace distances= are numpy-specificc                .   \        W!4      pVP                  . RO. RO. RO. RO. RO. RO. RO. RO. RO.	VR7      p\        P                  ! VRR7      w  rE. p. pVP	                  VP
                  VP                  R7      p\        P                  ! W8R7       VP                  V4       \        P                  ! V^ RR7      p	VP                  V	4       \        P                  ! VP
                  VP                  R7      p	VP                  V	4      p	\        P                  ! VRRV	R7       VP                  V	4       \        P                  ! VRR7      w  rVP                  V4       VP                  V	4       VP	                  VP
                  VP                  R7      p\        P                  ! W8RR7      p	VP                  V4       VP                  V	4       \        P                  ! VP
                  VP                  R7      p	VP                  V	4      p	\        P                  ! VRV	R	7      pVP                  V4       VP                  V	4       VP	                  VP
                  VP                  R7      p\        P                  ! VP
                  VP                  R7      p	VP                  V	4      p	\        P                  ! W8RV	R
7       VP                  V4       VP                  V	4       V F  p\        WH4       K  	  V F  p	\        WY4       K  	  R# )r   r   Tr   rK   rM   FrO   rQ   rR   rS   Nr   r   r   )r.   r/   r   r   rT   rU   rV   rW   rX   rP   rY   r   rZ   s
   &&&       r8   test_distance_transform_edt023TestNdimageMorphology.test_distance_transform_edt02+  sY    "zz6666666668 @E  F 11$tLXXdjj

X3&&t:

2++1T;

2ZZ

"((3ZZ^&&5r	K

2//'

2

2XXdjj

X3++t5

2

2ZZ

"((3ZZ^++r3

2

2XXdjj

X3ZZ

"((3ZZ^&&tR	A

2

2B%c. B%c. r;   c                    \        W!4      pVP                  . RO. RO. RO. RO. RO. RO. RO. RO. RO.	VR7      p\        P                  ! VR^^.R7      p\        P                  ! V^^.R7      p\        WT4       R# r   r   r   )rf   Nr   r   r   r.   r/   r   r0   r   r   r2   r   r3   r4   refr5   s   &&&   r8   test_distance_transform_edt033TestNdimageMorphology.test_distance_transform_edt03m       "zz6666666668 @E  F ++D+AO,,TQFC!#+r;   c                    \        W!4      pVP                  . RO. RO. RO. RO. RO. RO. RO. RO. RO.	VR7      p\        P                  ! VR^^.R7      p\        P                  ! V^^.R7      p\        WT4       R# r   r   r   s   &&&   r8   test_distance_transform_edt42TestNdimageMorphology.test_distance_transform_edt4  r   r;   z8Only 2D and 3D distance transforms are supported in CuPyc                    \         P                  ! VP                  R 4      4      p\        W!P                  R.4      4       R# )F        N)r   r   r/   r   )r2   r3   r5   s   && r8   test_distance_transform_edt52TestNdimageMorphology.test_distance_transform_edt5  s0     ,,RZZ->?!#zz2$'78r;   c                H   VP                  . RO. RO. RO. RO. RO. RO. RO. RO. RO.	4      pVP                  VP                  VP                  R7      p\	        \
        4      ;_uu_ 4        \        P                  ! VRRVR7       RRR4       R#   + '       g   i     R# ; i)	r   r   TF)r   rN   rL   Nr   r   r   )r/   rT   rU   rV   rp   rq   r   r0   )r2   r3   r4   distances_outs   &&  r8   test_distance_transform_edt62TestNdimageMorphology.test_distance_transform_edt6  s     zz6666666668 9 2::><(())#!&'	 )(((s   +BB!	c                F    \         P                  ! ^ ^4      pV^8X  g   Q hR# )r   N)r   generate_binary_structurer2   r3   structs   && r8   test_generate_structure01/TestNdimageMorphology.test_generate_structure01  s     221a8{{r;   c                P    \         P                  ! ^^4      p\        V. RO4       R# )r   Nr   r   r   r   r   r   r   s   && r8   test_generate_structure02/TestNdimageMorphology.test_generate_structure02  s    221a8!&)4r;   c                ^    \         P                  ! ^^4      p\        V. RO. RO. RO.4       R# )r   Nr   r   r   r   r   r   s   && r8   test_generate_structure03/TestNdimageMorphology.test_generate_structure03  +    221a8!&9+4+4+6 	7r;   c                ^    \         P                  ! ^^4      p\        V. RO. RO. RO.4       R# )r   Nr   r   r   s   && r8   test_generate_structure04/TestNdimageMorphology.test_generate_structure04  r   r;   c                    . RO. RO. RO.pVP                  V4      p\        P                  ! V^4      p\        P                   ! . RO. RO. RO. RO. RO.\        R7      pVP                  V4      p\        W44       R# r   r   Nr   r   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r/   r   iterate_structurerX   boolr   r2   r3   r   r5   r7   s   &&   r8   test_iterate_structure01.TestNdimageMorphology.test_iterate_structure01  sr     F#''2::....	0 8<	=
 ::h'!#0r;   c                    ^ ^.^^.^ ^..pVP                  V4      p\        P                  ! V^4      p\        P                   ! . RO. RO. RO. RO. RO.\        R7      pVP                  V4      p\        W44       R# )r   r   N)r   r   r   r   r   r   r   r   r   s   &&   r8   test_iterate_structure02.TestNdimageMorphology.test_iterate_structure02  s~    a&a&a& F#''2::y((((	* 26	7
 ::h'!#0r;   c                4   . RO. RO. RO.pVP                  V4      p\        P                  ! V^^4      p. RO. RO. RO. RO. RO.p\        P                   ! V\        R7      pVP                  V4      p\        V^ ,          V4       V^,          ^^.8X  g   Q hR# r   r   r   s   &&   r8   test_iterate_structure03.TestNdimageMorphology.test_iterate_structure03  s     F#''15#####	%
 ::hd3::h'!#a&(31v!Qr;   c                    \        W!4      pVP                  . VR 7      p\        P                  ! V4      pWBP	                  ^VP
                  R 7      8X  g   Q hR# r   Nr.   r   r   binary_erosionr/   r   r2   r   r3   r4   r5   s   &&&  r8   test_binary_erosion01+TestNdimageMorphology.test_binary_erosion01  sM     "wwrw'$$T*jj#))j4444r;   c                    \        W!4      pVP                  . VR 7      p\        P                  ! V^R7      pWBP	                  ^VP
                  R 7      8X  g   Q hR# )r   border_valueNr   r   s   &&&  r8   test_binary_erosion02+TestNdimageMorphology.test_binary_erosion02  sO     "wwrw'$$T:jj#))j4444r;   c                    \        W!4      pVP                  ^.VR7      p\        P                  ! V4      p\	        WBP                  ^ .4      4       R# r   r   Nr.   r   r   r   r   r/   r   s   &&&  r8   test_binary_erosion03+TestNdimageMorphology.test_binary_erosion03  sD     "wws%w($$T*!#zz1#7r;   c                    \        W!4      pVP                  ^.VR7      p\        P                  ! V^R7      p\	        WBP                  ^.4      4       R# r   r   r   Nr   r   s   &&&  r8   test_binary_erosion04+TestNdimageMorphology.test_binary_erosion04  sF     "wws%w($$T:!#zz1#7r;   c                    \        W!4      pVP                  ^.VR7      p\        P                  ! V4      p\	        WBP                  . RO4      4       R# )r    r   Nr   r   r   s   &&&  r8   test_binary_erosion05+TestNdimageMorphology.test_binary_erosion05  sC     "wws%w($$T*!#zz)'<=r;   z(https://github.com/cupy/cupy/issues/8912c                    \        W!4      pVP                  RVR7      pVP                  VR4      p\        P                  ! V4      p\        WBP                  . RO4      4       R# )r   r   Nr   r    r   )r.   r   broadcast_tor   r   r   r/   r   s   &&&  r8   !test_binary_erosion05_broadcasted7TestNdimageMorphology.test_binary_erosion05_broadcasted%  sQ     "wwuEw*tU+$$T*!#zz)'<=r;   c                    \        W!4      pVP                  ^.VR7      p\        P                  ! V^R7      p\	        WBP                  . RO4      4       R# r    r   r   Nr   r   r   s   &&&  r8   test_binary_erosion06+TestNdimageMorphology.test_binary_erosion06/  sE     "wws%w($$T:!#zz)'<=r;   c                    \        W!4      pVP                  ^.VR7      p\        P                  ! V4      p\	        WBP                  . RO4      4       R# )r$   r   Nr   r   r   s   &&&  r8   test_binary_erosion07+TestNdimageMorphology.test_binary_erosion077  sC     "wws%w($$T*!#zz/'BCr;   c                    \        W!4      pVP                  ^.VR7      p\        P                  ! V^R7      p\	        WBP                  . RO4      4       R# )r$   r   r   Nr   r   r   s   &&&  r8   test_binary_erosion08+TestNdimageMorphology.test_binary_erosion08?  sE     "wws%w($$T:!#zz/'BCr;   c                    \         P                  ! ^.VR7      p^ V^&   VP                  V4      p\        P                  ! V4      p\        WBP                  . RO4      4       R# )r$   r   Nr   r   r   r   r   rX   r   r/   r   r   r   r   s   &&&  r8   test_binary_erosion09+TestNdimageMorphology.test_binary_erosion09G  sN     wws%(Qzz$$$T*!#zz/'BCr;   c                    \         P                  ! ^.VR7      p^ V^&   VP                  V4      p\        P                  ! V^R7      p\        WBP                  . RO4      4       R# )r$   r   r   N)r   r   r   r   r   r  r   s   &&&  r8   test_binary_erosion10+TestNdimageMorphology.test_binary_erosion10P  sP     wws%(Qzz$$$T:!#zz/'BCr;   c                    \         P                  ! ^.VR7      p^ V^&   VP                  V4      pVP                  . RO4      p\        P                  ! W4^R7      p\        WRP                  . RO4      4       R# r$   r   r   Nr   r   r   )r   r   r   r   r   r  r2   r   r3   r4   r   r5   s   &&&   r8   test_binary_erosion11+TestNdimageMorphology.test_binary_erosion11Y  s^     wws%(Qzz$I&$$TB!#zz/'BCr;   c                    \         P                  ! ^.VR7      p^ V^&   VP                  V4      pVP                  . RO4      p\        P                  ! W4^RR7      p\        WRP                  . RO4      4       R# )r$   r   r   originNr  r   r   r   r   r   r  r  s   &&&   r8   test_binary_erosion12+TestNdimageMorphology.test_binary_erosion12c  s`     wws%(Qzz$I&$$T"M!#zz/'BCr;   c                    \         P                  ! ^.VR7      p^ V^&   VP                  V4      pVP                  . RO4      p\        P                  ! W4^^R7      p\        WRP                  . RO4      4       R# )r$   r   r  Nr  r   r   r   r   r   r  r  s   &&&   r8   test_binary_erosion13+TestNdimageMorphology.test_binary_erosion13m  s`     wws%(Qzz$I&$$T!L!#zz/'BCr;   c                    \         P                  ! ^.VR7      p^ V^&   VP                  V4      pVP                  ^^.4      p\        P                  ! W4^R7      p\        WRP                  . RO4      4       R# )r$   r   r   N)r   r   r   r   r   r  r  s   &&&   r8   test_binary_erosion14+TestNdimageMorphology.test_binary_erosion14w  sb     wws%(Qzz$QF#$$TB!#zz/'BCr;   c                    \         P                  ! ^.VR7      p^ V^&   VP                  V4      pVP                  ^^.4      p\        P                  ! W4^RR7      p\        WRP                  . RO4      4       R# )r$   r   r  Nr  )r   r   r   r   r   r  r  s   &&&   r8   test_binary_erosion15+TestNdimageMorphology.test_binary_erosion15  sd     wws%(Qzz$QF#$$T"M!#zz/'BCr;   c                    \        W!4      pVP                  ^^.VR7      p\        P                  ! V^R7      p\	        WBP                  ^..4      4       R# r   r   r   s   &&&  r8   test_binary_erosion16+TestNdimageMorphology.test_binary_erosion16  sK     "ww1vUw+$$T:!#zzA3%'89r;   c                    \        W!4      pVP                  ^^.VR7      p\        P                  ! V4      p\	        WBP                  ^ ..4      4       R# r   r   r   s   &&&  r8   test_binary_erosion17+TestNdimageMorphology.test_binary_erosion17  sI     "ww1vUw+$$T*!#zzA3%'89r;   c                    \        W!4      pVP                  ^^.VR7      p\        P                  ! V4      p\	        WBP                  . RO.4      4       R# )r   r   Nr   r   r   r   r   s   &&&  r8   test_binary_erosion18+TestNdimageMorphology.test_binary_erosion18  sG     "ww1vUw+$$T*!#zz9+'>?r;   c                    \        W!4      pVP                  ^^.VR7      p\        P                  ! V^R7      p\	        WBP                  . RO.4      4       R# )r   r   r   Nr   r   r   s   &&&  r8   test_binary_erosion19+TestNdimageMorphology.test_binary_erosion19  sI     "ww1vUw+$$T:!#zz9+'>?r;   c           	         \        W!4      pVP                  ^^.VR7      p\        P                  ! V4      p\	        WBP                  . RO. RO. RO.4      4       R# )r    r   Nr'  r   r   r   s   &&&  r8   test_binary_erosion20+TestNdimageMorphology.test_binary_erosion20  sU     "ww1vUw+$$T*!#zz93<3<3> (? 	@r;   c           	         \        W!4      pVP                  ^^.VR7      p\        P                  ! V^R7      p\	        WBP                  . RO. RO. RO.4      4       R# r   r   r   s   &&&  r8   test_binary_erosion21+TestNdimageMorphology.test_binary_erosion21  sW     "ww1vUw+$$T:!#zz93<3<3> (? 	@r;   c                   \        W!4      p. RO. RO. RO. RO. RO. RO. RO. RO.pVP                  V4      pVP                  . RO. RO. R	O. R
O. RO. RO. RO. RO.VR7      p\        P                  ! V^R7      p\	        WS4       R# )r   r   r   Nr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r.   r/   r   r   r   r2   r   r3   r7   r4   r5   s   &&&   r8   test_binary_erosion22+TestNdimageMorphology.test_binary_erosion22  s     ",,,,,,,,. ::h'zz333333335 =B  C $$T:!#0r;   c                ^   \        W!4      p\        P                  ! ^^4      pVP                  V4      p. RO. RO. RO. RO. RO. RO. RO. RO.pVP                  V4      pVP                  . RO. RO. RO. RO. R	O. R
O. RO. RO.VR7      p\        P                  ! WS^R7      p\        Wd4       R# )r   r   r   Nr4  r6  r8  r9  r:  r;  r<  r=  )r.   r   r   r/   r   r   r2   r   r3   r   r7   r4   r5   s   &&&    r8   test_binary_erosion23+TestNdimageMorphology.test_binary_erosion23  s     "221a8F#,,,,,,,,. ::h'zz333333335 =B  C $$TB!#0r;   c                <   \        W!4      pVP                  ^ ^.^^..4      p. RO. RO. RO. RO. RO. RO. RO. RO.pVP                  V4      pVP                  . RO. R	O. RO. R
O. RO. RO. RO. RO.VR7      p\        P                  ! WS^R7      p\	        Wd4       R# )r   r   r   Nr4  r9  r   r   r   r   r   r   r   r   r;  )r   r   r   r   r   r   r   r   r8  r:  r<  r=  r>  rC  s   &&&    r8   test_binary_erosion24+TestNdimageMorphology.test_binary_erosion24  s     "aVV% &,,,,,,,,. ::h'zz333333335 =B  C $$TB!#0r;   c                F   \        W!4      p. RO. RO. RO.pVP                  V4      p. RO. RO. RO. RO. RO. R	O. RO. RO.pVP                  V4      pVP                  . RO. R
O. RO. RO. RO. RO. RO. RO.VR7      p\        P                  ! WS^R7      p\	        Wd4       R# )r   r   r   Nr   r  r4  r5  )r   r   r   r   r   r   r   r   r7  r8  r9  r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r=  r>  rC  s   &&&    r8   test_binary_erosion25+TestNdimageMorphology.test_binary_erosion25  s     " F#,,,,,,,,. ::h'zz333333335 =B  C $$TB!#0r;   c                H   \        W!4      p. RO. RO. RO.pVP                  V4      p. RO. RO. RO. R	O. R
O. RO. RO. RO.pVP                  V4      pVP                  . RO. RO. RO. RO. RO. RO. RO. RO.VR7      p\        P                  ! WS^RR7      p\	        Wd4       R# )r   r   r  Nr   r  r4  r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r8  r9  rK  rL  rM  r=  r  r  r>  rC  s   &&&    r8   test_binary_erosion26+TestNdimageMorphology.test_binary_erosion26'  s     " F#,,,,,,,,. ::h'zz333333335 =B  C $$T,46!#0r;   5CuPy: NotImplementedError: only brute_force iterationc           
     Z   . RO. RO. RO.pVP                  V4      p. RO. RO. RO. RO. RO. RO. RO.pVP                  V4      p\        P                   ! . RO. RO. RO. R	O. RO. RO. RO.\        R7      pVP                  V4      p\        P                  ! WB^^R7      p\        WS4       R# 
r   r   r   
iterationsNr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r/   rX   r   r   r   r   r2   r3   r   r7   r4   r5   s   &&    r8   test_binary_erosion27+TestNdimageMorphology.test_binary_erosion27D  s    
  F#)))))))+ ::h'zz00000002 :>? zz$$$T013!#0r;   z)inplace out= arguments are numpy-specificrH   
exceptionsrI   /NotImplementedError: only brute_force iterationc           
        . RO. RO. RO.pVP                  V4      p. RO. RO. RO. RO. RO. RO. RO.p\        P                   ! V\        R7      pVP                  V4      p\        P                   ! . RO. RO. RO. R	O. RO. RO. RO.\        R7      pVP                  V4      p\        P                  ! VP                  \        R7      pVP                  V4      p\
        P                  ! WB^^VR7       \        WS4       R# )
r   r   r   r\  outputNr   r   r]  r^  r_  r`  r/   rX   r   rT   rU   r   r   r   rb  s   &&    r8   test_binary_erosion28+TestNdimageMorphology.test_binary_erosion28a  s      F#)))))))+ ::hd3::h'zz00000002 :>? zz$hhtzz.jjot!*+C	9!#0r;   c           
     Z   . RO. RO. RO.pVP                  V4      p. RO. RO. RO. RO. RO. RO. RO.pVP                  V4      p\        P                   ! . RO. RO. R	O. R
O. R	O. RO. RO.\        R7      pVP                  V4      p\        P                  ! WB^^R7      p\        WS4       R# )r   r   r[  Nr   r   r]  r^  r_  r`  r   r   r   r   r   r   r   ra  rb  s   &&    r8   test_binary_erosion29+TestNdimageMorphology.test_binary_erosion29  s    
  F#)))))))+ ::h'zz00000002 :>? zz$$$T23C!#0r;   c           
     L   . RO. RO. RO.pVP                  V4      p. RO. RO. RO. RO. RO. RO. RO.p\        P                   ! V\        R7      pVP                  V4      p\        P                   ! . RO. RO. R	O. R
O. R	O. RO. RO.\        R7      pVP                  V4      p\        P                  ! VP                  \        R7      pVP                  V4      p\
        P                  ! WB^^VR7       \        WS4       \
        P                  ! WB^^VR7       \        WC4       R# )r   r   ri  Nr   r   r]  r^  r_  r`  ro  rk  rb  s   &&    r8   test_binary_erosion30+TestNdimageMorphology.test_binary_erosion30  s      F#)))))))+ ::hd3::h'zz00000002 :>? zz$hhtzz.jjot!*+C	9!#0 	t!*+D	:!$1r;   c           
        . RO. RO. RO.pVP                  V4      p. RO. RO. RO. RO. RO. R	O. R
O.p\        P                   ! V\        R7      pVP                  V4      p\        P                   ! . RO. RO. RO. RO. RO. RO. RO.\        R7      pVP                  V4      p\        P                  ! VP                  \        R7      pVP                  V4      p\
        P                  ! WB^^VRR7       \        WS4       R# )r   r   )r   r\  rj  r  Nr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r]  r   r   r   r   r   r   r   r^  r_  r`  ro  rU  rk  rb  s   &&    r8   test_binary_erosion31+TestNdimageMorphology.test_binary_erosion31  s      F#)))))))+ ::hd3::h'zz00000002 :>? zz$hhtzz.jjot!*+C	J!#0r;   c           
     Z   . RO. RO. RO.pVP                  V4      p. RO. RO. RO. RO. RO. RO. RO.pVP                  V4      p\        P                   ! . RO. RO. RO. R	O. RO. RO. RO.\        R7      pVP                  V4      p\        P                  ! WB^^R7      p\        WS4       R# rZ  ra  rb  s   &&    r8   test_binary_erosion32+TestNdimageMorphology.test_binary_erosion32  s      F#)))))))+ ::h'zz00000002 :>? zz$$$T23C!#0r;   c           
        . RO. RO. RO.pVP                  V4      p. RO. RO. RO. RO. RO. RO. RO.pVP                  V4      p. R	O. R
O. RO. RO. RO. RO. RO.pVP                  V4      p\        P                   ! . RO. RO. RO. RO. RO. RO. RO.\        R7      pVP                  V4      p\        P                  ! WR^VRR7      p\        Wc4       R# )r   r   )r   maskr\  Nr   r   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r]  )r   r   r   r   r   r   r   r   r   r   r   r   r   r   ro  )r   r   r   r   r   r   r   r_  r^  r  ra  r2   r3   r   r7   r  r4   r5   s   &&     r8   test_binary_erosion33+TestNdimageMorphology.test_binary_erosion33   s      F#)))))))+ ::h'%%%%%%%' zz$zz00000002 :>? zz$$$T23$2O!#0r;   c           
        . RO. RO. RO.pVP                  V4      p. RO. RO. RO. RO. RO. RO. RO.pVP                  V4      p. RO. RO. R	O. R
O. R	O. RO. RO.pVP                  V4      p\        P                   ! . RO. RO. R	O. RO. R	O. RO. RO.\        R7      pVP                  V4      p\        P                  ! WR^VR7      p\        Wc4       R# )r   r   )r   r  Nr   r   r]  r^  r`  r_  r   r   r   r   r   r   r   ra  r  s   &&     r8   test_binary_erosion34+TestNdimageMorphology.test_binary_erosion34$  s     F#)))))))+ ::h'%%%%%%%' zz$zz00000002 :>? zz$$$T23$@!#0r;   c           
        . RO. RO. RO.pVP                  V4      p. RO. RO. RO. RO. RO. RO. RO.p\        P                   ! V\        R7      pVP                  V4      p\        P                   ! . R	O. RO. R
O. RO. R
O. RO. R	O.\        R7      pVP                  V4      p. RO. RO. RO. RO. RO. RO. RO.p\        P                   ! V\        R7      pVP                  V4      pVP                  WS4      pVP                  WAP	                  V4      4      pVP                  We4      p\        P                  ! VP                  \        R7      pVP                  V4      p\        P                  ! WB^^VRVR7       \        Wv4       R# )r   r   )r   r\  rj  r  r  Nr   r   r]  r_  r  r^  r`  ro  rv  rw  rx  ry  rU  )r/   rX   r   logical_andlogical_not
logical_orrT   rU   r   r   r   )r2   r3   r   r  r4   tmpr7   r5   s   &&      r8   test_binary_erosion35+TestNdimageMorphology.test_binary_erosion35F  sR     F#%%%%%%%' zz$d+zz$zz00000002 :>? zz$$$$$$$$& jjD)jjo>>#,nnT>>$#78==/hhtzz.jjot!*+C&.T	; 	"#0r;   c                   . RO. RO. RO.pVP                  V4      p. RO. RO. RO. RO. RO. RO. RO. RO.p\        P                   ! V\        R7      pVP                  V4      p. RO. R	O. R
O. RO. RO. RO. RO. R	O.p\        P                   ! V\        R7      pVP                  V4      p\        P                   ! . RO. RO. RO. RO. RO. RO. RO. RO.\        R7      pVP                  V4      pVP                  WC4      pVP                  WQP	                  V4      4      pVP                  Wd4      p\        P                  ! WRV^RR7      p\        Wv4       R# )r   r   )r  r   r  Nr   r  r4  r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   rQ  rR  rS  rT  r8  r9  rK  rL  rM  r=  rU  )	r/   rX   r   r  r  r  r   r   r   )r2   r3   r   r  r  r4   r7   r5   s   &&      r8   test_binary_erosion36+TestNdimageMorphology.test_binary_erosion36r  s8     F#((((((((* zz$d+zz$'''''''') jjD)jjozz344444446 >BC zz$>>#,nnT>>$#78==/$$T23HF!#0r;   c           	        \         P                  ! . RO. RO. RO.\        R7      pVP                  V4      pVP                  V4      p\        P
                  ! W"V^ RRR7      pWCJ g   Q h\        \        P
                  ! W"^ RR7      V4       R# )r   r   T)	structurerj  r\  r   brute_force)r  r\  r   Nr  r   )rX   r/   r   
zeros_liker   r   r   )r2   r3   abr5   s   &&   r8   test_binary_erosion37+TestNdimageMorphology.test_binary_erosion37  s     JJ	!!#*.0 JJqMMM!$$QA!26DJxx""1a046	r;   c                   \         P                  ! . RO. RO. RO.\        R7      pVP                  V4      pRp\        \        4      ;_uu_ 4        \
        P                  ! W#R7      pRRR4       R#   + '       g   i     R# ; i)r   r   g       @r\  Nr  r   )rX   r/   r   rp   	TypeErrorr   r   )r2   r3   r4   r\  _s   &&   r8   test_binary_erosion38+TestNdimageMorphology.test_binary_erosion38  s_    zz9$$&-13 zz$
9%%&&tCA &%%%s   A22B	c           
     "   \         P                  ! ^4      p. RO. RO. RO.pVP                  V4      p. RO. RO. RO. RO. RO. RO. RO.pVP                  V\        R7      pVP                  V4      p\         P                  ! . RO. RO. R	O. R
O. R	O. RO. RO.\        R7      pVP                  V4      p\         P                  ! VP
                  \        R7      pVP                  V4      p\        P                  ! WS^W&R7       \        Wd4       R# r    r   ri  Nr   r   r]  r^  r_  r`  ro  )	rX   rY   r/   r   rT   rU   r   r   r   r2   r3   r\  r   r7   r4   r5   s   &&     r8   test_binary_erosion39+TestNdimageMorphology.test_binary_erosion39  s     XXa[
 F#)))))))+ ::hd:3::h'zz00000002 :>? zz$hhtzz.jjot!*4	B!#0r;   c           
     ,   \         P                  ! ^4      p. RO. RO. RO.pVP                  V4      p. RO. RO. RO. RO. RO. RO. RO.p\         P                  ! V\        R7      pVP                  V4      p\         P                  ! . RO. RO. R	O. R
O. R	O. RO. RO.\        R7      pVP                  V4      p\         P                  ! VP
                  \        R7      pVP                  V4      p\        P                  ! WS^W&R7       \        Wd4       R# r  )	rX   int64r/   r   rT   rU   r   r   r   r  s   &&     r8   test_binary_erosion40+TestNdimageMorphology.test_binary_erosion40  s     XXa[
 F#)))))))+ ::hd3::h'zz00000002 :>? zz$hhtzz.jjot!*4	B!#0r;   c                    \        W!4      pVP                  . VR 7      p\        P                  ! V4      pWBP	                  ^VP
                  R 7      8X  g   Q hR# r   )r.   r   r   binary_dilationr/   r   r   s   &&&  r8   test_binary_dilation01,TestNdimageMorphology.test_binary_dilation01  sM     "wwrw'%%d+jj#))j4444r;   c                    \        W!4      pVP                  . VR 7      p\        P                  ! V4      pWBP	                  R4      8X  g   Q hR# )r   FN)r.   rT   r   r  r/   r   s   &&&  r8   test_binary_dilation02,TestNdimageMorphology.test_binary_dilation02  sE     "xx%x(%%d+jj''''r;   c                    \        W!4      pVP                  ^.VR7      p\        P                  ! V4      p\	        WBP                  ^.VP                  R7      4       R# r   )r.   r   r   r  r   r/   r   r   s   &&&  r8   test_binary_dilation03,TestNdimageMorphology.test_binary_dilation03  sM     "wws%w(%%d+!#zz1#SYYz'GHr;   c                    \        W!4      pVP                  ^.VR7      p\        P                  ! V4      p\	        WBP                  ^ .4      4       R# r   r.   rT   r   r  r   r/   r   s   &&&  r8   test_binary_dilation04,TestNdimageMorphology.test_binary_dilation04  sD     "xx5x)%%d+!#zz1#7r;   c                    \        W!4      pVP                  ^.VR7      p\        P                  ! V4      p\	        WBP                  . RO4      4       R# r    r   Nr   r.   r   r   r  r   r/   r   s   &&&  r8   test_binary_dilation05,TestNdimageMorphology.test_binary_dilation05  sC     "wws%w(%%d+!#zz)'<=r;   c                    \        W!4      pVP                  RVR7      pVP                  VR4      p\        P                  ! V4      p\        WBP                  . RO4      4       R# )r   r   Nr   r   r   )r.   r   r   r   r  r   r/   r   s   &&&  r8   "test_binary_dilation05_broadcasted8TestNdimageMorphology.test_binary_dilation05_broadcasted'  sQ     "wwuEw*tT*%%d+!#zz)'<=r;   c                    \        W!4      pVP                  ^.VR7      p\        P                  ! V4      p\	        WBP                  . RO4      4       R# )r    r   Nr'  r  r   s   &&&  r8   test_binary_dilation06,TestNdimageMorphology.test_binary_dilation060  sC     "xx5x)%%d+!#zz)'<=r;   c                    \         P                  ! ^.VR7      p^V^&   VP                  V4      p\        P                  ! V4      p\        WBP                  . RO4      4       R# r  rX   rT   r/   r   r  r   r   s   &&&  r8   test_binary_dilation07,TestNdimageMorphology.test_binary_dilation078  sN     xx5)Qzz$%%d+!#zz)'<=r;   c                    \         P                  ! ^.VR7      p^V^&   ^V^&   VP                  V4      p\        P                  ! V4      p\        WBP                  . RO4      4       R# )r$   r   Nr   r  r   s   &&&  r8   test_binary_dilation08,TestNdimageMorphology.test_binary_dilation08A  sW     xx5)QQzz$%%d+!#zz/'BCr;   c                    \         P                  ! ^.VR7      p^V^&   VP                  V4      p\        P                  ! V4      p\        WBP                  . RO4      4       R# )r$   r   Nr   r   r   r   r   r  r   s   &&&  r8   test_binary_dilation09,TestNdimageMorphology.test_binary_dilation09K  sN     xx5)Qzz$%%d+!#zz/'BCr;   c                    \         P                  ! ^.VR7      p^V^&   VP                  V4      p\        P                  ! VRR7      p\        WBP                  . RO4      4       R# )r$   r   r  Nr  r   r  r   s   &&&  r8   test_binary_dilation10,TestNdimageMorphology.test_binary_dilation10T  sP     xx5)Qzz$%%d26!#zz/'BCr;   c                    \         P                  ! ^.VR7      p^V^&   VP                  V4      p\        P                  ! V^R7      p\        WBP                  . RO4      4       R# )r$   r   r  Nr   r   r   r   r   r  r   s   &&&  r8   test_binary_dilation11,TestNdimageMorphology.test_binary_dilation11]  sP     xx5)Qzz$%%d15!#zz/'BCr;   c                    \         P                  ! ^.VR7      p^V^&   VP                  V4      pVP                  . RO4      p\        P                  ! W44      p\        WRP                  . RO4      4       R# )r$   r   Nr  )r   r   r   r   r   r  r  s   &&&   r8   test_binary_dilation12,TestNdimageMorphology.test_binary_dilation12f  s\     xx5)Qzz$I&%%d3!#zz/'BCr;   c                    \         P                  ! ^.VR7      p^V^&   VP                  V4      pVP                  . RO4      p\        P                  ! W4^R7      p\        WRP                  . RO4      4       R# r
  r  r  s   &&&   r8   test_binary_dilation13,TestNdimageMorphology.test_binary_dilation13p  s^     xx5)Qzz$I&%%dC!#zz/'BCr;   c                    \         P                  ! ^.VR7      p^V^&   VP                  V4      pVP                  . RO4      p\        P                  ! W4RR7      p\        WRP                  . RO4      4       R# )r$   r   r  Nr  r  )r   r   r   r   r   r  r  s   &&&   r8   test_binary_dilation14,TestNdimageMorphology.test_binary_dilation14z  s^     xx5)Qzz$I&%%d2>!#zz/'BCr;   c                    \         P                  ! ^.VR7      p^V^&   VP                  V4      pVP                  . RO4      p\        P                  ! W4R^R7      p\        WRP                  . RO4      4       R# )r$   r   r  r   Nr  r  r  r  r  s   &&&   r8   test_binary_dilation15,TestNdimageMorphology.test_binary_dilation15  sd     xx5)Qzz$I&%%d-/aA!#zz/'BCr;   c                    \        W!4      pVP                  ^^.VR7      p\        P                  ! V4      p\	        WBP                  ^..4      4       R# r   r  r   s   &&&  r8   test_binary_dilation16,TestNdimageMorphology.test_binary_dilation16  sI     "ww1vUw+%%d+!#zzA3%'89r;   c                    \        W!4      pVP                  ^^.VR7      p\        P                  ! V4      p\	        WBP                  ^ ..4      4       R# r   r  r   s   &&&  r8   test_binary_dilation17,TestNdimageMorphology.test_binary_dilation17  sI     "xxAex,%%d+!#zzA3%'89r;   c                    \        W!4      pVP                  ^^.VR7      p\        P                  ! V4      p\	        WBP                  . RO.4      4       R# )r   r   Nr   r  r   s   &&&  r8   test_binary_dilation18,TestNdimageMorphology.test_binary_dilation18  sG     "ww1vUw+%%d+!#zz9+'>?r;   c           	         \        W!4      pVP                  ^^.VR7      p\        P                  ! V4      p\	        WBP                  . RO. RO. RO.4      4       R# r  r  r   s   &&&  r8   test_binary_dilation19,TestNdimageMorphology.test_binary_dilation19  sU     "ww1vUw+%%d+!#zz93<3<3> (? 	@r;   c           	         \         P                  ! ^^.VR7      p^VR&   VP                  V4      p\        P                  ! V4      p\        WBP                  . RO. RO. RO.4      4       R# )r    r   Nr   r   r   r   r  r   s   &&&  r8   test_binary_dilation20,TestNdimageMorphology.test_binary_dilation20  s`     xxAe,T
zz$%%d+!#zz93<3<3> (? 	@r;   c           	     (   \         P                  ! ^^4      pVP                  V4      p\        P                  ! ^^.VR7      p^VR&   VP                  V4      p\         P
                  ! WC4      p\        WRP                  . RO. RO. RO.4      4       R# )r   r   Nr  r   )r   r   r/   rX   rT   r  r   )r2   r   r3   r   r4   r5   s   &&&   r8   test_binary_dilation21,TestNdimageMorphology.test_binary_dilation21  s     221a8F#xxAe,T
zz$%%d3!#zz93<3<3> (? 	@r;   c                
   \        W!4      p. RO. RO. RO. RO. RO. RO. R	O. R
O.pVP                  V4      pVP                  . R
O. RO. R
O. RO. RO. R	O. R
O. R
O.VR7      p\        P                  ! V4      p\	        WS4       R# )r   r   Nr8  r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r;  r<  r7  r4  r5  r6  r.   r/   r   r  r   r?  s   &&&   r8   test_binary_dilation22,TestNdimageMorphology.test_binary_dilation22  s     ",,,,,,,,. ::h'zz333333335 =B  C %%d+!#0r;   c                   \        W!4      p. RO. RO. RO. RO. RO. RO. R	O. RO.pVP                  V4      pVP                  . R
O. RO. R
O. RO. RO. RO. R
O. R
O.VR7      p\        P                  ! V^R7      p\	        WS4       R# )r   r   r   Nr   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   r4  r8  r5  r6  r7  r  r?  s   &&&   r8   test_binary_dilation23,TestNdimageMorphology.test_binary_dilation23  s     ",,,,,,,,. ::h'zz333333335 =B  C %%d;!#0r;   c                   \        W!4      p. RO. RO. RO. RO. RO. R	O. R
O. R
O.pVP                  V4      pVP                  . R
O. RO. R
O. RO. RO. RO. R
O. R
O.VR7      p\        P                  ! VRR7      p\	        WS4       R# )r   r   r  Nr   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   r;  )r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   rT  r4  r8  r5  r6  r7  r  r  r?  s   &&&   r8   test_binary_dilation24,TestNdimageMorphology.test_binary_dilation24  s     ",,,,,,,,. ::h'zz333333335 =B  C %%d6:!#0r;   c                   \        W!4      p. RO. RO. RO. RO. RO. R	O. RO. RO.pVP                  V4      pVP                  . R
O. RO. R
O. RO. RO. RO. R
O. R
O.VR7      p\        P                  ! VR^R7      p\	        WS4       R# )r   r   r  Nr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r:  r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r4  r8  r5  r6  r7  r  r  r?  s   &&&   r8   test_binary_dilation25,TestNdimageMorphology.test_binary_dilation25  s     ",,,,,,,,. ::h'zz333333335 =B  C %%d6J!#0r;   c                Z   \        W!4      p\        P                  ! ^^4      p. RO. RO. RO. RO. RO. RO. RO. RO.pVP                  V4      pVP                  V4      pVP                  . RO. RO. RO. R	O. R
O. RO. RO. RO.VR7      p\        P                  ! WS4      p\        Wd4       R# )r   r   Nr  )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r<  r4  r8  r5  r6  r7  )r.   r   r   r/   r  r   rC  s   &&&    r8   test_binary_dilation26,TestNdimageMorphology.test_binary_dilation26)  s     "221a8,,,,,,,,. F#::h'zz333333335 =B  C %%d3!#0r;   c                <   \        W!4      p^ ^.^^..p. RO. RO. RO. RO. RO. RO. R	O. R	O.pVP                  V4      pVP                  V4      pVP                  . R	O. RO. R	O. RO. R
O. RO. R	O. R	O.VR7      p\        P                  ! WS4      p\	        Wd4       R# )r   r   Nr8  r  r5  rG  r;  r   r   r   r   r   r   r   r   r4  r6  r7  r  rC  s   &&&    r8   test_binary_dilation27,TestNdimageMorphology.test_binary_dilation27C  s     "a&a&,,,,,,,,. F#::h'zz333333335 =B  C %%d3!#0r;   c                    \        W!4      p. RO. RO. RO. RO.pVP                  V4      pVP                  . RO. RO. RO. RO.VR7      p\        P                  ! V^R7      p\	        WS4       R# )r   r   r   N)r   r   r   r   )r   r   r   r   )r   r   r   r   r  r?  s   &&&   r8   test_binary_dilation28,TestNdimageMorphology.test_binary_dilation28^  su     "    " ::h'zz<''') 16  7 %%d;!#0r;   c                :   ^ ^.^^..p. RO. RO. RO. RO. RO.pVP                  V4      pVP                  V4      p\        P                   ! . RO. RO. RO. RO. RO.\        R7      pVP                  V4      p\        P                  ! WB^R7      p\        WS4       R# )r   r   r  Nr  r   r   r   r   r   r   r   r   r   r   r   r/   rX   r   r   r  r   rb  s   &&    r8   test_binary_dilation29,TestNdimageMorphology.test_binary_dilation29n       a&a&#####	%
 F#::h'zz?****	, 48	9
 zz$%%dqA!#0r;   z!output= arrays are numpy-specificc                   ^ ^.^^..p. RO. RO. RO. RO. RO.pVP                  V4      pVP                  V4      pVP                  . RO. RO. RO. RO. RO.\        R7      pVP                  V4      p\        P                  ! VP                  \        R7      pVP                  V4      p\
        P                  ! WB^VR7       \        WS4       R# )r   r   r\  rj  Nr  r  r  r   )r/   r   rX   rT   rU   r   r  r   rb  s   &&    r8   test_binary_dilation30,TestNdimageMorphology.test_binary_dilation30  s     a&a&#####	%
 F#::h'zz?****	, 48	  9
 zz$hhtzz.jjo3G!#0r;   c                :   ^ ^.^^..p. RO. RO. RO. RO. RO.pVP                  V4      pVP                  V4      p\        P                   ! . RO. RO. RO. RO. RO.\        R7      pVP                  V4      p\        P                  ! WB^R7      p\        WS4       R# )	r   r   r  Nr  r  r   r   r   r   r   r   r  r  rb  s   &&    r8   test_binary_dilation31,TestNdimageMorphology.test_binary_dilation31  r  r;   c                   ^ ^.^^..p. RO. RO. RO. RO. RO.pVP                  V4      pVP                  V4      p\        P                   ! . RO. RO. RO. RO. RO.\        R7      pVP                  V4      p\        P                  ! VP                  \        R7      pVP                  V4      p\
        P                  ! WB^VR7       \        WS4       R# )	r   r   r!  Nr  r  r   r%  r  r/   rX   r   rT   rU   r   r  r   rb  s   &&    r8   test_binary_dilation32,TestNdimageMorphology.test_binary_dilation32  s     a&a&#####	%
 F#::h'zz?****	, 48	9
 zz$hhtzz.jjo3G!#0r;   c                &   . RO. RO. RO.pVP                  V4      p\        P                   ! . RO. RO. RO. RO. R	O. R
O. RO. RO.\        R7      pVP                  V4      p\        P                   ! . RO. RO. RO. RO. R	O. R
O. RO. RO.\        R7      pVP                  V4      p\        P                   ! . RO. RO. RO. RO. RO. RO. RO. RO.\        R7      pVP                  V4      p\        P                  ! WRRV^ R7      p\        Wc4       R# )r   r   r\  r  r   Nr   r   r8  r4  r   r   r   r   r   r   r   r   r  r  r   r   r   r   r   r   r   r   r  r  r  s   &&     r8   test_binary_dilation33,TestNdimageMorphology.test_binary_dilation33  s     F#::777777779 AEF ::h'zz333333335 =AB zz$zz333333335 =AB zz$%%dr+/aA!#0r;   z)inplace output= arrays are numpy-specificc                   . RO. RO. RO.pVP                  V4      p. RO. RO. RO. R	O. R	O. R	O. R	O. R	O.p\        P                   ! . RO. RO. RO. R
O. RO. RO. R	O. R	O.\        R7      pVP                  V4      p\        P                  ! VP                  \        R7      pVP                  V4      p\
        P                  ! WRRV^R7      p\        Wc4       R# )r   r   r-  Nr   r   r8  r   r   r   r   r   r   r   r   rS  r4  r5  r6  r7  r  r)  r  s   &&     r8   test_binary_dilation34,TestNdimageMorphology.test_binary_dilation34  s      F#,,,,,,,,. zz333333335 =AB zz$xx

$/zz$%%dr+/aA!#0r;   c                   \        W!4      p. RO. RO. RO. RO. RO. R	O. RO. RO.p\        P                  ! . R
O. RO. R
O. RO. RO. RO. R
O. R
O.4      p. R
O. R
O. R
O. RO. RO. RO. R
O. R
O.p\        P                  ! V\        R7      p\        P                  ! W54      p\        P                  ! V\        P
                  ! V4      4      p\        P                  ! Wc4      pVP                  V4      pVP                  V4      pVP                  . R
O. RO. R
O. RO. RO. RO. R
O. R
O.VR7      p\        P                  ! WER^R7      p\        Wv4       R# )r   r   )r  r  r   Nr  r	  r:  r
  r   r  r4  r8  r5  r6  r7  r;  r  )
r.   rX   r/   r   r  r  r  r   r  r   )r2   r   r3   r  r4   r  r7   r5   s   &&&     r8   test_binary_dilation35,TestNdimageMorphology.test_binary_dilation35  s7    "'''''''') zz333333335 6 )(((((((* zz$d+>>#,nnT2>>$#78==/zz$::h'zz333333335 =B  C %%d-3!E!#0r;   c                    \         P                  ! . \        R 7      pVP                  V4      p\        P
                  ! VRR7      pW1P                  R4      8X  g   Q hR# )r   r  FNr  )rX   rT   r   r/   r   r  )r2   r3   r4   r5   s   &&  r8   test_binary_dilation36,TestNdimageMorphology.test_binary_dilation36I  sI     xx$'zz$%%dr:jj''''r;   c                $   . RO. RO. RO.pVP                  V4      p\        P                   ! . RO. RO. RO. RO. R	O. R
O. RO. RO.\        R7      pVP                  V4      p\        P                   ! . RO. RO. RO. RO. R	O. R
O. RO. RO.\        R7      pVP                  V4      p\        P                   ! . RO. RO. RO. RO. RO. RO. RO. RO.\        R7      pVP                  V4      p\        P                  ! WRV^ R7      p\        Wc4       R# )r   r   r  r   Nr   r   r8  r4  r.  r  r  r/  )r/   rX   r   r   binary_propagationr   r  s   &&     r8   test_binary_propagation01/TestNdimageMorphology.test_binary_propagation01Q  s	    F#::777777779 AEF ::h'zz333333335 =AB zz$zz333333335 =AB zz$((.2D!#0r;   c                   . RO. RO. RO.p. RO. RO. RO. R	O. R	O. R	O. R	O. R	O.pVP                  V4      pVP                  V4      p\        P                   ! . RO. RO. RO. R
O. RO. RO. R	O. R	O.\        R7      pVP                  V4      p\        P                  ! VP                  \        R7      pVP                  V4      p\
        P                  ! WRV^R7      p\        Wc4       R# )r   r   r=  Nr   r   r8  r3  rS  r4  r5  r6  r7  )r/   rX   r   rT   rU   r   r>  r   r  s   &&     r8   test_binary_propagation02/TestNdimageMorphology.test_binary_propagation02v  s     -,,,,,,,. ::h'F#zz333333335 =AB zz$xx

$/zz$((.2D!#0r;   c                    VP                  \        P                  ! . \        R 7      4      pVP                  \        P                  ! . \        R 7      4      p\        P
                  ! V4      pWC8X  g   Q hR# r   )r/   rX   rT   r   r   r>  )r2   r3   r4   r7   r5   s   &&   r8   test_binary_propagation03/TestNdimageMorphology.test_binary_propagation03  sP     zz"((2T23::bhhr67((.r;   c                
   \        W!4      p. RO. RO. RO. RO. RO. RO. RO. R	O.pVP                  V4      pVP                  . RO. RO. RO. R
O. RO. RO. RO. R	O.VR7      p\        P                  ! V4      p\	        WS4       R# )r   r   Nr8  r  r  r   r   r   r   r   r   r   r   r7  r<  r4  r  r   r   r   r   r   r   r   r   )r.   r/   r   binary_openingr   r?  s   &&&   r8   test_binary_opening01+TestNdimageMorphology.test_binary_opening01       ",,,,,,,,. ::h'zz333333335 =B  C $$T*!#0r;   c                Z   \        W!4      p\        P                  ! ^^4      p. RO. RO. RO. RO. RO. RO. RO. RO.pVP                  V4      pVP                  V4      pVP                  . RO. RO. RO. RO. RO. R	O. R	O. RO.VR7      p\        P                  ! WS4      p\        Wd4       R# )
r   r   Nr  r4  )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r   r   r   r   r   r   r   r   r<  )r.   r   r   r/   rJ  r   rC  s   &&&    r8   test_binary_opening02+TestNdimageMorphology.test_binary_opening02       "221a8,,,,,,,,. ::h'F#zz333333335 =B  C $$T2!#0r;   c                
   \        W!4      p. RO. RO. RO. RO. RO. RO. R	O. RO.pVP                  V4      pVP                  . R
O. RO. RO. RO. RO. RO. R	O. RO.VR7      p\        P                  ! V4      p\	        WS4       R# )r   r   Nr4  r3  )r   r   r   r   r   r   r   r   r  r;  r<  r7  r8  r  r  r  rI  )r.   r/   r   binary_closingr   r?  s   &&&   r8   test_binary_closing01+TestNdimageMorphology.test_binary_closing01  rM  r;   c                Z   \        W!4      p\        P                  ! ^^4      p. RO. RO. RO. RO. RO. RO. RO. RO.pVP                  V4      pVP                  V4      pVP                  . RO. RO. RO. RO. R	O. RO. RO. RO.VR7      p\        P                  ! WS4      p\        Wd4       R# )
r   r   Nr4  r3  r<  r  rO  r  rP  )r.   r   r   r/   rU  r   rC  s   &&&    r8   test_binary_closing02+TestNdimageMorphology.test_binary_closing02  rS  r;   c           
     P   \         P                  ! . RO. RO. RO. RO. RO. RO. RO.\        R7      pVP                  V4      p\         P                  ! . RO. RO. RO. RO. RO. RO. RO.\        R7      pVP                  V4      p\        P                  ! V4      p\        WB4       R# )r   r   Nr4  r;  r7  rX   r/   r   r   binary_fill_holesr   r2   r3   r7   r4   r5   s   &&   r8   test_binary_fill_holes01.TestNdimageMorphology.test_binary_fill_holes01 	  s    ::77777779 AEF ::h'zz33333335 =AB zz$''-!#0r;   c           
     P   \         P                  ! . RO. RO. RO. RO. RO. RO. RO.\        R7      pVP                  V4      p\         P                  ! . RO. RO. RO. RO. RO. RO. RO.\        R7      pVP                  V4      p\        P                  ! V4      p\        WB4       R# )r   r   Nr4  r6  r;  r7  r\  r^  s   &&   r8   test_binary_fill_holes02.TestNdimageMorphology.test_binary_fill_holes02	      ::77777779 AEF ::h'zz33333335 =AB zz$''-!#0r;   c           
     P   \         P                  ! . RO. RO. RO. RO. RO. RO. RO.\        R7      pVP                  V4      p\         P                  ! . RO. RO. RO. RO. RO. RO. RO.\        R7      pVP                  V4      p\        P                  ! V4      p\        WB4       R# )	r   r   Nr4  rS  )r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   r\  r^  s   &&   r8   test_binary_fill_holes03.TestNdimageMorphology.test_binary_fill_holes03,	  rd  r;   )cpu_onlyz2these filters do not yet have axes support in CuPyz	jax.numpyz.these filters are not implemented in JAX.numpyr   r  expand_axisfuncc           
     H   VP                   p\        P                  ! . R
O. RO. R
O.\        4      pVP                  V4      p\        P                  ! . RO. RO. RO. RO. RO. RO. RO.\        4      pVP                  V4      pVR8X  d   \	        WDR7      p	M\	        VR7      p	VR9  p
V
'       d   WYR&   MV^ 8w  d   \
        P                  ! R4       V! W3/ V	B p^pVP                  V.V,          VR7      pVP                  V.V,          VR7      p. ROpVP                  V4       \        V4      '       g   \        V4      '       dC   VP                  \        P                  ! VP                  \        4      4      pV! W3RVRV/V	B  MV! W3RV/V	B p\        W4       R	# )r   binary_hit_or_miss)origin1origin2r  r   z-border_value !=0 unsupported by this functionr   rj  axesNr   r   r^  )r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r`  )r   r   r   r   r   r   r   )rl  r]  r   r   r   )__name__rX   r/   r   dictpytestskipstackremover   r   rT   rU   r   )r2   r3   rj  ri  r  r   	func_namer   r4   kwargsborder_supportedr7   n_repsro  r5   s   &&&&&&         r8   test_binary_axes&TestNdimageMorphology.test_binary_axesA	  s   ( MM	Y&&()-/ F#zz00000002 489 zz$,,&9F(F$ -B B%1>"QKKGH// 88XJ/k8Bxxkx: K B<<72;;**RXXdjj$78C?c??? t9$9&9C&r;   c           	         VP                  . RO. RO. RO.4      pVP                  . RO. RO.4      p\        P                  ! W#R7      p\        VVP                  . RO. R	O. R
O.4      4       R# )r    	footprintNr    r   r$   r   r   r%   r"   rl   r    r$   r$   r   r    r%   r   r  r   r   r   r   r   r   r   r   r   r    r   r    r   r$   r$   r    r    r   r/   r   grey_erosionr   r2   r3   arrayr  rj  s   &&   r8   test_grey_erosion01)TestNdimageMorphology.test_grey_erosion01	  sg    

O++- . JJ	956	%%eA!&"$**o.=.=.? #@	Ar;   z!output=array requires buffer viewz
dask.arrayz(https://github.com/cupy/cupy/issues/8398c           	         VP                  . RO. RO. RO.4      pVP                  . RO. RO.4      p\        P                  ! W#VR7       \        VVP                  . RO. R	O. R
O.4      4       R# )r    )r  rj  Nr  r  r  r  r  r  r  r  r  )r2   r3   r  r  s   &&  r8   test_grey_erosion01_overlap1TestNdimageMorphology.test_grey_erosion01_overlap	  sh     

O++- . JJ	956	UF!%"$**o.=.=.? #@	
r;   c           	        VP                  . RO. RO. RO.4      pVP                  . RO. RO.4      pVP                  . RO. RO.4      p\        P                  ! W#VR7      p\        VVP                  . R	O. R
O. RO.4      4       R# )r    r  r  Nr  r  r  r  r  r'  r  r  r  r  r2   r3   r  r  r  rj  s   &&    r8   test_grey_erosion02)TestNdimageMorphology.test_grey_erosion02	  ~    

O++- . JJ	956	JJ	956	%%e09;!&"$**o.=.=.? #@	
r;   c           	        VP                  . RO. RO. RO.4      pVP                  . RO. RO.4      pVP                  . RO. RO.4      p\        P                  ! W#VR7      p\        VVP                  . R	O. R
O. RO.4      4       R# )r    r  Nr  r  r  r  r  r   r  )r   r   r   r   r   )r   r   r   r   r   r  r  s   &&    r8   test_grey_erosion03)TestNdimageMorphology.test_grey_erosion03	  r  r;   c           	         VP                  . RO. RO. RO.4      pVP                  . RO. RO.4      p\        P                  ! W#R7      p\        VVP                  . RO. R	O. R
O.4      4       R# )r    r~  Nr  r  r  r   r  r%   r%   rl   rl   r$   r%   rl   r   rl   r%   r   r   r   r%   r%   r/   r   grey_dilationr   r  s   &&   r8   test_grey_dilation01*TestNdimageMorphology.test_grey_dilation01	  sf    

O++- . JJ	956	&&uB!&"$**o.=.=.? #@	
r;   c           	        VP                  . RO. RO. RO.4      pVP                  . RO. RO.4      pVP                  . RO. RO.4      p\        P                  ! W#VR7      p\        VVP                  . R	O. R
O. RO.4      4       R# )r    r  Nr  r  r  r   r  r'  r  r  r  r  r  s   &&    r8   test_grey_dilation02*TestNdimageMorphology.test_grey_dilation02	  s~    

O++- . JJ	956	JJ	956	&&u1:<!&"$**o.=.=.? #@	
r;   c           	        VP                  . RO. RO. RO.4      pVP                  . RO. RO.4      pVP                  . RO. RO.4      p\        P                  ! W#VR7      p\        VVP                  . R	O. R
O. RO.4      4       R# )r    r  Nr  r  r  r   r  r   )r   r   
   r  r"   )r   r  rl   r  r   )rl   rl   rl   r   r   r  r  s   &&    r8   test_grey_dilation03*TestNdimageMorphology.test_grey_dilation03	  s    

O++- . JJ	956	JJ	956	&&u1:<!&"$**.?.?.=.? #@	
r;   c                   VP                  . RO. RO. RO.4      pVP                  . RO. RO.4      p\        P                  ! W#R7      p\        P                  ! WCR7      p\        P                  ! W#R7      p\        We4       R# r    r~  Nr  r  r  r  r  r/   r   r  r  grey_openingr   r2   r3   r  r  r  r7   rj  s   &&     r8   test_grey_opening01)TestNdimageMorphology.test_grey_opening01	  sj    

O++- . JJ	956	""5>((B%%eA!&3r;   c                <   VP                  . RO. RO. RO.4      pVP                  . RO. RO.4      pVP                  . RO. RO.4      p\        P                  ! W#VR7      p\        P                  ! WSVR7      p\        P                  ! W#VR7      p\        Wv4       R# 	r    r  Nr  r  r  r  r  r'  r  r2   r3   r  r  r  r  r7   rj  s   &&      r8   test_grey_opening02)TestNdimageMorphology.test_grey_opening02	  s    

O++- . JJ	956	JJ	956	""5-68((3<>%%e09;!&3r;   c                   VP                  . RO. RO. RO.4      pVP                  . RO. RO.4      p\        P                  ! W#R7      p\        P                  ! WCR7      p\        P                  ! W#R7      p\        We4       R# r  r/   r   r  r  grey_closingr   r  s   &&     r8   test_grey_closing01)TestNdimageMorphology.test_grey_closing01 
  sj    

O++- . JJ	956	##E?''A%%eA!&3r;   c                <   VP                  . RO. RO. RO.4      pVP                  . RO. RO.4      pVP                  . RO. RO.4      p\        P                  ! W#VR7      p\        P                  ! WSVR7      p\        P                  ! W#VR7      p\        Wv4       R# r  r  r  s   &&      r8   test_grey_closing02)TestNdimageMorphology.test_grey_closing02
  s    

O++- . JJ	956	JJ	956	##E.79''2;=%%e09;!&3r;   c                   VP                  . RO. RO. RO.4      pVP                  . RO. R	O.4      pVP                  . R
O. R
O.4      p\        P                  ! W#VR7      p\        P                  ! W#VR7      pWV,
          pVP	                  VP
                  VP                  R7      p\        P                  ! W#WHR7       \        W4       R# r    r  r   )r  r  rj  Nr  r  r  r  r  r'  )	r/   r   r  r  rT   rU   r   morphological_gradientr   	r2   r3   r  r  r  tmp1tmp2r7   rj  s	   &&       r8   test_morphological_gradient013TestNdimageMorphology.test_morphological_gradient01
  s     

O++- . JJ	956	JJ	956	$$U/8:##E.79;%++U[[9&&u1:	K!&3r;   c                L   VP                  . RO. RO. RO.4      pVP                  . RO. RO.4      pVP                  . RO. RO.4      p\        P                  ! W#VR7      p\        P                  ! W#VR7      pWV,
          p\        P                  ! W#VR7      p\        W4       R# r  )r/   r   r  r  r  r   r  s	   &&       r8   test_morphological_gradient023TestNdimageMorphology.test_morphological_gradient02-
  s     

O++- . JJ	956	JJ	956	$$U/8:##E.79;//:CE!&3r;   c                   VP                  . RO. RO. RO.4      pVP                  . RO. R	O.4      pVP                  . R
O. R
O.4      p\        P                  ! W#VR7      p\        P                  ! W#VR7      pWV,           ^V,          ,
          pVP	                  VP
                  VP                  R7      p\        P                  ! W#WHR7       \        W4       R# r  )	r/   r   r  r  rT   rU   r   morphological_laplacer   r  s	   &&       r8   test_morphological_laplace012TestNdimageMorphology.test_morphological_laplace01>
  s     

O++- . JJ	956	JJ	956	$$U/8:##E.79;U*%++U[[9%%e09	J!&3r;   c                h   VP                  . RO. RO. RO.4      pVP                  . RO. RO.4      pVP                  . RO. RO.4      p\        P                  ! W#VR7      p\        P                  ! W#VR7      pWV,           ^V,          ,
          p\        P                  ! W#VR7      p\        W4       R# r  )r/   r   r  r  r  r   r  s	   &&       r8   test_morphological_laplace022TestNdimageMorphology.test_morphological_laplace02Q
  s     

O++- . JJ	956	JJ	956	$$U/8:##E.79;U*..u9BD!&3r;   c                j   VP                  . RO. RO. RO.4      pVP                  . RO. R	O.4      pVP                  . R
O. R
O.4      p\        P                  ! W#VR7      pW%,
          pVP                  VP                  VP
                  R7      p\        P                  ! W#WGR7       \        Wv4       R# r  )r/   r   r  rT   rU   r   white_tophatr   r  s   &&      r8   test_white_tophat01)TestNdimageMorphology.test_white_tophat01b
  s     

O++- . JJ	956	JJ	956	""5-68;%++U[[9U'0	A!&3r;   c                   VP                  . RO. RO. RO.4      pVP                  . RO. RO.4      pVP                  . RO. RO.4      p\        P                  ! W#VR7      pW%,
          p\        P                  ! W#VR7      p\	        Wv4       R# r  )r/   r   r  r  r   r  s   &&      r8   test_white_tophat02)TestNdimageMorphology.test_white_tophat02s
  s~    

O++- . JJ	956	JJ	956	""5-68;%%e09;!&3r;   z	cupy#8399c           
        \         P                  ! . RO. RO. RO. RO. RO. RO. RO.\        R7      pVP                  V4      p\         P                  ! R\        R7      pVP                  V4      p\         P                  ! . R	O. R
O. R
O. RO. RO. RO. RO.\        R7      pVP                  V4      p\        P
                  ! W#R7      p\        WT4       R# )r   r   r  Nr   r   r   r   r   r   r   r`  r   r   r   r   r   r   r   r  r   )r   r   r   r   r   r   r   )r   r   r   r   r   r   r   )r   r   r   r   r   r   r   )r   r   r   r   r   r   r   )r   r   r   r   r   r   r   )rX   r/   r   r   r   r  r   r2   r3   r  r  r7   rj  s   &&    r8   test_white_tophat03)TestNdimageMorphology.test_white_tophat03
       

11111113 ;?@ 

5!GGF$/	JJy)	::44444446 >BC ::h'%%eA)r;   c                "   \         P                  ! ^\        R7      p\         P                  ! R\        R7      pVP	                  V4      pVP	                  V4      pVP                  W!P                  R7      p\        P                  ! W#VR7       R# r$   r   )r  rj  Nr   )	rX   eyer   r   r/   
empty_likerV   r   r  r2   r3   r  r  rj  s   &&   r8   test_white_tophat04)TestNdimageMorphology.test_white_tophat04
  sf     q%GGF$/	

5!JJy)	 uJJ7UGr;   c                j   VP                  . RO. RO. RO.4      pVP                  . RO. R	O.4      pVP                  . R
O. R
O.4      p\        P                  ! W#VR7      pWR,
          pVP                  VP                  VP
                  R7      p\        P                  ! W#WGR7       \        Wv4       R# r  )r/   r   r  rT   rU   r   black_tophatr   r  s   &&      r8   test_black_tophat01)TestNdimageMorphology.test_black_tophat01
  s     

O++- . JJ	956	JJ	956	""5-68;%++U[[9U'0	A!&3r;   c                   VP                  . RO. RO. RO.4      pVP                  . RO. RO.4      pVP                  . RO. RO.4      p\        P                  ! W#VR7      pWR,
          p\        P                  ! W#VR7      p\	        Wv4       R# r  )r/   r   r  r  r   r  s   &&      r8   test_black_tophat02)TestNdimageMorphology.test_black_tophat02
  s~    

O++- . JJ	956	JJ	956	""5-68;%%e09;!&3r;   zcupy/cupy#8399c           
        \         P                  ! . RO. RO. RO. RO. RO. RO. RO.\        R7      pVP                  V4      p\         P                  ! R\        R7      pVP                  V4      p\         P                  ! . R	O. R
O. R
O. R
O. RO. R
O. RO.\        R7      pVP                  V4      p\        P
                  ! W#R7      p\        WT4       R# )r   r   r  Nr  r`  r  r  r   )r   r   r   r   r   r   r   )r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r  )rX   r/   r   r   r   r  r   r  s   &&    r8   test_black_tophat03)TestNdimageMorphology.test_black_tophat03
  r  r;   c                   VP                  \        P                  ! ^\        R7      4      pVP                  \        P                  ! R\        R7      4      pVP                  W!P                  R7      p\        P                  ! W#VR7       R# r  )	r/   rX   r  r   r   r  rV   r   r  r  s   &&   r8   test_black_tophat04)TestNdimageMorphology.test_black_tophat04
  s\     

266!401JJrwwvT:;	 uJJ7UGr;   modefootprint_modec           
        VP                  . R
O. RO. RO. RO. RO. RO. RO.4      p\        WFR7      pVR8X  d   RVR&   MVP                  . RO. RO.4      VR&   VR8X  d   VP                  VR,          4      VR&   V! V3/ VB p	^p
VP                  V	.V
,          VR7      p	VP                  V.V
,          VR7      p. ROpVP	                  V4       \        V4      '       g   \        V4      '       d6   VP                  V	P                  V	P                  R7      pV! V3RVRV/VB  MV! V3RV/VB p\        W4       R	# )r   )r  r  sizer  r  r   r   rj  ro  Nr^  )r   r   r   r   r   r   r   )r   r   r   r   r   r   r   )r   r    r   r"   r$   r   r   )r   r   r$   r    r    r   r   )r   r   rl   r    r   r   r   )r   r   r   r   r   r   r   )r   r    r  r  rp  )r/   rr  	ones_likeru  rv  r   r   rT   rU   r   r   )r2   r3   rj  ri  r  r  r  r4   rx  r7   rz  ro  r5   s   &&&&&&&      r8   test_grey_axes$TestNdimageMorphology.test_grey_axes
  s;   4 zz00000002 3 V/V##F6N"$**i-C"DF;[("$,,vk/B"CF;'' 88XJ/k8Bxxkx: K B<<72;;((8>>(@C7c777 t1$1&1C&r;   !inplace output= is numpy-specificc                   \        W!4      p. RO. RO. RO.pVP                  V4      p. RO. RO. RO. RO. RO. RO. RO. RO.pVP                  V4      pVP                  . RO. RO. R	O. R
O. RO. RO. RO. RO.VR7      pVP                  \        P                  ! VP                  \
        R7      4      p\        P                  ! WSVR7       \        Wd4       R# )r   r   rj  Nr   r   r  )r   r   r   r   r   r  r  )r   r   r   r   r   r   )r   r   r   r   r   )	r.   r/   rX   rT   rU   r   r   rl  r   rC  s   &&&    r8   test_hit_or_miss01(TestNdimageMorphology.test_hit_or_miss01)  s    
 " F#########% ::h'zz?*******, 49  : jj$**D9:""4<!#0r;   c                   \        W!4      p. RO. RO. RO.p. RO. RO. RO. RO.pVP                  V4      pVP                  V4      pVP                  . RO. RO. R	O. RO.VR7      p\        P                  ! WS4      p\	        Wd4       R# )
r   r   Nr   r   r4  r8  r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   rM  r.   r/   r   rl  r   rC  s   &&&    r8   test_hit_or_miss02(TestNdimageMorphology.test_hit_or_miss02H  s     " -,,,. F#::h'zz33335 =B  C ((6!#0r;   c                |   \        W!4      p. RO. RO. RO.p. RO. RO. RO.p. RO. RO. RO. RO. RO. RO. RO. RO.pVP                  V4      pVP                  V4      pVP                  V4      pVP                  . RO. R	O. R
O. RO. RO. RO. RO. RO.VR7      p\        P                  ! WcV4      p\	        Wu4       R# )r   r   Nr'  r   r5  r4  rS  r  r  rM  r  rP  rH  r<  r  )r2   r   r3   struct1struct2r7   r4   r5   s   &&&     r8   test_hit_or_miss03(TestNdimageMorphology.test_hit_or_miss03\  s     "  -,,,,,,,. **W%**W%::h'zz333333335 =B  C ((@!#0r;    N)r   r   )r  r   rp  )reflectconstantnearestmirrorwrap)r  r  r  )rq  
__module____qualname____firstlineno__r   r   r0   rs  markparametrizer   r9   r@   rF   skip_xp_backendsr`   xfail_xp_backendsri   rm   rr   rx   r{   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r  r!  r$  r(  r+  r.  r1  r@  rD  rH  rN  rV  rc  rl  rp  rs  rz  r}  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r"  r&  r*  r0  r4  r7  r:  r>  r?  rB  rE  rJ  rK  rQ  rU  rV  rY  r]  r_  rb  rf  r	   rl  r{  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  __static_attributes____classdictcell____classdict__s   @r8   r   r      s    w445[[We,.0 - 6.0` w445[[We,.0 - 6.0` w445[[We,.0 - 6.0b K w445[[We,0/ - 6
0/d v&PQw445[[We,-0 - 6 R-0^ w445[[We,-0 - 6-0^ w445 6  w44557[[We,%0 -7%0N w44557[[We,#0 -7#0J I w556[[We,// - 7
//b R w556 7( w~6w556[[We,% - 7 7%" f%OPw55446[[We,* -6 Q*8 D w55446[[We,:/ -6:/x w55446[[We,, -6,  w55446[[We,, -6,  Q w5569 79
 R w556 7( w889 : w8895 :5 w8897 :7 w8897 :7 w0011 21 w0011 21 w001  2   w--.[[We,5 - /5 w--.[[We,5 - /5 w--.[[We,8 - /8 w--.[[We,8 - /8 w--.[[We,> - /> v&PQw--.[[We,> - / R> w--.[[We,> - /> w--.[[We,D - /D w--.[[We,D - /D w--.[[We,D - /D w--.[[We,D - /D w--.[[We,D - /D w--.[[We,D - /D w--.[[We,D - /D w--.[[We,D - /D w--.[[We,D - /D w--.[[We,: - /: w--.[[We,: - /: w--.[[We,@ - /@ w--.[[We,@ - /@ w--.[[We,@ - /@ w--.[[We,@ - /@ w--.[[We,1 - /1, w--.[[We,1 - /10 w--.[[We,1 - /10 w--.[[We,1 - /14 w--.[[We,1 - /16 N w--.1 /12 dxHJvOQw--.1 /QJ
18 N w--.1 /12 dxHJvOQw--.2 /QJ
2B dxHJw--.1 /J18 vOQw--.1 /Q12 vOQw--.1 /Q1B w--.1 /1B dxHJw--.'1 /J'1R vOQw--.'1 /Q'1R dxHJvOQw--. /QJ
 w--.D /D dxHJvOQw--.1 /QJ
1: dxHJvOQw--.1 /QJ
1: [[We,w../5 0 -5 [[We,w../( 0 -( [[We,w../I 0 -I [[We,w../8 0 -8 [[We,w../> 0 -> [[We,w../> 0 -> [[We,w../> 0 -> [[We,w../> 0 -> [[We,w../D 0 -D [[We,w../D 0 -D [[We,w../D 0 -D [[We,w../D 0 -D [[We,w../D 0 -D [[We,w../D 0 -D [[We,w../D 0 -D [[We,w../D 0 -D [[We,w../: 0 -: [[We,w../: 0 -: [[We,w../@ 0 -@ [[We,w../@ 0 -@ [[We,w../@ 0 -@ [[We,w../	@ 0 -	@ [[We,w../1 0 -1, [[We,w../1 0 -1, [[We,w../1 0 -1, [[We,w../1 0 -1, [[We,w../1 0 -10 [[We,w../1 0 -12 [[We,w../1 0 -1 vOQw../1 0Q1& dx@BvOQw../1 0QB
1* vOQw../1 0Q1& dx@BvOQw../1 0QB
1* vOQw../#1 0Q#1J dxHJvOQw../1 0QJ
18 [[We,w../.1 0 -.1` w../( 0( w112"1 3"1H w1121 31: w112 3 w--.[[We,1 - /1, w--.[[We,1 - /10 [[We,w--.1 / -1, [[We,w--.1 / -10 w0011 21, w0011 21( w0011 21( t$KMLN[[^QF3[[X'89[[]I6[[ !7!78 !8!89 !7!78 !7!78 !;!;< !;!;< !:!:;

*'
 7 : 4NM %&*'X w++,	A -	A k*MNl+NOv&PQw++,
 - R P O
 w++,
 -
 w++,
 -
 w,,-

 .

 w,,-
 .
 w,,-
 .
 w++,4 -4 w++,4 -4 w++,4 -4 w++,4 -4 d+NOw,,g.B.B55747 P4  w,,g.B.B557474 d+NOw,,g.B.B44646 P4  w,,g.B.B446464 k*MNl+NOw++W-A-AB4 C P O4 w++W-A-AB4 C4 vk2w++,* - 3*0 k*MNl+NOw++,	H - P O	H k*MNl+NOw++W-A-AB4 C P O4 w++W-A-AB4 C4 v&67w++,* - 8*0 k*MNl+NOw++,H - P OH t$KMLN[[X'89[[]I6[[V &8 9[[- 0= >[[ !5!56 !6!67 !5!56 !5!56 !>!>? !?!?@ !5!56 !5!56		
"'>9 7 :NM %0"'H dx@Bw112[[We,1 - 3B16 w112[[We,1 - 31$ w112[[We,1 - 31r;   r   c                   2   a  ] tR tRt o R tR tR tRtV tR# )TestDilateFixi}  c                   VP                  . RO. RO. RO. RO. RO.VP                  R7      V n        VP                  R4      V n        \
        P                  ! V P                  V P                  R7      p\        V4      '       d#   VP                  VP                  4      V n	        R# VP                  W!P                  4      V n	        R# )r   r   r  Nr  r  r  r   )r/   uint8r  r   sq3x3r   r  r   view
dilated3x3r   )r2   r3   r  s   && r8   _setupTestDilateFix._setup  s    ZZ!0!0!0!0	!2 :<	   C
 WWV_
,,TZZ4::N
B<<(oobhh7DO ii
HH=DOr;   c                    V P                  V4       \        P                  ! V P                  V P                  R 7      p\        W P                  ^,           4       R# )r  N)r  r   r  r  r  r   r  r2   r3   results   && r8   test_dilation_square_structure,TestDilateFix.test_dilation_square_structure  s8    B&&tzzTZZH!&//A*=>r;   c                    V P                  V4       \        P                  ! V P                  ^R7      p\	        W P
                  4       R# )r    )r  N)r  r   r  r  r   r  r"  s   && r8   test_dilation_scalar_size'TestDilateFix.test_dilation_scalar_size  s/    B&&tzz:!&//:r;   )r  r  r  N)	rq  r  r  r  r  r$  r'  r  r  r  s   @r8   r  r  }  s     
>"?; ;r;   r  c                   2   a  ] tR tRt o R tR tR tRtV tR# )TestBinaryOpeningClosingi  c                v   \         P                  ! R\        R7      pRVR&   RVR&   VP                  V4      V n        VP                  R4      V n        \        P                  ! V P                  V P                  ^R^ 4      V n	        \        P                  ! V P                  V P                  ^R^ 4      V n        R# )r$   r   TNr$   r$   )r   r   Nr-  )r   r   r   )rX   rT   r   r/   r  r   r  r   rJ  
opened_oldrU  
closed_old)r2   r3   r  s   && r8   r  TestBinaryOpeningClosing._setup  s    HHV4(($ZZ]
WWV_
!00TZZ12D!=!00TZZ12D!=r;   c           
         V P                  V4       \        P                  ! V P                  V P                  ^R^ R^ R4      p\        W P                  4       R# r   NF)r  r   rJ  r  r  r   r.  )r2   r3   
opened_news   && r8   test_opening_new_arguments3TestBinaryOpeningClosing.test_opening_new_arguments  B    B++DJJ

At,-tQ?

OO4r;   c           
         V P                  V4       \        P                  ! V P                  V P                  ^R^ R^ R4      p\        W P                  4       R# r2  )r  r   rU  r  r  r   r/  )r2   r3   
closed_news   && r8   test_closing_new_arguments3TestBinaryOpeningClosing.test_closing_new_arguments  r6  r;   )r  r/  r.  r  N)	rq  r  r  r  r  r4  r9  r  r  r  s   @r8   r*  r*    s     	=55 5r;   r*  c                     V P                  ^.4      p\        \        \        P                  VRR7       \        \        \        P                  VRR7       R# r   g      ?r        ?N)r   rp   r  r   r   r3   r4   s   & r8   )test_binary_erosion_noninteger_iterationsr?    ;     77A3<D)W33TcJ)W33TcJr;   c                     V P                  ^.4      p\        \        \        P                  VRR7       \        \        \        P                  VRR7       R# r<  )r   rp   r  r   r  r>  s   & r8   *test_binary_dilation_noninteger_iterationsrB    s;     77A3<D)W44dsK)W44dsKr;   c                     V P                  ^.4      p\        \        \        P                  VRR7       \        \        \        P                  VRR7       R# r<  )r   rp   r  r   rJ  r>  s   & r8   )test_binary_opening_noninteger_iterationsrD    r@  r;   c                     V P                  ^.4      p\        \        \        P                  VRR7       \        \        \        P                  VRR7       R# r<  )r   rp   r  r   rU  r>  s   & r8   )test_binary_closing_noninteger_iterationsrF    r@  r;   rb   rX  rc   c           
      6   V P                  ^.4      p\        \        P                  ! V^RR7      \        P                  ! V^\	        R4      R7      4       \        \        P                  ! V^RR7      \        P                  ! V^\	        R4      R7      4       R# )r   r=  )r\  r  r   N)r   r   r   r   r   r>  s   & r8   ;test_binary_closing_noninteger_brute_force_passes_when_truerH    su     77A3<DG**4A3O**4A4PS9U G**4A3O**4A4PS9Ur;   Tr  re  rg  rj  r\  r  Fc                 (   \         P                  P                  ^{4      pVP                  ^ ^^dR7      P	                  \
        4      pVP                  V4      pVP                  4       pV ! WRVR7      p\        WV4       V ! WRWR7       \        WW4       R# ){   lowhighr  )r  r\  )r  r\  rj  N)	rX   randomRandomStaterandintr   r   r/   copyr   )rj  r\  r  r3   rstater4   	data_origr7   s   &&&&    r8   test_binary_input_as_outputrT    sz     YY""3'F>>aac>299$?D::dD 		IDjIHD$ 	:KD#r;   c                 Z   \         P                  P                  ^{4      pVP                  ^ ^^dR7      P	                  \
        4      pV P                  V4      pVP                  4       p\        P                  ! V4      p\        W#4       \        P                  ! W"R7       \        W$4       R# )rJ  rK  r  N)rX   rN  rO  rP  r   r   r/   rQ  r   rl  r   )r3   rR  r4   rS  r7   s   &    r8   'test_binary_hit_or_miss_input_as_outputrV  
  s     YY""3'F>>aac>299$?D::dD 		I))$/HD$ t1D#r;   c                     R p\         P                  ! \        VR7      ;_uu_ 4        \        P                  ! V P                  R4      RR7       RRR4       R#   + '       g   i     R# ; i)zinvalid metric provided)matchgarbager   Nr,  )rs  r
   
ValueErrorr   rx   r   )r3   msgs   & r8   *test_distance_transform_cdt_invalid_metricr\    sB    
#C	z	-	-&&rwwv.7	9 
.	-	-	-s   (AA*	)'numpyrX   scipy._lib._array_apir   r   r   r   r   r   r	   rs  r
   rp   scipyr    r   r  r  r  r   r  r  r  rJ  rU  r*  r   r?  rB  rD  rF  rH  r  rT  rl  rV  rx   r\  r  r;   r8   <module>ra     s       *  ;;// KK11 g-1 g-1T[ 7**G,A,AB; ; C;B 7))7+A+AB5 5 C54 7))*K +K 7**+L ,L 7))*K +K 7))*K +K 
J 7))* + $F8<>6"ST
W334W445W334W334	 1v.6$ 7 / U>$ $F8<>7--.$ />$ 71129 39r;   