<jupyter_start><jupyter_text>Visualize brain<jupyter_code>brain_tensor_torch, mask_tensor_torch = torch.load('../fcd_newdataset_tensors/0.1')
brain_tensor = brain_tensor_torch.numpy()
mask_tensor = mask_tensor_torch.numpy()
Z_pos = np.argmax(mask_tensor.sum((0,1)))
Y_pos = np.argmax(mask_tensor.sum((0,2)))
X_pos = np.argmax(mask_tensor.sum((2,1)))
# X_max, Y_max, Z_max = brain_tensor.shape
fig, axes = plt.subplots(ncols=3, nrows=n_slices_show, figsize=(15,n_slices_show*5))

for i in range(n_slices_show):

    x_slice_pos = X_pos #(X_max//n_slices_show)*i
    y_slice_pos = Y_pos #(Y_max//n_slices_show)*i
    z_slice_pos = Z_pos #(Z_max//n_slices_show)*i

    brain_tensor_x_slice = brain_tensor[x_slice_pos,:,:]
    brain_tensor_y_slice = brain_tensor[:,y_slice_pos,:]
    brain_tensor_z_slice = brain_tensor[:,:,z_slice_pos]
    
    mask_tensor_x_slice = mask_tensor[x_slice_pos,:,:]
    mask_tensor_y_slice = mask_tensor[:,y_slice_pos,:]
    mask_tensor_z_slice = mask_tensor[:,:,z_slice_pos]

    axes[i,0].imshow(brain_tensor_x_slice, 'gray')
    axes[i,0].imshow(mask_tensor_x_slice, 'jet', interpolation='none', alpha=0.7)
    
    axes[i,1].imshow(brain_tensor_y_slice, 'gray')
    axes[i,1].imshow(mask_tensor_y_slice, 'jet', interpolation='none', alpha=0.7)
    
    axes[i,2].imshow(brain_tensor_z_slice, 'gray')
    axes[i,2].imshow(mask_tensor_z_slice, 'jet', interpolation='none', alpha=0.7)
    
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15294924554183814, 'fraction_numerical': 0.01646090534979424, 'mean_word_length': 6.258706467661692, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '234963', 'license': 'MIT', 'n_tokens_mistral': 642, 'n_tokens_neox': 625, 'n_words': 67, 'path': 'brain_tensors.ipynb', 'repo_name': 'blufzzz/MeshCNN', 'size': '1458'}