In [2]:
import matplotlib.pyplot as plt
import numpy as np

In [3]:
%matplotlib inline

load data


In [7]:
full_data = np.load("../data/combined_runs.npy")

In [10]:
full_data.shape


Out[10]:
(132, 175, 48, 3543)

load mask


In [5]:
mask50k = np.load("../brain_mask/sm_mask55468.npy")

In [7]:
mask50k.shape


Out[7]:
(1108800,)

In [8]:
mask50k


Out[8]:
array([False, False, False, ..., False, False, False], dtype=bool)

In [10]:
~mask50k


Out[10]:
array([ True,  True,  True, ...,  True,  True,  True], dtype=bool)

In [ ]:
mask50k_3d = mask50k.reshape((full_data.shape[0],full_data.shape[1],full_data.shape[2]))

In [19]:
mask50k_3d.shape


Out[19]:
(1108800,)

In [22]:
mask17k = np.load("../brain_mask/sm_mask17887.npy")
mask17k_3d = mask17k.reshape((full_data.shape[0],full_data.shape[1],full_data.shape[2]))

In [23]:
mask9k = np.load("../brain_mask/sm_mask9051.npy")
mask9k_3d = mask9k.reshape((full_data.shape[0],full_data.shape[1],full_data.shape[2]))

masking


In [24]:
masked_data_50k = full_data[mask50k_3d,:]
np.save("../data/masked_data_50k.npy",masked_data_50k)

In [25]:
masked_data_50k.shape


Out[25]:
(55468, 3543)

In [28]:
masked_data_17k = full_data[mask17k_3d,:]
np.save("../data/masked_data_17k.npy",masked_data_17k)

In [29]:
masked_data_9k = full_data[mask9k_3d,:]
np.save("../data/masked_data_9k.npy",masked_data_9k)

In [ ]: