Hello,
I have a list of brain feature volumetric maps (thickness, sulc) with size (241, 336, 283) for multiple subjects, I want to create dataset of feature maps patches and label(if it intersect label mask) for classification problem.
all_patch = np.empty(1,num_of_patches_per_sub,36,36,36)
patchs = 64
for x in range(0, feature.shape[0]-patchs//2, patchs):
for y in range(0, feature.shape[1]-patchs//2, patchs):
for z in range(0, feature.shape[2]-patchs//2, patchs):
patch_feature = feature[x: min(x+patchs, feature.shape[0]),
y: min(y+patchs, feature.shape[1]),
z: min(z+patchs, feature.shape[2]),]
patch_label = label_data[x: min(x+patchs, feature.shape[0]),
y: min(y+patchs, feature.shape[1]),
z: min(z+patchs, feature.shape[2]),]
all_patches = np.concatenate([all_patch, patch_feature])
How can patch_feature and label be saved for training set?:
X = np.array(feature1[batch1, batch2, …], feature2[batch1,batch2, …], feature3[batch1, batch2, …], [batch1, batch2, …])
Y = np.array([1,1,1,1], [0,0,0,0])