예제 #1
0
    def test_two_maps(self):
        """Test two maps."""
        maps1 = Maps(self.arr1, Ni=self.Ni, Nj=self.Nj, Nk=self.Nk)
        maps2 = Maps(self.arr2, Ni=self.Ni, Nj=self.Nj, Nk=self.Nk)

        maps3 = Maps.concatenate((maps1, maps2))

        self.assertTrue(np.array_equal(maps3.maps.toarray(), self.arr3))
예제 #2
0

if __name__ == '__main__':
    # keyword = 'prosopagnosia'
    sigma = 2.
    # df = build_df_from_keyword(keyword)
    # maps = Maps(df, template=template, groupby_col='pmid')
    # Img = maps.to_img(sequence=True, verbose=True)

    # Img = ['data-narps/orig/YZFBWTVU_Q6O0/hypo1_unthresh.nii.gz']
    size = 1000 * np.ones(10).astype(int)
    maps = simulate_maps((34, -52, 44), 2 * sigma, size, random_state=0)
    maps.smooth(sigma=sigma, inplace=True)

    if True:
        maps = Maps.concatenate((maps, Maps.zeros(n_maps=1,
                                                  template=template)))

    plotting.plot_stat_map(maps.avg().to_img(), threshold=0.0010)
    plt.show()

    # exit()

    Img = maps.to_img(sequence=True)

    # plotting.plot_stat_map(Img[0])
    # plotting.plot_stat_map(Img[4])
    # plt.show()
    # exit()

    print('extract')
    ds_dict = extract_from_paths(Img, tag=f'test', threshold=0.003, load=False)
예제 #3
0
    def test_one_map(self):
        """Test one map."""
        maps1 = Maps(self.arr1, Ni=self.Ni, Nj=self.Nj, Nk=self.Nk)
        maps2 = Maps.concatenate((maps1,))

        self.assertTrue(np.array_equal(maps2.maps.toarray(), self.arr1))
예제 #4
0
 def test_empty(self):
     """Test empty sequence."""
     with self.assertRaises(ValueError):
         Maps.concatenate(())