@@ -2,75 +2,75 @@ import { computeThreshold } from '../../threshold';
22
33test ( 'Huang should work similarily to ImageJ' , ( ) => {
44 const img = testUtils . load ( 'various/grayscale_by_zimmyrose.png' ) ;
5- expect ( computeThreshold ( img , 'huang' ) ) . toBe ( 132 ) ;
5+ expect ( computeThreshold ( img , { algorithm : 'huang' } ) ) . toBe ( 132 ) ;
66} ) ;
77
88test ( 'Intermodes should work like ImageJ' , ( ) => {
99 const img = testUtils . load ( 'various/grayscale_by_zimmyrose.png' ) ;
10- expect ( computeThreshold ( img , 'intermodes' ) ) . toBe ( 166 ) ;
10+ expect ( computeThreshold ( img , { algorithm : 'intermodes' } ) ) . toBe ( 166 ) ;
1111} ) ;
1212
1313test ( 'Isodata should work like ImageJ' , ( ) => {
1414 const img = testUtils . load ( 'various/grayscale_by_zimmyrose.png' ) ;
15- expect ( computeThreshold ( img , 'isodata' ) ) . toBe ( 135 ) ;
15+ expect ( computeThreshold ( img , { algorithm : 'isodata' } ) ) . toBe ( 135 ) ;
1616} ) ;
1717
1818test ( 'Percentile should work like ImageJ' , ( ) => {
1919 const img = testUtils . load ( 'various/grayscale_by_zimmyrose.png' ) ;
20- expect ( computeThreshold ( img , 'percentile' ) ) . toBe ( 90 ) ;
20+ expect ( computeThreshold ( img , { algorithm : 'percentile' } ) ) . toBe ( 90 ) ;
2121} ) ;
2222
2323test ( 'Li should work similarily to ImageJ' , ( ) => {
2424 const img = testUtils . load ( 'various/grayscale_by_zimmyrose.png' ) ;
25- expect ( computeThreshold ( img , 'li' ) ) . toBe ( 117 ) ;
25+ expect ( computeThreshold ( img , { algorithm : 'li' } ) ) . toBe ( 117 ) ;
2626} ) ;
2727
2828test ( 'MaxEntropy should work like ImageJ' , ( ) => {
2929 const img = testUtils . load ( 'various/grayscale_by_zimmyrose.png' ) ;
30- expect ( computeThreshold ( img , 'maxEntropy' ) ) . toBe ( 126 ) ;
30+ expect ( computeThreshold ( img , { algorithm : 'maxEntropy' } ) ) . toBe ( 126 ) ;
3131} ) ;
3232
3333test ( 'Mean should work like ImageJ' , ( ) => {
3434 const img = testUtils . load ( 'various/grayscale_by_zimmyrose.png' ) ;
35- expect ( computeThreshold ( img , 'mean' ) ) . toBe ( 106 ) ;
35+ expect ( computeThreshold ( img , { algorithm : 'mean' } ) ) . toBe ( 106 ) ;
3636} ) ;
3737
3838test ( 'MinError should work like ImageJ' , ( ) => {
3939 const img = testUtils . load ( 'various/grayscale_by_zimmyrose.png' ) ;
40- expect ( computeThreshold ( img , 'minError' ) ) . toBe ( 101 ) ;
40+ expect ( computeThreshold ( img , { algorithm : 'minError' } ) ) . toBe ( 101 ) ;
4141} ) ;
4242
4343test ( 'Minimum should work like ImageJ' , ( ) => {
4444 const img = testUtils . load ( 'various/grayscale_by_zimmyrose.png' ) ;
45- expect ( computeThreshold ( img , 'minimum' ) ) . toBe ( 234 ) ;
45+ expect ( computeThreshold ( img , { algorithm : 'minimum' } ) ) . toBe ( 234 ) ;
4646} ) ;
4747
4848test ( 'Moments should work like ImageJ' , ( ) => {
4949 const img = testUtils . load ( 'various/grayscale_by_zimmyrose.png' ) ;
50- expect ( computeThreshold ( img , 'moments' ) ) . toBe ( 127 ) ;
50+ expect ( computeThreshold ( img , { algorithm : 'moments' } ) ) . toBe ( 127 ) ;
5151} ) ;
5252
5353test ( 'Otsu should work like ImageJ' , ( ) => {
5454 const img = testUtils . load ( 'various/grayscale_by_zimmyrose.png' ) ;
55- expect ( computeThreshold ( img , 'otsu' ) ) . toBe ( 135 ) ;
55+ expect ( computeThreshold ( img , { algorithm : 'otsu' } ) ) . toBe ( 135 ) ;
5656} ) ;
5757
5858test ( 'RenyiEntropy should work similarily to ImageJ' , ( ) => {
5959 const img = testUtils . load ( 'various/grayscale_by_zimmyrose.png' ) ;
60- expect ( computeThreshold ( img , 'renyiEntropy' ) ) . toBe ( 116 ) ;
60+ expect ( computeThreshold ( img , { algorithm : 'renyiEntropy' } ) ) . toBe ( 116 ) ;
6161} ) ;
6262
6363test ( 'Shanbhag should work like ImageJ' , ( ) => {
6464 const img = testUtils . load ( 'various/grayscale_by_zimmyrose.png' ) ;
65- expect ( computeThreshold ( img , 'shanbhag' ) ) . toBe ( 116 ) ;
65+ expect ( computeThreshold ( img , { algorithm : 'shanbhag' } ) ) . toBe ( 116 ) ;
6666} ) ;
6767
6868test ( 'Triangle should work like ImageJ' , ( ) => {
6969 const img = testUtils . load ( 'various/grayscale_by_zimmyrose.png' ) ;
70- expect ( computeThreshold ( img , 'triangle' ) ) . toBe ( 87 ) ;
70+ expect ( computeThreshold ( img , { algorithm : 'triangle' } ) ) . toBe ( 87 ) ;
7171} ) ;
7272
7373test ( 'Yen should work like ImageJ' , ( ) => {
7474 const img = testUtils . load ( 'various/grayscale_by_zimmyrose.png' ) ;
75- expect ( computeThreshold ( img , 'yen' ) ) . toBe ( 108 ) ;
75+ expect ( computeThreshold ( img , { algorithm : 'yen' } ) ) . toBe ( 108 ) ;
7676} ) ;
0 commit comments