|
4 | 4 | import numpy as np |
5 | 5 | from scipy.fftpack import fftn, fftshift |
6 | 6 |
|
7 | | -from aspire.utils.coor_trans import qrand_rots |
8 | 7 | from aspire.utils.preprocess import crop_pad, downsample, fuzzy_mask, vol2img |
9 | 8 |
|
10 | 9 | DATA_DIR = os.path.join(os.path.dirname(__file__), 'saved_test_data') |
@@ -33,10 +32,11 @@ def test02Downsample(self): |
33 | 32 | self.assertTrue(np.allclose(results, vols, atol=1e-7)) |
34 | 33 |
|
35 | 34 | def test03Vol2img(self): |
36 | | - results = np.load(os.path.join(DATA_DIR, 'clean70SRibosome_down8_imgs32.npy')).T # RCOPT |
37 | | - vol = np.load(os.path.join(DATA_DIR, 'clean70SRibosome_vol_down8.npy')).T # RCOPT |
38 | | - rots = qrand_rots(32, seed=0) |
39 | | - imgs_clean = vol2img(vol, rots) |
| 35 | + results = np.load(os.path.join(DATA_DIR, 'clean70SRibosome_down8_imgs32.npy')).T |
| 36 | + vols = np.load(os.path.join(DATA_DIR, 'clean70SRibosome_vol_down8.npy')).T |
| 37 | + rots = np.load(os.path.join(DATA_DIR, 'rand_rot_matrices32.npy')) |
| 38 | + rots = np.moveaxis(rots, 2, 0) |
| 39 | + imgs_clean = vol2img(vols, rots) |
40 | 40 | self.assertTrue(np.allclose(results, imgs_clean, atol=1e-7)) |
41 | 41 |
|
42 | 42 | def test04FuzzyMask(self): |
|
0 commit comments