'i make the module in python but module was not working

`def transform(fid,kb_ad=1):

#brain arr data load(adni)
if kb_ad>1:   
    adni_file_path = glob.glob("./ADNI/ADNI_adcn/" + 'ADNI_' +fid+'*.nii')
    brainarr_nii = nib.load(adni_file_path[0])
    
if kb_ad>0:
    brainarr_nii = nib.load("./KBASE_scans/FDGPET_s"+str(fid)+'.nii')

#voxel resampling(2,2,2)  
nb = np.squeeze(brainarr_nii.get_fdata())
nb = resample_img(brainarr_nii,
                target_affine = np.eye(3)*2,
                interpolation = 'nearest')
arr_brain=np.squeeze(nb.get_fdata())

return arr_brain`

this is my module

but i run in my project

import transs import glob for fid in id_adni[:20]: brain_arr = transs.transform(fid,kb_ad=2)

occured NameError NameError: name 'glob' is not defined

how to solve?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source