-
Notifications
You must be signed in to change notification settings - Fork 52
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
BUG (GUI): Dipole plot scaling #717
Comments
@ntolley @dylansdaniels |
Thanks for updating the description @gtdang! I can see the argument for both, however, I feel like sticking to (1) would match best with our current workflow. If we go for (2), the user would then have to toggle the smoothing/scaling on and off when appropriate, depending on what they're comparing. I could see this leading to similar issues / confusions as with the current method. One potential issues with option (1), however, is how to stop users from loading whatever they want in a given dropdown anyway. What's to stop them from loading simulated data via the user data field if they're all just .txt files? We would need some way to disambiguate user data from simulations. Maybe we only allow simulated data to be loaded via HDF5? If we go for (1), we could also try to make the use case of each drop-down field clearer by changing the naming conventions. Perhaps we go with something like "User Data" and "Simulated Data" instead? |
Perhaps @rythorpe and @jasmainak have a preference, but I tend to agree with Dylan that option (1) fits best with the workflow shown in the tutorials As for loading in arbitrary files, I honestly think it's fine if they load in simulated data as through the "real data" field. |
the main problem is that simulated and real data don't use the same scaling factor/smoothing. wondering if it would be simpler to:
This last step could probably be done in |
Either @dylansdaniels-berkeley's or @jasmainak's suggestion sounds good to me. Regardless, users should be allowed to compare arbitrary waveforms, simulated or experimentally recorded, depending on their specific use-case. |
Either sounds good to me as well. If we go with @jasmainak's approach, would the default be for scaling/smoothing be turned off since the tutorial workflow has users loading in data? Right now, each dropdown has a different behavior in that respect, so we would need to make a decision on how to handle that |
I think we'd need to introduce a plotly dependency to get this type of functionality. It's good idea and something we could look into but given the timeline this might need to be implemented after the May deadline we are trying to meet. |
clearly import matplotlib.pyplot as plt
# Generate some data
x = [1, 2, 3, 4, 5]
y1 = [1, 2, 3, 4, 5]
y2 = [5, 4, 3, 2, 1]
# Plot the lines
fig, ax = plt.subplots()
line1, = ax.plot(x, y1, label='Line 1', picker=5, color='blue') # Set picker to a small value for precision
line2, = ax.plot(x, y2, label='Line 2', picker=5, color='red') # Set picker to a small value for precision
# Function to handle mouse click event
def on_pick(event):
if event.artist == line1:
line_color = 'blue'
elif event.artist == line2:
line_color = 'red'
else:
return
ind = event.ind[0] # Index of the picked point
x = event.artist.get_xdata()[ind]
y = event.artist.get_ydata()[ind]
print(f"You clicked on ({x}, {y}) of the line with color {line_color}")
fig.canvas.mpl_connect('pick_event', on_pick)
plt.legend()
plt.show() |
Does it allow picking multiple objects though? |
Of course ... you'd have to track the selected objects in a list. whatever solution you follow, I suggest that the logic in the GUI stays minimal ... it's supposed to be a thin wrapper on |
@jasmainak after some discussion with @gtdang I think we landed on just adding 2 sets of dedicated scaling/smoothing boxes for user data and simulated data Invoking the same add plot button multiple times sounds nice code-wise, but after seeing how it works functionally it's really awkward to use when trying to adjust preprocessing |
For this PR just add the 2 additional drop downs and reorder the list of options:
|
That sounds fair to me @ntolley ! Keep it short and simple |
Description
Simulated and loaded data sometimes scale incorrectly when creating plots.
Figure 1
When creating data for dipole plots there are 4 relevant selections:
When any simulation is run or data from a txt file is loaded, they are selectable in both drop-downs (1) and (2). In Figure 2 we've run 2 simulations (Simulation 1 and 2) and loaded two data files (*_trial_S1_ERP...). This is regardless if they are simulation or measured data.
Figure 2
Options for smoothing (3) and scaling (4) only apply to data selected in (1).
Solutions
The text was updated successfully, but these errors were encountered: