A tutorial error
SoichiroA opened this issue · 0 comments
When I run the tutorial, affine alignment functions, I got this error.
But I am not sure what is wrong.
Can I ask you to suggest some possible problems?
I did not change any code and just run the provided jupyter code.
This was reproducible on my laptop and a remote cluster.
Best,
Error message:
Getting key points
FIXED image: found 74 key points
MOVING image: found 184 key points
TypeError Traceback (most recent call last)
TypeError: only size-1 arrays can be converted to Python scalars
The above exception was the direct cause of the following exception:
ValueError Traceback (most recent call last)
in
3
4 # see below for explanation of parameters
----> 5 global_affine = affine.ransac_affine(
6 fix_lowres_data, mov_lowres_data,
7 fix_lowres_spacing, mov_lowres_spacing,
~/.local/lib/python3.8/site-packages/bigstream/affine.py in ransac_affine(fix, mov, fix_spacing, mov_spacing, min_radius, max_radius, match_threshold, cc_radius, nspots, align_threshold, num_sigma_max, verbose, fix_spots, mov_spots, default, **kwargs)
73
74 # get point correspondences
---> 75 correlations = features.pairwise_correlation(
76 fix_spots, mov_spots,
77 )
~/.local/lib/python3.8/site-packages/bigstream/features.py in pairwise_correlation(A, B)
59
60 # get means and std for all contexts, center contexts
---> 61 a_mean, a_std = _stats(a_con)
62 b_mean, b_std = _stats(b_con)
63 a_con = a_con - a_mean[..., None]
~/.local/lib/python3.8/site-packages/bigstream/features.py in _stats(arr)
43
44 # compute mean and standard deviation along columns
---> 45 arr = arr.astype(np.float64)
46 means = np.mean(arr, axis=1)
47 sqr_means = np.mean(np.square(arr), axis=1)
ValueError: setting an array element with a sequence.