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

Scaling bug in plotting waveforms/templates for checkerboard-like probes #3745

Open
zzhmark opened this issue Mar 5, 2025 · 3 comments
Open
Labels
enhancement New feature or request widgets Related to widgets module

Comments

@zzhmark
Copy link

zzhmark commented Mar 5, 2025

Plotting waveforms for my probe yielding very small waveforms, unless a scale around 1000 is specified. I found the y_scale factor in the plotting functions are very small, due to the layout of my channel positions, which is a non-uniform checkerboard. Some of the y coords may have miniscule differences, and it causes the program to perceive it as a very small inter channel distance. You might need a more adaptive strategy with such scenario.

@zm711
Copy link
Collaborator

zm711 commented Mar 5, 2025

Absolutely agree. I was having this issue too because of a the nature of the x changes between my contacts on the probe leading to x squashing. I think we need to work on a better solution overall! I think a lot of us are busy. You want to give this a try? Otherwise we will put this on the todo list!

@zm711 zm711 added enhancement New feature or request widgets Related to widgets module labels Mar 5, 2025
@zzhmark
Copy link
Author

zzhmark commented Mar 6, 2025

Absolutely agree. I was having this issue too because of a the nature of the x changes between my contacts on the probe leading to x squashing. I think we need to work on a better solution overall! I think a lot of us are busy. You want to give this a try? Otherwise we will put this on the todo list!

Here's my plan:

  y_chans, inds = np.unique(channel_locations[:, 1], return_inverse=True)
  if y_chans.size > 1:
      delta_y = 0
      weight = 0
      for i, y_diff in enumerate(np.diff(y_chans)):
          x1 = channel_locations[inds == i, 0]
          x2 = channel_locations[inds == i + 1, 0]
          x_diff = np.min(np.abs(x1[:, np.newaxis] - x2[np.newaxis, :]))
          delta_y += y_diff / (x_diff + 1)
          weight += 1 / (x_diff + 1)
      delta_y = delta_y / weight
  else:
      delta_y = 40.0

Considering very close y contacts, I'm introducing a weighting strategy punishing contacts close over y but far over x.

If you think this is ok I will submit a merge request.

@zm711
Copy link
Collaborator

zm711 commented Mar 6, 2025

@alejoe91 and @samuelgarcia review the widgets stuff so I'll tag them to take a look at your proposal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request widgets Related to widgets module
Projects
None yet
Development

No branches or pull requests

2 participants