Repository navigation
Fix Edit and Tools audit findings (#675) - #677
Conversation
Match the epoch window, Parks-McClellan order, and DIPFIT co-registration from the November 23 GUI audit. Inspect/label components stores rejection flags on OK. MRI head models and eLORETA stay disabled. Co-authored-by: Suraj Ranganath <[email protected]>
There was a problem hiding this comment.
If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.
Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.
|
Claude finished @suraj-ranganath's task in 2m 19s —— View job Code review
BlockingNone. Important
Nits
Test gaps
EEGLAB parity notes
Checked for correctness bugs, EEGLAB parity, data structure compatibility, changed-behavior tests, and CLAUDE.md/AGENTS.md compliance. Inline comments are posted on the four flagged lines. |
| use_mri = ( | ||
| _option_on(options.get("summary")) or _option_on(options.get("projimg")) or _option_on(options.get("cornermri")) | ||
| ) | ||
| use_mri = True |
There was a problem hiding this comment.
Important (regression). use_mri = True means _plot_mri_slices → _validate_mri_option now runs on every plot. For a BESA (standardBESA) dataset the dialog pre-fills mri with dipfit.mrifile = 'standard_BESA/avg152t1.mat' (pop_dipplot.py:72, _utils.py:51). That path has neither standard_mri nor standard_BEM in it, so _validate_mri_option raises DIPFITUnavailableError. In practice, Plot dipoles after a BESA fit now fails when the dialog runs with its default values. Before this change it only failed when summary, projimg, or cornermri was on.
On the command line without mri, BESA dipoles are in spherical coordinates and get drawn on MNI slices with no transform, so they land in the wrong place.
Suggested fix: draw slices only when coordformat is MNI (or apply the BESA→MNI transform first), and accept the template's own mrifile. Add a test that runs pop_dipplot on a BESA-fitted dataset with the dialog defaults. The else: branch below is now dead code and should be removed.
There was a problem hiding this comment.
🤖 Fixed in 9d5748a. Slices are drawn only when coordformat is MNI, so a BESA dialog default of standard_BESA/avg152t1.mat no longer calls _validate_mri_option and no longer paints spherical positions on the MNI volume. Packaged template MRI names are accepted; a custom file still raises DIPFITUnavailableError. The non-MNI branch builds the 3-D axes only. test_besa_dipole_plot_uses_the_dialog_mri_without_mni_slices runs pop_dipplot with that dialog MRI and checks the figure has one axes.
A BESA-to-MNI transform of the dipole positions is not applied. EEGLAB hands the MRI path to dipplot, which keeps spherical coordinates on a sphere. Putting those positions through an extra transform here would not match that plot.
There was a problem hiding this comment.
🤖 Updated in cff84e9. Spherical BESA plots now draw the packaged avg152t1 slices, the same volume EEGLAB uses for that template. A custom MRI is still refused. test_besa_dipole_plot_uses_the_dialog_mri_without_mni_slices checks eegprep_mri == "avg152t1" and that a slice image is on the figure.
| lim1 = tmin * srate | ||
| lim2 = tmax * srate | ||
| newevents = [] | ||
| for ev in EEG['event']: | ||
| if 'epoch' in ev and 'latency' in ev: | ||
| epoch_offset = int(ev['epoch']) - 1 | ||
| local_latency = float(ev['latency']) - epoch_offset * old_pnts | ||
| if a <= local_latency <= b: | ||
| ev['latency'] = local_latency - (a - 1) + epoch_offset * pnts | ||
| newevents.append(ev) | ||
| if 'epoch' not in ev or 'latency' not in ev: | ||
| continue | ||
| epoch_index = int(ev['epoch']) - 1 | ||
| locking = time0 + epoch_index * old_pnts | ||
| pos0 = math.floor(locking) | ||
| latency = float(ev['latency']) | ||
| if latency < pos0 + lim1 or latency >= pos0 + lim2: |
There was a problem hiding this comment.
Important. With a point range, the data slice keeps both named samples (stop = last). The event filter still uses the half-open epoch.m bound latency >= pos0 + tmax*srate, and tmax comes from eeg_point2lat(last). As a result, an event on the last kept sample is dropped while its sample is kept.
Example: xmin=-0.5, srate=128, pnts=128, point=[1 64]. Here lim2 = -1 and pos0 = 65, so an event at local sample 64 hits 64 >= 64 and is discarded, even though sample 64 is in the output.
Suggested fix: in the point_mat branch, set the upper bound from stop, e.g. lim2 = (stop - math.floor(time0)) + 1 in the same units, so the event window matches the kept samples. Add a test for an epoched point range with an event on the last sample.
There was a problem hiding this comment.
🤖 Fixed in 9d5748a. For a point range the event window is [reallim1, reallim2 + 1), so an event on the named last sample is kept and the next sample is not. Time ranges still use the unrounded half-open epoch.m bounds. test_epoched_point_range_keeps_the_event_on_the_last_sample uses xmin=-0.5, srate=128, point=[1, 64], keeps the event at latency 64, and drops the event at 65.
| try: | ||
| return False, align_channels_to_template(EEG, chanfile) | ||
| except (OSError, ValueError): | ||
| return False, [] |
There was a problem hiding this comment.
Important. If the warp fails, the OSError/ValueError is caught and [] is returned. On the command line, _apply_settings (pop_dipfit_settings.py:231) then stores coord_transform = [] without any error. The BEM template also no longer has its old default rotation, so a later fit uses an identity transform with uncoregistered electrodes and nothing tells the user. The dialog does refuse an empty matrix, but pop_dipfit_settings(EEG, model='standardBEM') does not.
Suggested fix: let the coregister error propagate in _apply_settings, with pop_dipfit_settings: in the message and the exact fix (pass coord_transform or [] explicitly). Keep the swallow only for pre-filling the dialog, if it is needed there.
Also note that _dialog_template_state runs this warp for each template every time the dialog opens, which is two optimizer runs per open for an unmatched montage. Consider computing it only for the selected template, or when the user changes the menu.
There was a problem hiding this comment.
🤖 Fixed in 9d5748a. resolved_coord_transform no longer swallows a failed warp. pop_dipfit_settings(EEG, model='standardBEM') raises ValueError naming pop_dipfit_settings and the fix (coord_transform as nine numbers, or coord_transform=[]). The dialog still catches that error while filling the text field, and it warps only the selected template. The other templates still get the cheap keyword lookup, so switching the menu does not run a second optimizer. test_unmatched_montage_without_enough_landmarks_names_the_fix covers the command-line error and checks the dialog still opens. Synthetic tests that have no template labels now pass coord_transform=[] explicitly.
| return (EEG, "") if return_com else EEG | ||
| compnum = result.get("compnum", "") | ||
| reject = result.get("reject", "") | ||
| if renderer is not None and hasattr(renderer, "run"): |
There was a problem hiding this comment.
Nit (AGENTS.md). hasattr(renderer, "run") is the duck-typing dispatch that AGENTS.md rules out ("No ad-hoc compatibility hacks such as hasattr(obj, "old_attr")"). It also puts the Qt-only browser path in front of the inputgui path for any renderer without run. Suggested fix: branch on renderer is None and use the browser there. Better still, move _run_component_browser into functions/guifunc/ so this popfunc module does not create its own QApplication.
A related UX point: open_component calls pop_prop(..., plot="off"), so clicking a component shows only ACCEPT/Close, with no map or spectrum. The user is asked to label a component they cannot see. This is acknowledged in the PR body, but it is worth showing the pop_prop figure (plot="on") before the chooser.
There was a problem hiding this comment.
🤖 Fixed the hasattr branch in 9d5748a: a passed renderer uses inputgui, and renderer is None opens the component browser. Clicking a component now calls pop_prop with plotting on, so the map and spectrum are shown before ACCEPT/REJECT. figure.show() does not block, so the chooser still opens.
The browser stays in pop_selectcomps. The window's only job is to return the gcompreject flags that this function writes on OK, and moving the widgets into guifunc would pass that same array back. The existing click test still patches pop_prop, so it does not open a figure.
Draw MRI slices only for MNI coordinates, keep the event on the last sample of a point range, and report a failed montage warp instead of storing an empty transform. Co-authored-by: Suraj Ranganath <[email protected]>
Use the Qt6 nested enums and a real dict for the event-structure edits so the type check can resolve the attributes it flagged. Co-authored-by: Suraj Ranganath <[email protected]>
Co-register the packaged BEM and BESA templates, match MATLAB firpmord, and complete the component, ICA, and dipole workflows from the #675 review. Co-authored-by: Suraj Ranganath <[email protected]>
The global *.mat ignore was dropping standard_BESA.mat, so a checkout could not resolve the template head-model path. Co-authored-by: Suraj Ranganath <[email protected]>
|
🤖 Specification for cff84e9. Problem. Default BEM Co-register passed standard_vol.mat into the headplot mesh loader, which only ships as npz. The BESA cap385 electrode file was not packaged. Disabled head-model and eLORETA tooltips were dropped before the main window. pop_firpmord did not follow MATLAB firpmord on multiband orders. Inspect/label components did not draw maps, page past 35, prompt for the component list, or put ACCEPT/REJECT in pop_prop. SOBI, JADE, dipole navigation, Desikan-Killiany labels, the channel-location lookup list, the flagged pop_subcomp prompts, and the fine-fit Plot/Flip/Fit buttons were still open. Approach. coregister resolves a BEM scalp from the packaged volume and a BESA sphere of radius 85. The cap385 elp, its four-shell volume, and the witheog montage are packaged. ExtensionMenu.tooltip is copied onto the real QAction. firpmord uses relative deviations and, for more than two bands, the max Herrmann length of each inner band against both neighbours, then adds one tap when the last band passes and the order is odd. pop_selectcomps prompts, pages by 35, draws topoplot on each button, and toggles rejection inside pop_prop. sobi.m and jader.m are ported into pop_runica. dipplot adds Plot one/Next/Prev and eeg_compatlas stores model.areadk. The lookup list, subcomp prompts, and fine-fit actions follow the EEGLAB dialogs. Warp text uses full precision, event-structure edits stay off the dialog spec, and BESA dipole plots draw avg152t1. Tests. Each item has a regression that failed on the old behavior: a Co-register click on the default BEM dialog, a BESA warp, main-window tooltips, the MATLAB firpmord orders (53, 210, 166, 95, 211, 174, 162, 191), component maps plus paging and the pop_prop toggle, SOBI/JADE recovery, dipole navigation and atlas labels, the lookup default, the flagged subcomp buttons, and a fine-fit button that writes the new position. Tolerances, goldens, and parity JSON were not changed. |
Use numpy Vh for the SOBI whitener, RMS-scale SOBI and JADE columns, and record positional SOBI history. Empty BESA transforms stay identity, spherical dipoles use sph2spm, and the fine-fit and inspect dialogs show the figures EEGLAB shows. Co-authored-by: Suraj Ranganath <[email protected]>
|
🤖 Specification for c3df234. Problem. sobi.py whitened with Vh.T, so the matched |corr| with MATLAB bottomed at 0.17. pop_runica did not RMS-scale SOBI or JADE, and its SOBI history used named 'p', 100, which sobi.m cannot replay. Inspect/label maps died on the array chanlocs pop_loadset returns. Spherical BESA dipoles skipped sph2spm. Fine-fit Plot map and Plot dipole built figures that never showed. Empty BESA coord_transform fell through to the spherical atlas default. Four Qt tests failed because fakes were not real widgets. Approach. The whitener is pinv(S) @ Vh, which is MATLAB VV'. _dataset_from_ica calls scale_ica_to_rms_microvolt after the variance reorder. Empty SOBI history is EEG = pop_runica(EEG, 'icatype', 'sobi'); typed counts are 'options', {n p}. The Jade label matches pop_runica.m. Chanlocs use an is None check and the map error is no longer swallowed. Spherical positions and moments go through sph2spm before the scatter and the slices. Next and Prev redraw the slices for the current component and the area label includes the component number. Plot map calls pop_topoplot(EEG, 0, comp, ..., [1, 1], 1). Plot dipole plots the dialog fields. Flip uses g format and co-register fields use .4g. An empty coord_transform is the identity [0 0 0 0 0 0 1 1 1] in eeg_checkset and in eeg_compatlas. Headless coregister also searches resources/dipfit. Subcomp ERPs are a per-channel grid raised with show_figures. The Qt tests use real QListWidget, QComboBox, QLineEdit, and QFileDialog. JADE. jader.py uses the same pair order (p = 1..m-1, q = p+1..m) and the same stop (abs(theta) > 1/sqrt(T)/100). The residual is the unsorted MATLAB eig versus numpy eigh at initialization, plus the unconditional variance reorder. Components 12 and 13 stay swapped. After scaling, activation r is at least 0.99994 and winv is within 9.6e-3 relative. The Jacobi sweep updates the cumulant matrix in place, so there is no separate vectorisation that keeps that order. 10.8 s versus MATLAB 5.6 s is that loop. F69. The sphere does not use the RNG and matches to 5.8e-9. Weights use RandomState(5489), the pythoncompat stream rng(5489, 'twister'), not EEGLAB's rndreset-off stream rand('state', 0). The median correlation of 0.91 is the gap between those two seeds. The seed is unchanged and no tolerance was loosened. tolerances.toml has no new entry. The MATLAB sobi comparison uses assert_matlab_near and is selected only with --eeglab-backend=matlab. ml_rmbase is not in this checkout; the BESA label test places component 1 on the superiorfrontal R atlas vertex through the identity transform and expects that label. |
pop_runica passes lrate 0.001 unless the caller sets one. JADE uses the general eigenpath when a matrix is not exactly symmetric. Dipole slices are transposed so the anatomy is upright, and each head model uses its own volume. Co-authored-by: Suraj Ranganath <[email protected]>
|
🤖 Specification for eb5e9a2. Problem. The seeded runica gap was not the RNG. After rng(5489,'twister'), MATLAB rand matches RandomState(5489). pop_runica.m lines 503 and 523 always pass lrate 0.001, and eegprep was falling through to 0.00065/log(nchans). JADE swapped components 12 and 13 because jader.py used eigh on a cumulant block that is not exactly symmetric (MATLAB eig takes the general path). Every dipplot MRI slice was upside down: rot90 plus origin lower flips z on the sagittal and coronal views and y on the axial. Spherical plots were labeled avg152t1 while drawing the Colin volume. Fine-fit Plot dipole drew an unchecked second dipole at the origin, omitted projection lines, and did not title the figure IC n. The SOBI box accepted 'p', 100 as n=100. Multifit left coord_transform empty. Approach. eeg_runica copies its options and sets lrate to 0.001 only when the caller did not pass one, so the history command stays EEGLAB's vararg2str(g.options). jader._matlab_eig uses eigh only when A equals A.'; otherwise it uses np.linalg.eig and keeps real parts only when that result is real. The covariance is mirrored from the lower triangle first, because MATLAB's X*X' is exactly symmetric and eigh reads that triangle. dipfit_mri_slices uses the transposed plane with origin lower. Spherical plots load the packaged avg152t1 volume and MNI plots load standard_mri, and the figure label is that volume's name. pop_dipplot draws only rows in model.select, and the fine-fit button passes normlen on, projlines on, and title IC n. Named SOBI or JADE option text raises pop_runica with the positional form. pop_multifit ends in the existing empty-transform normalizer, which stores [0 0 0 0 0 0 1 1 1]. JADE speed. On a 32 by 2000 matrix the eigh init took 315 sweeps and 45.7 s. The general-eig init takes 114 sweeps and 13.2 s. The remaining time is the in-place pair sweep, which is unchanged so the order stays p = 1..m-1, q = p+1..m. Tests. A mocked runica call checks lrate 0.001, a caller override of 1e-5, and that only the override appears in history. test_seeded_pop_runica_on_eeglab_data_matches_pythoncompat compares pop_runica on eeglab_data.set with EEGLAB pythoncompat through assert_matlab_near. It is selected only with --eeglab-backend=matlab. The JADE test fails if eigh is used on a matrix that is not exactly symmetric. The slice test uses the component 3 position (-0.05, 61.6, -41.1): air above the vertex is the top of the coronal image, the sagittal superior band is above the neck, and the axial anterior span is narrower than the posterior span. Spherical figures are labeled avg152t1 with shape (91, 109); MNI figures are labeled standard_mri with shape (181, 217). An unchecked dipole at the origin is not drawn. 'p', 100 raises, and 2 1 stays positional. Multifit on an empty BESA transform stores the identity. Tolerances and parity JSON were not changed. |
avg152t1 extents now follow the 2 mm affine, Plot map uses IC n, and named SOBI lists raise the same pop_runica error as the text form. Co-authored-by: Suraj Ranganath <[email protected]>
|
🤖 Round 5, head 7cb54e5. Problem. Approach. World position on each axis is transform[axis, axis] * grid + transform[axis, 3]. dipplot.m shifts the slice by three grid steps (-x, +y, -z); that is 3 mm on standard_mri and 6 mm on avg152t1, and the Colin indices stay (87, 108, 109). Plot map uses "IC n". Text and list/tuple SOBI or Jade names share one pop_runica error that shows {32 100} or p=100. The rejection stays: sobi.m ignores n, and EEGPrep does not. Plot dipole still honours select when the unchecked dipole is nonzero. The jader comment is gone; the mirror stays. Tests. avg152t1 and standard_mri slice extents equal the affine world bounds, and a 3-voxel move of 3 * voxel size millimetres shifts the index by 3. Plot map records the title IC 1. options ['p', 100] and ('p', 100) match the text error. An unchecked dipole at [10, 20, 30] is not drawn. ./pre-commit.py --fix passed. tests/test_dipfit_workflows.py and tests/test_eeg_runica.py: 48 passed, 2 MATLAB tests deselected. |
|
Claude finished @suraj-ranganath's task in 3m 27s —— View job Code review (head
|
| options: list[tuple[str, Any]] = list(structure_ops) | ||
| if structure_ops: | ||
| return options |
There was a problem hiding this comment.
Important (bug). This PR enables Insert, Append and Delete, and that exposes two failures when the user presses OK:
- Field edits are lost. As soon as
structure_opshas an entry, the function returns before thechangefieldloop. Example: click Insert event, typetype=stimand a latency into the new blank event, press OK. The command and the dataset get only('insert', 1), so an empty event is stored and the typed values are discarded. Edits made to existing events in the same session are dropped too. EEGLAB records'insert'/'append'and also the'changefield'entries that follow. - Append on the last event raises.
_edit_event_structure(qt.py:1632) setseventnumtoindex + 2. On the last of N events that is N+1, so the range check at lines 188-192 (which still uses the originallen(events)) raisesevent number N+1 is outside 1 to N.
Suggested fix: after applying structure_ops, compare field_displays (already re-indexed for the new event list) with the post-structure events and add the changefield entries, rather than returning early. Check eventnum against len(displays) instead of len(events). The current test only clicks Insert and never presses OK. Add one that does Insert → type values → OK, and another that does Append on the last event → OK.
eegprep/src/eegprep/functions/popfunc/pop_editeventvals.py
Lines 187 to 210 in 7cb54e5
There was a problem hiding this comment.
🤖 Fixed in 3f6b7e2. Insert, append, and delete stay in the command, and the field edits that follow are changefield entries at the indices after those structure ops. That is the order EEGLAB expands for replay: the structure action, then changefield. The event number is checked against the display list, so append on the last of N events is N+1. Tests cover insert then OK, append on the last event then OK, and delete plus an edit on a remaining event. Each history command replays to the same events.
| ControlSpec("pushbutton", "Flip (in|out)", tag="flip1", callback=action("flip1")), | ||
| ControlSpec("text", "#2", tag="dip2"), | ||
| ControlSpec("checkbox", tag="dip2sel", value=second_selected), | ||
| ControlSpec("spacer"), | ||
| ControlSpec("edit", tag="dip2pos", value=_format_dialog_triplet(model.get("posxyz"), 1)), | ||
| ControlSpec("edit", tag="dip2mom", value=_format_dialog_triplet(model.get("momxyz"), 1)), | ||
| ControlSpec("pushbutton", "Flip (in|out)", tag="flip2", enabled=False), | ||
| ControlSpec("pushbutton", "Flip (in|out)", tag="flip2", callback=action("flip2")), | ||
| ControlSpec("checkbox", "Symmetry constrain for dipole #2", tag="dip2sym", value=True), | ||
| ControlSpec("pushbutton", "Fit dipole(s)' position & moment", tag="fitposition", enabled=False), | ||
| ControlSpec("pushbutton", "OR fit only dipole(s)' moment", tag="fitmoment", enabled=False), | ||
| ControlSpec("pushbutton", "Plot dipole(s)", tag="plotdip", enabled=False), | ||
| ), | ||
| known_differences=( | ||
| "EEGPrep OK applies the displayed values and runs a spherical nonlinear fit; individual MATLAB callbacks are not mirrored.", | ||
| ControlSpec( | ||
| "pushbutton", | ||
| "Fit dipole(s)' position & moment", | ||
| tag="fitposition", | ||
| callback=action("fitposition"), | ||
| ), | ||
| ControlSpec("pushbutton", "OR fit only dipole(s)' moment", tag="fitmoment", callback=action("fitmoment")), |
There was a problem hiding this comment.
Important (behavior). These buttons are now enabled, but OK still runs run_nonlinear(working, ..., nonlinear="yes") on the values shown in the dialog (lines 59-63). So:
- After Flip (in|out), OK refits position and moment. The least-squares moment comes back with its original sign, so the flip is undone.
- After OR fit only dipole(s)' moment, OK runs a full position fit, so the dipole that gets stored is not the one the user just saw.
- Positions or moments typed by hand are also overwritten.
This PR also removed the known_differences note that said "OK … runs a spherical nonlinear fit", so this is no longer documented.
Suggested fix: in the GUI branch, store working (the values on screen) without refitting, so OK keeps the result of the last button press. Keep run_nonlinear for the command-line form. If refit-on-OK is intended, restore the known-difference note and disable Flip and fit-moment. Add a test: click Flip, press OK, and check that momxyz keeps the flipped sign.
eegprep/src/eegprep/plugins/dipfit/pop_dipfit_nonlinear.py
Lines 55 to 70 in 7cb54e5
There was a problem hiding this comment.
🤖 Fixed in 3f6b7e2. GUI OK returns the on-screen model and does not call run_nonlinear. Command-line calls still do. Flip then OK keeps the flipped momxyz sign. Fit only moment then OK leaves posxyz unchanged. Typed position and moment survive OK.
Insert, append, and delete now record the following field changes, and fine-fit OK stores the dialog model instead of refitting. A malformed coord_transform raises from eeg_compatlas. Co-authored-by: Suraj Ranganath <[email protected]>
Co-authored-by: Suraj Ranganath <[email protected]>
|
Claude finished @suraj-ranganath's task in 1m 8s —— View job Code review (head
|
| if result.get("dip2sel") and result.get("dip2sym"): | ||
| symmetry = "x" if str(dipfit_record(EEG).get("coordformat", "")).lower() == "mni" else "y" | ||
| working, _component = _apply_nonlinear_gui_model(EEG, result) | ||
| return (working, "") if return_com else working |
There was a problem hiding this comment.
Important (regression). GUI OK now returns an empty command. The menu handler for Tools > Locate dipoles > Component dipole fine fit only stores a result when the command is non-empty:
eegprep/src/eegprep/functions/guifunc/menu_actions.py
Lines 1722 to 1728 in 5e24e40
So in the app, OK is now a no-op. The flipped, moment-only, or typed dipole is thrown away, and EEG/ALLEEG in eegprep-console stay unchanged. Before this commit OK returned a refit with a dipfit_history command, so the dataset was stored. test_nonlinear_ok_keeps_* call pop_dipfit_nonlinear directly and assert command == "", so they lock in the behaviour that the menu drops.
Suggested fix: return a replayable command for the on-screen model, so the menu stores it and history replays it. For example, record the component plus the displayed posxyz/momxyz/select, or EEG = pop_dipfit_nonlinear(EEG) if you accept that replay is not exact. Then update the tests to expect a non-empty command, and add a menu-level test: run the fine-fit action, Flip, OK, and check that session.EEG["dipfit"]["model"] has the flipped moment.
There was a problem hiding this comment.
👾 Fixed in f6ec216. Fine-fit OK now records the on-screen component, posxyz, momxyz, and select. The menu stores that dataset, and replaying the command writes those coordinates without calling run_nonlinear. Flip, fit-only-moment, and typed values each replay to the same model, and the menu action keeps the flipped moment on session.EEG.
There was a problem hiding this comment.
🤖 Fixed in f6ec216. Fine-fit OK now records the on-screen component, posxyz, momxyz, and select. The menu stores that dataset, and replaying the command writes those coordinates without calling run_nonlinear. Flip, fit-only-moment, and typed values each replay to the same model, and the menu action keeps the flipped moment on session.EEG.
OK writes the on-screen position, moment, and selection into a history command that replays those coordinates without running the fit again. Co-authored-by: Suraj Ranganath <[email protected]>
|
Claude finished @suraj-ranganath's task in 31s —— View job Code review (head
|
The batch transport turns a Python EEG dict into a cell, so pop_runica now receives the struct returned by MATLAB pop_loadset. Co-authored-by: Suraj Ranganath <[email protected]>
|
Claude finished @suraj-ranganath's task in 45s —— View job Code review (head
|
pop_runica passes lrate 0.001 unless set and omits it from history. That default now reaches every eeg_runica caller, including bids_preproc, matching EEGLAB pop_runica. JADE uses general eig on a non-symmetric matrix. Dipole slices stay upright and scale by voxel size, so avg152t1 matches its 2 mm bounds. Spherical plots use avg152t1 and MNI plots use standard_mri. Fine-fit OK stores the on-screen dipole, including a flipped moment, and records those coordinates so the menu and history replay them without refitting. Plot map is titled IC n. Plot dipole honours select for a nonzero unchecked dipole and draws projection lines. Insert, append, and delete keep the field edits that follow, in that command order. Named SOBI text and ['p', 100] raise the same error; sobi.m ignores n. Multifit stores the identity transform.
EEGLAB reference on this head: https://github.com/sccn/eegprep/actions/runs/45316172997, dispatched by suraj-ranganath on 2afe7bd (EEGLAB d0963be9, eeglab_tests fec88f9f). Shards heavy, misc, stats, hybrid and parity passed. core: 4 failed, 2919 passed, 17 skipped. study: 1 failed, 340 passed, 27 skipped. test_seeded_pop_runica_on_eeglab_data_matches_pythoncompat passes at the unchanged tolerance.
The 5 failures are the develop failures tracked in #685: test_coregister_parity.py (2 tests), test_dipfit_bem.py::test_bem_leadfield_and_multifit_match_fieldtrip, test_study_clustering.py::test_matlab_kmeans_numbering_matches_fixed_initial_centroids and test_phase2_file_channel_location.py::test_struct_near_assertion_matches_source. The coregister and BEM Python results are bit-identical on develop 7e17c30 and on this branch, and this PR does not touch the kmeans or struct_near tests or the MATLAB transport. The earlier run on 5e24e40 (https://github.com/sccn/eegprep/actions/runs/45309848204) showed the same 5 plus the runica transport failure fixed in 2afe7bd.
Fixes #675