@@ -345,7 +345,7 @@ def create_roi(subject_id, subjects_dir, fs_dir, parcellation_name, dilation):
345345 parval = cmp_config ._get_lausanne_parcellation ("Lausanne2008" )[parcellation_name ]
346346 pgpath = parval ["node_information_graphml" ]
347347 aseg = nb .load (op .join (fs_dir , "mri" , "aseg.nii.gz" ))
348- asegd = aseg . get_data ( )
348+ asegd = np . asanyarray ( aseg . dataobj )
349349
350350 # identify cortical voxels, right (3) and left (42) hemispheres
351351 idxr = np .where (asegd == 3 )
@@ -420,7 +420,7 @@ def create_roi(subject_id, subjects_dir, fs_dir, parcellation_name, dilation):
420420 runCmd (mri_cmd , log )
421421
422422 tmp = nb .load (op .join (output_dir , "tmp.nii.gz" ))
423- tmpd = tmp . get_data ( )
423+ tmpd = np . asanyarray ( tmp . dataobj )
424424
425425 # find voxel and set them to intensityvalue in rois
426426 idx = np .where (tmpd == 1 )
@@ -478,7 +478,7 @@ def create_wm_mask(subject_id, subjects_dir, fs_dir, parcellation_name):
478478 ]
479479 # load ribbon as basis for white matter mask
480480 fsmask = nb .load (op .join (fs_dir , "mri" , "ribbon.nii.gz" ))
481- fsmaskd = fsmask . get_data ( )
481+ fsmaskd = np . asanyarray ( fsmask . dataobj )
482482
483483 wmmask = np .zeros (fsmaskd .shape )
484484 # extract right and left white matter
@@ -490,7 +490,7 @@ def create_wm_mask(subject_id, subjects_dir, fs_dir, parcellation_name):
490490
491491 # remove subcortical nuclei from white matter mask
492492 aseg = nb .load (op .join (fs_dir , "mri" , "aseg.nii.gz" ))
493- asegd = aseg . get_data ( )
493+ asegd = np . asanyarray ( aseg . dataobj )
494494
495495 # need binary erosion function
496496 imerode = nd .binary_erosion
@@ -583,7 +583,7 @@ def create_wm_mask(subject_id, subjects_dir, fs_dir, parcellation_name):
583583
584584 # ADD voxels from 'cc_unknown.nii.gz' dataset
585585 ccun = nb .load (op .join (fs_dir , "label" , "cc_unknown.nii.gz" ))
586- ccund = ccun . get_data ( )
586+ ccund = np . asanyarray ( ccun . dataobj )
587587 idx = np .where (ccund != 0 )
588588 iflogger .info ("Add corpus callosum and unknown to wm mask" )
589589 wmmask [idx ] = 1
@@ -594,7 +594,7 @@ def create_wm_mask(subject_id, subjects_dir, fs_dir, parcellation_name):
594594 parcellation_name ,
595595 )
596596 roi = nb .load (op .join (op .curdir , "ROI_%s.nii.gz" % parcellation_name ))
597- roid = roi . get_data ( )
597+ roid = np . asanyarray ( roi . dataobj )
598598 assert roid .shape [0 ] == wmmask .shape [0 ]
599599 pg = nx .read_graphml (pgpath )
600600 for brk , brv in pg .nodes (data = True ):
0 commit comments