@@ -345,7 +345,7 @@ def create_roi(subject_id, subjects_dir, fs_dir, parcellation_name, dilation):
345
345
parval = cmp_config ._get_lausanne_parcellation ("Lausanne2008" )[parcellation_name ]
346
346
pgpath = parval ["node_information_graphml" ]
347
347
aseg = nb .load (op .join (fs_dir , "mri" , "aseg.nii.gz" ))
348
- asegd = aseg . get_data ( )
348
+ asegd = np . asanyarray ( aseg . dataobj )
349
349
350
350
# identify cortical voxels, right (3) and left (42) hemispheres
351
351
idxr = np .where (asegd == 3 )
@@ -420,7 +420,7 @@ def create_roi(subject_id, subjects_dir, fs_dir, parcellation_name, dilation):
420
420
runCmd (mri_cmd , log )
421
421
422
422
tmp = nb .load (op .join (output_dir , "tmp.nii.gz" ))
423
- tmpd = tmp . get_data ( )
423
+ tmpd = np . asanyarray ( tmp . dataobj )
424
424
425
425
# find voxel and set them to intensityvalue in rois
426
426
idx = np .where (tmpd == 1 )
@@ -478,7 +478,7 @@ def create_wm_mask(subject_id, subjects_dir, fs_dir, parcellation_name):
478
478
]
479
479
# load ribbon as basis for white matter mask
480
480
fsmask = nb .load (op .join (fs_dir , "mri" , "ribbon.nii.gz" ))
481
- fsmaskd = fsmask . get_data ( )
481
+ fsmaskd = np . asanyarray ( fsmask . dataobj )
482
482
483
483
wmmask = np .zeros (fsmaskd .shape )
484
484
# extract right and left white matter
@@ -490,7 +490,7 @@ def create_wm_mask(subject_id, subjects_dir, fs_dir, parcellation_name):
490
490
491
491
# remove subcortical nuclei from white matter mask
492
492
aseg = nb .load (op .join (fs_dir , "mri" , "aseg.nii.gz" ))
493
- asegd = aseg . get_data ( )
493
+ asegd = np . asanyarray ( aseg . dataobj )
494
494
495
495
# need binary erosion function
496
496
imerode = nd .binary_erosion
@@ -583,7 +583,7 @@ def create_wm_mask(subject_id, subjects_dir, fs_dir, parcellation_name):
583
583
584
584
# ADD voxels from 'cc_unknown.nii.gz' dataset
585
585
ccun = nb .load (op .join (fs_dir , "label" , "cc_unknown.nii.gz" ))
586
- ccund = ccun . get_data ( )
586
+ ccund = np . asanyarray ( ccun . dataobj )
587
587
idx = np .where (ccund != 0 )
588
588
iflogger .info ("Add corpus callosum and unknown to wm mask" )
589
589
wmmask [idx ] = 1
@@ -594,7 +594,7 @@ def create_wm_mask(subject_id, subjects_dir, fs_dir, parcellation_name):
594
594
parcellation_name ,
595
595
)
596
596
roi = nb .load (op .join (op .curdir , "ROI_%s.nii.gz" % parcellation_name ))
597
- roid = roi . get_data ( )
597
+ roid = np . asanyarray ( roi . dataobj )
598
598
assert roid .shape [0 ] == wmmask .shape [0 ]
599
599
pg = nx .read_graphml (pgpath )
600
600
for brk , brv in pg .nodes (data = True ):
0 commit comments