Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A tutorial error #10

Open
SoichiroA opened this issue May 6, 2022 · 0 comments
Open

A tutorial error #10

SoichiroA opened this issue May 6, 2022 · 0 comments

Comments

@SoichiroA
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant