@@ -213,14 +213,13 @@ def test_dtseries():
213213 hdr = ci .Cifti2Header (matrix )
214214 data = np .random .randn (13 , 9 )
215215 img = ci .Cifti2Image (data , hdr )
216- print (img .nifti_header .get_intent ())
217216 img .nifti_header .set_intent ('NIFTI_INTENT_CONNECTIVITY_DENSE_SERIES' )
218217
219218 with InTemporaryDirectory ():
220219 ci .save (img , 'test.dtseries.nii' )
221220 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' )
224223 assert_true (isinstance (img2 , ci .Cifti2Image ))
225224 assert_true ((img2 .get_data () == data ).all ())
226225 check_series_map (img2 .header .matrix .get_index_map (0 ))
@@ -242,7 +241,7 @@ def test_dscalar():
242241 with InTemporaryDirectory ():
243242 ci .save (img , 'test.dscalar.nii' )
244243 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' )
246245 assert_true (isinstance (img2 , ci .Cifti2Image ))
247246 assert_true ((img2 .get_data () == data ).all ())
248247 check_scalar_map (img2 .header .matrix .get_index_map (0 ))
@@ -264,7 +263,7 @@ def test_dlabel():
264263 with InTemporaryDirectory ():
265264 ci .save (img , 'test.dlabel.nii' )
266265 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' )
268267 assert_true (isinstance (img2 , ci .Cifti2Image ))
269268 assert_true ((img2 .get_data () == data ).all ())
270269 check_label_map (img2 .header .matrix .get_index_map (0 ))
@@ -284,7 +283,7 @@ def test_dconn():
284283 with InTemporaryDirectory ():
285284 ci .save (img , 'test.dconn.nii' )
286285 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' )
288287 assert_true (isinstance (img2 , ci .Cifti2Image ))
289288 assert_true ((img2 .get_data () == data ).all ())
290289 assert_equal (img2 .header .matrix .get_index_map (0 ),
@@ -307,8 +306,8 @@ def test_ptseries():
307306 with InTemporaryDirectory ():
308307 ci .save (img , 'test.ptseries.nii' )
309308 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' )
312311 assert_true (isinstance (img2 , ci .Cifti2Image ))
313312 assert_true ((img2 .get_data () == data ).all ())
314313 check_series_map (img2 .header .matrix .get_index_map (0 ))
@@ -330,7 +329,7 @@ def test_pscalar():
330329 with InTemporaryDirectory ():
331330 ci .save (img , 'test.pscalar.nii' )
332331 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' )
334333 assert_true (isinstance (img2 , ci .Cifti2Image ))
335334 assert_true ((img2 .get_data () == data ).all ())
336335 check_scalar_map (img2 .header .matrix .get_index_map (0 ))
@@ -352,8 +351,8 @@ def test_pdconn():
352351 with InTemporaryDirectory ():
353352 ci .save (img , 'test.pdconn.nii' )
354353 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' )
357356 assert_true (isinstance (img2 , ci .Cifti2Image ))
358357 assert_true ((img2 .get_data () == data ).all ())
359358 check_geometry_map (img2 .header .matrix .get_index_map (0 ))
@@ -375,8 +374,8 @@ def test_dpconn():
375374 with InTemporaryDirectory ():
376375 ci .save (img , 'test.dpconn.nii' )
377376 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' )
380379 assert_true (isinstance (img2 , ci .Cifti2Image ))
381380 assert_true ((img2 .get_data () == data ).all ())
382381 check_parcel_map (img2 .header .matrix .get_index_map (0 ))
@@ -397,8 +396,8 @@ def test_plabel():
397396 with InTemporaryDirectory ():
398397 ci .save (img , 'test.plabel.nii' )
399398 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' )
402401 assert_true (isinstance (img2 , ci .Cifti2Image ))
403402 assert_true ((img2 .get_data () == data ).all ())
404403 check_label_map (img2 .header .matrix .get_index_map (0 ))
@@ -418,8 +417,8 @@ def test_pconn():
418417 with InTemporaryDirectory ():
419418 ci .save (img , 'test.pconn.nii' )
420419 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' )
423422 assert_true (isinstance (img2 , ci .Cifti2Image ))
424423 assert_true ((img2 .get_data () == data ).all ())
425424 assert_equal (img2 .header .matrix .get_index_map (0 ),
@@ -431,6 +430,7 @@ def test_pconn():
431430def test_pconnseries ():
432431 parcel_map = create_parcel_map ((0 , 1 ))
433432 series_map = create_series_map ((2 , ))
433+
434434 matrix = ci .Cifti2Matrix ()
435435 matrix .append (parcel_map )
436436 matrix .append (series_map )
@@ -443,8 +443,8 @@ def test_pconnseries():
443443 with InTemporaryDirectory ():
444444 ci .save (img , 'test.pconnseries.nii' )
445445 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' )
448448 assert_true (isinstance (img2 , ci .Cifti2Image ))
449449 assert_true ((img2 .get_data () == data ).all ())
450450 assert_equal (img2 .header .matrix .get_index_map (0 ),
@@ -457,6 +457,7 @@ def test_pconnseries():
457457def test_pconnscalar ():
458458 parcel_map = create_parcel_map ((0 , 1 ))
459459 scalar_map = create_scalar_map ((2 , ))
460+
460461 matrix = ci .Cifti2Matrix ()
461462 matrix .append (parcel_map )
462463 matrix .append (scalar_map )
@@ -469,8 +470,8 @@ def test_pconnscalar():
469470 with InTemporaryDirectory ():
470471 ci .save (img , 'test.pconnscalar.nii' )
471472 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' )
474475 assert_true (isinstance (img2 , ci .Cifti2Image ))
475476 assert_true ((img2 .get_data () == data ).all ())
476477 assert_equal (img2 .header .matrix .get_index_map (0 ),
0 commit comments