Hi. I’m working on ADNI dataset and I want to apply searchight. I have different sets of data. I’ve run searchlight on one of them and it executed in 14 mins. But when I’m applying searchlight on another set, it stucks in this state:
Both sets of data are white matter with shape (121,145,121,171). (171 is the total number of images) Why is this happening and how can I fix this?
This is my code where w_data_t2 is the list of images data with shape (171,121,145,121). That’s why I transpose it first and then work on it.
w_t2_nifti = w_data_t2.transpose(1,2,3,0)
w_t2_nifti = nib.Nifti1Image(w_t2_nifti, affine=np.eye(4))
w_data_t2_mean = np.mean(w_data_t2, axis = 0)
w_t2_mask = np.zeros((121,145,121))
for i in range(121):
for j in range(145):
for z in range(121):
if w_data_t2_mean[i,j,z] > 0.2:
w_t2_mask[i,j,z] = 1
w_t2_mask = nib.Nifti1Image(w_t2_mask, affine=np.eye(4))
cv = KFold(n_splits = 5, shuffle = True, random_state = 1)
searchlight = SearchLight(w_t2_mask, radius = 17, scoring = 'accuracy', verbose = 1, n_jobs=-1, cv = cv)
searchlight.fit(w_t2_nifti, target)
Thanks for your help in advance.