[b86468]: / v3 / test / bc_test / mainNiftiReadingFunctions_test.js

Download this file

36 lines (30 with data), 1.2 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
=========================================================
* Brainchop - v1.4.0 - ((------Testing-------))
=========================================================
* Discription: A user interface for whole brain segmentation
* Input shape : [1, D, H, W, 1] e.g. [1, 256, 256, 256, 1]
* Model : Meshnet or similar
*
* Authors: Mohamed Masoud and Sergey Plis - 2023
=========================================================
=========================================================
Util Functions Unit Test (Mocha)
=========================================================*/
describe("Main Util Functions", function () {
describe('#labelMax()', function () {
it('return max', function () {
expect( labelMax( [1,2,3]) ).to.equal(3);
});
});
describe('#arrValuesFreq()', function () {
it('return frequence of array unique values', function () {
expect( arrValuesFreq( [2, 2, 2, 2, 3]) ).to.be.a('map');
});
});
describe('#map2Object()', function () {
it('convert map to JSON object, and it needs JS ES6', function () {
expect( map2Object( new Map().set('a', 1).set('b', 2) ) ).to.eql({ a: 1, b: 2 });
});
});
});