Skip to content

Commit c23ab05

Browse files
committed
Remove quaternions from unit test of vol2img
1 parent 22ec22d commit c23ab05

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/test_preprocess.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import numpy as np
55
from scipy.fftpack import fftn, fftshift
66

7-
from aspire.utils.coor_trans import qrand_rots
87
from aspire.utils.preprocess import crop_pad, downsample, fuzzy_mask, vol2img
98

109
DATA_DIR = os.path.join(os.path.dirname(__file__), 'saved_test_data')
@@ -33,10 +32,11 @@ def test02Downsample(self):
3332
self.assertTrue(np.allclose(results, vols, atol=1e-7))
3433

3534
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)
4040
self.assertTrue(np.allclose(results, imgs_clean, atol=1e-7))
4141

4242
def test04FuzzyMask(self):

0 commit comments

Comments
 (0)