@@ -213,14 +213,13 @@ def test_dtseries():
213
213
hdr = ci .Cifti2Header (matrix )
214
214
data = np .random .randn (13 , 9 )
215
215
img = ci .Cifti2Image (data , hdr )
216
- print (img .nifti_header .get_intent ())
217
216
img .nifti_header .set_intent ('NIFTI_INTENT_CONNECTIVITY_DENSE_SERIES' )
218
217
219
218
with InTemporaryDirectory ():
220
219
ci .save (img , 'test.dtseries.nii' )
221
220
img2 = nib .load ('test.dtseries.nii' )
222
- assert_true (img2 .nifti_header .get_intent ()[0 ]
223
- == 'dense data series/fiber fans' )
221
+ assert_equal (img2 .nifti_header .get_intent ()[0 ],
222
+ 'dense data series/fiber fans' )
224
223
assert_true (isinstance (img2 , ci .Cifti2Image ))
225
224
assert_true ((img2 .get_data () == data ).all ())
226
225
check_series_map (img2 .header .matrix .get_index_map (0 ))
@@ -242,7 +241,7 @@ def test_dscalar():
242
241
with InTemporaryDirectory ():
243
242
ci .save (img , 'test.dscalar.nii' )
244
243
img2 = nib .load ('test.dscalar.nii' )
245
- assert_true (img2 .nifti_header .get_intent ()[0 ] == 'dense scalar' )
244
+ assert_equal (img2 .nifti_header .get_intent ()[0 ], 'dense scalar' )
246
245
assert_true (isinstance (img2 , ci .Cifti2Image ))
247
246
assert_true ((img2 .get_data () == data ).all ())
248
247
check_scalar_map (img2 .header .matrix .get_index_map (0 ))
@@ -264,7 +263,7 @@ def test_dlabel():
264
263
with InTemporaryDirectory ():
265
264
ci .save (img , 'test.dlabel.nii' )
266
265
img2 = nib .load ('test.dlabel.nii' )
267
- assert_true (img2 .nifti_header .get_intent ()[0 ] == 'dense label' )
266
+ assert_equal (img2 .nifti_header .get_intent ()[0 ], 'dense label' )
268
267
assert_true (isinstance (img2 , ci .Cifti2Image ))
269
268
assert_true ((img2 .get_data () == data ).all ())
270
269
check_label_map (img2 .header .matrix .get_index_map (0 ))
@@ -284,7 +283,7 @@ def test_dconn():
284
283
with InTemporaryDirectory ():
285
284
ci .save (img , 'test.dconn.nii' )
286
285
img2 = nib .load ('test.dconn.nii' )
287
- assert_true (img2 .nifti_header .get_intent ()[0 ] == 'dense connectivity' )
286
+ assert_equal (img2 .nifti_header .get_intent ()[0 ], 'dense connectivity' )
288
287
assert_true (isinstance (img2 , ci .Cifti2Image ))
289
288
assert_true ((img2 .get_data () == data ).all ())
290
289
assert_equal (img2 .header .matrix .get_index_map (0 ),
@@ -307,8 +306,8 @@ def test_ptseries():
307
306
with InTemporaryDirectory ():
308
307
ci .save (img , 'test.ptseries.nii' )
309
308
img2 = nib .load ('test.ptseries.nii' )
310
- assert_true (img2 .nifti_header .get_intent ()[0 ]
311
- == 'parcellated data series' )
309
+ assert_equal (img2 .nifti_header .get_intent ()[0 ],
310
+ 'parcellated data series' )
312
311
assert_true (isinstance (img2 , ci .Cifti2Image ))
313
312
assert_true ((img2 .get_data () == data ).all ())
314
313
check_series_map (img2 .header .matrix .get_index_map (0 ))
@@ -330,7 +329,7 @@ def test_pscalar():
330
329
with InTemporaryDirectory ():
331
330
ci .save (img , 'test.pscalar.nii' )
332
331
img2 = nib .load ('test.pscalar.nii' )
333
- assert_true (img2 .nifti_header .get_intent ()[0 ] == 'parcellated scalar' )
332
+ assert_equal (img2 .nifti_header .get_intent ()[0 ], 'parcellated scalar' )
334
333
assert_true (isinstance (img2 , ci .Cifti2Image ))
335
334
assert_true ((img2 .get_data () == data ).all ())
336
335
check_scalar_map (img2 .header .matrix .get_index_map (0 ))
@@ -352,8 +351,8 @@ def test_pdconn():
352
351
with InTemporaryDirectory ():
353
352
ci .save (img , 'test.pdconn.nii' )
354
353
img2 = ci .load ('test.pdconn.nii' )
355
- assert_true (img2 .nifti_header .get_intent ()[0 ]
356
- == 'parcellated dense connectivity' )
354
+ assert_equal (img2 .nifti_header .get_intent ()[0 ],
355
+ 'parcellated dense connectivity' )
357
356
assert_true (isinstance (img2 , ci .Cifti2Image ))
358
357
assert_true ((img2 .get_data () == data ).all ())
359
358
check_geometry_map (img2 .header .matrix .get_index_map (0 ))
@@ -375,8 +374,8 @@ def test_dpconn():
375
374
with InTemporaryDirectory ():
376
375
ci .save (img , 'test.dpconn.nii' )
377
376
img2 = ci .load ('test.dpconn.nii' )
378
- assert_true (img2 .nifti_header .get_intent ()[0 ]
379
- == 'dense parcellated connectivity' )
377
+ assert_equal (img2 .nifti_header .get_intent ()[0 ],
378
+ 'dense parcellated connectivity' )
380
379
assert_true (isinstance (img2 , ci .Cifti2Image ))
381
380
assert_true ((img2 .get_data () == data ).all ())
382
381
check_parcel_map (img2 .header .matrix .get_index_map (0 ))
@@ -397,8 +396,8 @@ def test_plabel():
397
396
with InTemporaryDirectory ():
398
397
ci .save (img , 'test.plabel.nii' )
399
398
img2 = ci .load ('test.plabel.nii' )
400
- assert_true (img .nifti_header .get_intent ()[0 ]
401
- == 'dense fiber/fan samples' )
399
+ assert_equal (img .nifti_header .get_intent ()[0 ],
400
+ 'dense fiber/fan samples' )
402
401
assert_true (isinstance (img2 , ci .Cifti2Image ))
403
402
assert_true ((img2 .get_data () == data ).all ())
404
403
check_label_map (img2 .header .matrix .get_index_map (0 ))
@@ -418,8 +417,8 @@ def test_pconn():
418
417
with InTemporaryDirectory ():
419
418
ci .save (img , 'test.pconn.nii' )
420
419
img2 = ci .load ('test.pconn.nii' )
421
- assert_true (img .nifti_header .get_intent ()[0 ]
422
- == 'parcellated connectivity' )
420
+ assert_equal (img .nifti_header .get_intent ()[0 ],
421
+ 'parcellated connectivity' )
423
422
assert_true (isinstance (img2 , ci .Cifti2Image ))
424
423
assert_true ((img2 .get_data () == data ).all ())
425
424
assert_equal (img2 .header .matrix .get_index_map (0 ),
@@ -431,6 +430,7 @@ def test_pconn():
431
430
def test_pconnseries ():
432
431
parcel_map = create_parcel_map ((0 , 1 ))
433
432
series_map = create_series_map ((2 , ))
433
+
434
434
matrix = ci .Cifti2Matrix ()
435
435
matrix .append (parcel_map )
436
436
matrix .append (series_map )
@@ -443,8 +443,8 @@ def test_pconnseries():
443
443
with InTemporaryDirectory ():
444
444
ci .save (img , 'test.pconnseries.nii' )
445
445
img2 = ci .load ('test.pconnseries.nii' )
446
- assert_true (img .nifti_header .get_intent ()[0 ]
447
- == 'parcellated connectivity series' )
446
+ assert_equal (img .nifti_header .get_intent ()[0 ],
447
+ 'parcellated connectivity series' )
448
448
assert_true (isinstance (img2 , ci .Cifti2Image ))
449
449
assert_true ((img2 .get_data () == data ).all ())
450
450
assert_equal (img2 .header .matrix .get_index_map (0 ),
@@ -457,6 +457,7 @@ def test_pconnseries():
457
457
def test_pconnscalar ():
458
458
parcel_map = create_parcel_map ((0 , 1 ))
459
459
scalar_map = create_scalar_map ((2 , ))
460
+
460
461
matrix = ci .Cifti2Matrix ()
461
462
matrix .append (parcel_map )
462
463
matrix .append (scalar_map )
@@ -469,8 +470,8 @@ def test_pconnscalar():
469
470
with InTemporaryDirectory ():
470
471
ci .save (img , 'test.pconnscalar.nii' )
471
472
img2 = ci .load ('test.pconnscalar.nii' )
472
- assert_true (img .nifti_header .get_intent ()[0 ]
473
- == 'parcellated connectivity scalar' )
473
+ assert_equal (img .nifti_header .get_intent ()[0 ],
474
+ 'parcellated connectivity scalar' )
474
475
assert_true (isinstance (img2 , ci .Cifti2Image ))
475
476
assert_true ((img2 .get_data () == data ).all ())
476
477
assert_equal (img2 .header .matrix .get_index_map (0 ),
0 commit comments