You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@berl looking to hear your thought before committing and PR:
I have replaced n_bins with pixel (LMK if a different name is better) where (pixel (int, optional): Pixel size in microns for spatial grouping. Defaults to 100.)
And also made the following addition and substitution of n_bins with nx_bins and ny_bins respectively:
# determine number of bins on each axis for grouping the data spatially
nx_bins = np.ceil((s2.x_centroid.max() - s2.x_centroid.min()) / pixel).astype(int)
ny_bins = np.ceil((s2.y_centroid.max() - s2.y_centroid.min()) / pixel).astype(int)
s2["xy_bucket"] = list(
zip(
pd.cut(s2.x_centroid, nx_bins, labels=list(range(nx_bins))),
pd.cut(s2.y_centroid, ny_bins, labels=list(range(ny_bins))),
)
)
...
bin_image_z_score = np.zeros([nx_bins, ny_bins])
bin_image_difference = np.zeros([nx_bins, ny_bins])
bin_image_ratio = np.zeros([nx_bins, ny_bins])
bin_image_counts = np.zeros([nx_bins, ny_bins])
Also, using n_bins as a parameter for spatial_detection_scores() will return an error in my current code. But I can maintain the old parameter and functionality with an "if-else" statements if you prefer.
currently uses fixed number of bins for x and y, should be changed to fixed (square) bin size
The text was updated successfully, but these errors were encountered: