canns 0.14.3__py3-none-any.whl → 0.15.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. canns/analyzer/data/asa/__init__.py +56 -21
  2. canns/analyzer/data/asa/coho.py +21 -0
  3. canns/analyzer/data/asa/cohomap.py +453 -0
  4. canns/analyzer/data/asa/cohomap_vectors.py +365 -0
  5. canns/analyzer/data/asa/cohospace.py +155 -1165
  6. canns/analyzer/data/asa/cohospace_phase_centers.py +119 -0
  7. canns/analyzer/data/asa/cohospace_scatter.py +1115 -0
  8. canns/analyzer/data/asa/embedding.py +5 -7
  9. canns/analyzer/data/asa/fr.py +1 -8
  10. canns/analyzer/data/asa/path.py +70 -0
  11. canns/analyzer/data/asa/plotting.py +5 -30
  12. canns/analyzer/data/asa/utils.py +160 -0
  13. canns/analyzer/data/cell_classification/__init__.py +10 -0
  14. canns/analyzer/data/cell_classification/core/__init__.py +4 -0
  15. canns/analyzer/data/cell_classification/core/btn.py +272 -0
  16. canns/analyzer/data/cell_classification/visualization/__init__.py +3 -0
  17. canns/analyzer/data/cell_classification/visualization/btn_plots.py +241 -0
  18. canns/analyzer/visualization/__init__.py +2 -0
  19. canns/analyzer/visualization/core/config.py +20 -0
  20. canns/analyzer/visualization/theta_sweep_plots.py +142 -0
  21. canns/pipeline/asa/runner.py +19 -19
  22. canns/pipeline/asa_gui/__init__.py +5 -3
  23. canns/pipeline/asa_gui/analysis_modes/pathcompare_mode.py +3 -1
  24. canns/pipeline/asa_gui/core/runner.py +23 -23
  25. canns/pipeline/asa_gui/views/pages/preprocess_page.py +7 -12
  26. {canns-0.14.3.dist-info → canns-0.15.1.dist-info}/METADATA +1 -1
  27. {canns-0.14.3.dist-info → canns-0.15.1.dist-info}/RECORD +30 -23
  28. canns/analyzer/data/asa/filters.py +0 -208
  29. {canns-0.14.3.dist-info → canns-0.15.1.dist-info}/WHEEL +0 -0
  30. {canns-0.14.3.dist-info → canns-0.15.1.dist-info}/entry_points.txt +0 -0
  31. {canns-0.14.3.dist-info → canns-0.15.1.dist-info}/licenses/LICENSE +0 -0
@@ -651,7 +651,7 @@ class PipelineRunner:
651
651
  def _run_cohomap(
652
652
  self, asa_data: dict[str, Any], state: WorkflowState, log_callback
653
653
  ) -> dict[str, Path]:
654
- from canns.analyzer.data.asa import plot_cohomap_multi
654
+ from canns.analyzer.data.asa import plot_cohomap_scatter_multi
655
655
  from canns.analyzer.visualization import PlotConfigs
656
656
 
657
657
  tda_dir = self._results_dir(state) / "TDA"
@@ -684,7 +684,7 @@ class PipelineRunner:
684
684
  log_callback("Generating cohomology map...")
685
685
  pos = self._aligned_pos if self._aligned_pos is not None else asa_data
686
686
  config = PlotConfigs.cohomap(show=False, save_path=str(cohomap_path))
687
- plot_cohomap_multi(
687
+ plot_cohomap_scatter_multi(
688
688
  decoding_result=decode_result,
689
689
  position_data={"x": pos["x"], "y": pos["y"]},
690
690
  config=config,
@@ -1175,18 +1175,18 @@ class PipelineRunner:
1175
1175
  self, asa_data: dict[str, Any], state: WorkflowState, log_callback
1176
1176
  ) -> dict[str, Path]:
1177
1177
  from canns.analyzer.data.asa import (
1178
- plot_cohospace_neuron_1d,
1179
- plot_cohospace_neuron_2d,
1180
- plot_cohospace_population_1d,
1181
- plot_cohospace_population_2d,
1182
- plot_cohospace_trajectory_1d,
1183
- plot_cohospace_trajectory_2d,
1178
+ plot_cohospace_scatter_neuron_1d,
1179
+ plot_cohospace_scatter_neuron_2d,
1180
+ plot_cohospace_scatter_population_1d,
1181
+ plot_cohospace_scatter_population_2d,
1182
+ plot_cohospace_scatter_trajectory_1d,
1183
+ plot_cohospace_scatter_trajectory_2d,
1184
1184
  )
1185
- from canns.analyzer.data.asa.cohospace import (
1186
- compute_cohoscore_1d,
1187
- compute_cohoscore_2d,
1188
- plot_cohospace_neuron_skewed,
1189
- plot_cohospace_population_skewed,
1185
+ from canns.analyzer.data.asa.cohospace_scatter import (
1186
+ compute_cohoscore_scatter_1d,
1187
+ compute_cohoscore_scatter_2d,
1188
+ plot_cohospace_scatter_neuron_skewed,
1189
+ plot_cohospace_scatter_population_skewed,
1190
1190
  )
1191
1191
  from canns.analyzer.visualization import PlotConfigs
1192
1192
 
@@ -1254,11 +1254,11 @@ class PipelineRunner:
1254
1254
  if enable_score:
1255
1255
  try:
1256
1256
  if dim_mode == "1d":
1257
- scores = compute_cohoscore_1d(
1257
+ scores = compute_cohoscore_scatter_1d(
1258
1258
  coords2, activity, top_percent=top_percent, times=times
1259
1259
  )
1260
1260
  else:
1261
- scores = compute_cohoscore_2d(
1261
+ scores = compute_cohoscore_scatter_2d(
1262
1262
  coords2, activity, top_percent=top_percent, times=times
1263
1263
  )
1264
1264
  cohoscore_path = out_dir / "cohoscore.npy"
@@ -1314,7 +1314,7 @@ class PipelineRunner:
1314
1314
  traj_path = out_dir / "cohospace_trajectory.png"
1315
1315
  if dim_mode == "1d":
1316
1316
  traj_cfg = PlotConfigs.cohospace_trajectory_1d(show=False, save_path=str(traj_path))
1317
- plot_cohospace_trajectory_1d(
1317
+ plot_cohospace_scatter_trajectory_1d(
1318
1318
  coords=coords2,
1319
1319
  times=None,
1320
1320
  subsample=subsample,
@@ -1322,7 +1322,7 @@ class PipelineRunner:
1322
1322
  )
1323
1323
  else:
1324
1324
  traj_cfg = PlotConfigs.cohospace_trajectory_2d(show=False, save_path=str(traj_path))
1325
- plot_cohospace_trajectory_2d(
1325
+ plot_cohospace_scatter_trajectory_2d(
1326
1326
  coords=coords2,
1327
1327
  times=None,
1328
1328
  subsample=subsample,
@@ -1334,7 +1334,7 @@ class PipelineRunner:
1334
1334
  log_callback(f"Plotting neuron {neuron_id}...")
1335
1335
  neuron_path = out_dir / f"cohospace_neuron_{neuron_id}.png"
1336
1336
  if unfold == "skew" and dim_mode != "1d":
1337
- plot_cohospace_neuron_skewed(
1337
+ plot_cohospace_scatter_neuron_skewed(
1338
1338
  coords=coordsbox2,
1339
1339
  activity=activity,
1340
1340
  neuron_id=int(neuron_id),
@@ -1351,7 +1351,7 @@ class PipelineRunner:
1351
1351
  neuron_cfg = PlotConfigs.cohospace_neuron_1d(
1352
1352
  show=False, save_path=str(neuron_path)
1353
1353
  )
1354
- plot_cohospace_neuron_1d(
1354
+ plot_cohospace_scatter_neuron_1d(
1355
1355
  coords=coordsbox2,
1356
1356
  activity=activity,
1357
1357
  neuron_id=int(neuron_id),
@@ -1364,7 +1364,7 @@ class PipelineRunner:
1364
1364
  neuron_cfg = PlotConfigs.cohospace_neuron_2d(
1365
1365
  show=False, save_path=str(neuron_path)
1366
1366
  )
1367
- plot_cohospace_neuron_2d(
1367
+ plot_cohospace_scatter_neuron_2d(
1368
1368
  coords=coordsbox2,
1369
1369
  activity=activity,
1370
1370
  neuron_id=int(neuron_id),
@@ -1384,7 +1384,7 @@ class PipelineRunner:
1384
1384
  else:
1385
1385
  neuron_ids = list(range(activity.shape[1]))
1386
1386
  if unfold == "skew" and dim_mode != "1d":
1387
- plot_cohospace_population_skewed(
1387
+ plot_cohospace_scatter_population_skewed(
1388
1388
  coords=coords2,
1389
1389
  activity=activity,
1390
1390
  neuron_ids=neuron_ids,
@@ -1401,7 +1401,7 @@ class PipelineRunner:
1401
1401
  pop_cfg = PlotConfigs.cohospace_population_1d(
1402
1402
  show=False, save_path=str(pop_path)
1403
1403
  )
1404
- plot_cohospace_population_1d(
1404
+ plot_cohospace_scatter_population_1d(
1405
1405
  coords=coords2,
1406
1406
  activity=activity,
1407
1407
  neuron_ids=neuron_ids,
@@ -1414,7 +1414,7 @@ class PipelineRunner:
1414
1414
  pop_cfg = PlotConfigs.cohospace_population_2d(
1415
1415
  show=False, save_path=str(pop_path)
1416
1416
  )
1417
- plot_cohospace_population_2d(
1417
+ plot_cohospace_scatter_population_2d(
1418
1418
  coords=coords2,
1419
1419
  activity=activity,
1420
1420
  neuron_ids=neuron_ids,
@@ -5,7 +5,6 @@ from __future__ import annotations
5
5
  from pathlib import Path
6
6
 
7
7
  import numpy as np
8
-
9
8
  from PySide6.QtCore import QSettings, Qt, Signal
10
9
  from PySide6.QtGui import QColor
11
10
  from PySide6.QtWidgets import (
@@ -388,9 +387,7 @@ class PreprocessPage(QWidget):
388
387
  if is_zh
389
388
  else "Choose local file, built-in dataset, or URL."
390
389
  )
391
- self.dataset_key.setToolTip(
392
- "选择内置数据集" if is_zh else "Select a built-in dataset."
393
- )
390
+ self.dataset_key.setToolTip("选择内置数据集" if is_zh else "Select a built-in dataset.")
394
391
  self.dataset_session.setToolTip(
395
392
  "Left-Right 数据集的会话 id。" if is_zh else "Session id for Left-Right dataset."
396
393
  )
@@ -410,7 +407,9 @@ class PreprocessPage(QWidget):
410
407
  else "Embedding builds a dense spike matrix for TDA/FR."
411
408
  )
412
409
  self.embed_res.setToolTip(
413
- "时间分箱分辨率(与 t 单位一致)。" if is_zh else "Time bin resolution (same unit as t)."
410
+ "时间分箱分辨率(与 t 单位一致)。"
411
+ if is_zh
412
+ else "Time bin resolution (same unit as t)."
414
413
  )
415
414
  self.embed_dt.setToolTip(
416
415
  "时间步长(与 t 单位一致)。" if is_zh else "Time step (same unit as t)."
@@ -425,9 +424,7 @@ class PreprocessPage(QWidget):
425
424
  else "Remove low-speed samples (common for grid data)."
426
425
  )
427
426
  self.embed_min_speed.setToolTip(
428
- "速度阈值(与 t/x/y 单位一致)。"
429
- if is_zh
430
- else "Speed threshold (same unit as t/x/y)."
427
+ "速度阈值(与 t/x/y 单位一致)。" if is_zh else "Speed threshold (same unit as t/x/y)."
431
428
  )
432
429
 
433
430
  self.dataset_session.setPlaceholderText("例如 26034_3" if is_zh else "e.g. 26034_3")
@@ -527,9 +524,7 @@ class PreprocessPage(QWidget):
527
524
  except Exception:
528
525
  hint = ""
529
526
  if is_left_right:
530
- hint = (
531
- (hint + "\n") if hint else ""
532
- ) + (
527
+ hint = ((hint + "\n") if hint else "") + (
533
528
  "左/右数据集需要 session id 和文件名。"
534
529
  if is_zh
535
530
  else "Left-right dataset requires session id + filename."
@@ -612,8 +607,8 @@ class PreprocessPage(QWidget):
612
607
  key = self.dataset_key.currentData() or self.dataset_key.currentText()
613
608
  label = self._slugify(str(key))
614
609
  try:
615
- from canns.data import loaders as _loaders
616
610
  from canns.data import datasets as _datasets
611
+ from canns.data import loaders as _loaders
617
612
 
618
613
  if key == "roi_data":
619
614
  data = _loaders.load_roi_data()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: canns
3
- Version: 0.14.3
3
+ Version: 0.15.1
4
4
  Summary: A Python Library for Continuous Attractor Neural Networks
5
5
  Project-URL: Repository, https://github.com/routhleck/canns
6
6
  Author-email: Sichao He <sichaohe@outlook.com>
@@ -3,19 +3,25 @@ canns/_version.py,sha256=zIvJPOGBFvo4VV6f586rlO_bvhuFp1fsxjf6xhsqkJY,1547
3
3
  canns/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  canns/analyzer/__init__.py,sha256=EQ02fYHkpMADp-ojpVCVtapuSPkl6j5WVfdPy0mOTs4,506
5
5
  canns/analyzer/data/__init__.py,sha256=RfS8vwApLkNF05Y_lfPaJpN_bRv-mOA_uFziaduDHgI,354
6
- canns/analyzer/data/asa/__init__.py,sha256=w1RC5QbCXh9UH1PrrBXdclopH86jAJyxNw-nCymGgA8,2312
7
- canns/analyzer/data/asa/cohospace.py,sha256=wiTu03IqxnkJeSRzlJpcN31OZRG3jfgq4TG8mVvs3R0,37246
6
+ canns/analyzer/data/asa/__init__.py,sha256=JtXp1QgoqsA1_XiZ4TNFnTGP_iKo5fHeJ_V3wpdhN6g,3327
7
+ canns/analyzer/data/asa/coho.py,sha256=775bOruTVSNRjM0A4YRTeiWKVQtEMCR3zTYXgVTeLiw,444
8
+ canns/analyzer/data/asa/cohomap.py,sha256=ZIiH1Mu306jg1lLmeV-akEzbojXQQVKW3nl0PbFKD4M,15217
9
+ canns/analyzer/data/asa/cohomap_vectors.py,sha256=o2eHMqiAvmhZfebOvHZ1zypqZKKgvZu0WLs3KD3Nfis,11273
10
+ canns/analyzer/data/asa/cohospace.py,sha256=8sq1Z0QGDxzC-5YY1n-nDEtqH3vnIsVA0Q1ST7egxTE,6701
11
+ canns/analyzer/data/asa/cohospace_phase_centers.py,sha256=ZQDhd_cBv8SFcVxgGM0nJabTLjKQZ1mg9Ho6duUG0xY,3738
12
+ canns/analyzer/data/asa/cohospace_scatter.py,sha256=lBubii5rz-MiTT_rYa5u59nzw2vkuOcFDnM6UhvvJ9M,33893
8
13
  canns/analyzer/data/asa/config.py,sha256=qm0k0nt0xuDUK5t63MG7ii7fgs2XbxyLxKOaOKJuB_s,6398
9
14
  canns/analyzer/data/asa/decode.py,sha256=NG8vVx2cPG7uSJDovnC2vzk0dsqU8oR4jaNPxxrvCc0,16501
10
- canns/analyzer/data/asa/embedding.py,sha256=fa1wEH2puMw8HiZIYCufas51uvnlduxwNMUPpwkbdoc,9643
11
- canns/analyzer/data/asa/filters.py,sha256=D-1mDVn4hBEAphKUgx1gQEUfgbghKcNQhZmr4xEExQA,7146
15
+ canns/analyzer/data/asa/embedding.py,sha256=V1TzOD4wzyx3xmwCBHLLWgX92rBkMjWkFz-F-4xPPxo,9581
12
16
  canns/analyzer/data/asa/fly_roi.py,sha256=_scBOd-4t9yv_1tHk7wbXJwPieU-L-QtFJY6fhHpxDI,38031
13
- canns/analyzer/data/asa/fr.py,sha256=jt99H50e1RRAQgMIdkfK0rBbembZJEr9SMrxK-ZI_LA,13449
14
- canns/analyzer/data/asa/path.py,sha256=dL6hsqBoPFfC4ZrHDVFDWprbRfJAAYpiq4tIkZ6NvHY,15540
15
- canns/analyzer/data/asa/plotting.py,sha256=o0fErGzDtbERiZK7uzyQN6Jd7Hm6jXZFg4aGZ100BQU,42766
17
+ canns/analyzer/data/asa/fr.py,sha256=-MuA50eTVdVJB7CUBeLelvnm0i0c0pK5NRICLoSD7oo,13292
18
+ canns/analyzer/data/asa/path.py,sha256=JM8NqkhwFx7qDs26n_t2bL5md9V4oR2E2ksXwYAwTug,17965
19
+ canns/analyzer/data/asa/plotting.py,sha256=PuYGZgal67uDRZ4xBczJKbVblqbza4a03re105Wj7vA,42243
16
20
  canns/analyzer/data/asa/tda.py,sha256=7IdxhBNEE99qenG6Zi4B5tv_L9K6gAW6HHxYGiErx4c,30574
17
- canns/analyzer/data/cell_classification/__init__.py,sha256=ho8yYcBf0Do_M3V1l0Li26gLDi_DIS4F-Pr5IMLcJ5A,2221
18
- canns/analyzer/data/cell_classification/core/__init__.py,sha256=Lv1zkGI3UnFT4yGkj351Jj-KEVtZlmRUM37SDby1bIE,761
21
+ canns/analyzer/data/asa/utils.py,sha256=s9R1d6K4op9MnjcBaI4vrnEAC-9KyZE6S9dg_zR0ONs,4899
22
+ canns/analyzer/data/cell_classification/__init__.py,sha256=Ri0VJYn2OI3ygC4m-Xc9rjFvgPLaEykc-D94VxmUclQ,2447
23
+ canns/analyzer/data/cell_classification/core/__init__.py,sha256=J9uqjx2wTK-uh3OWFqP8BkY_ySz3rU_VWRNQ_1t3EbM,865
24
+ canns/analyzer/data/cell_classification/core/btn.py,sha256=rgZdEoMgqgOPah5KHEQAx7pNWDsWBzZ2pNQ5BstTYFM,8546
19
25
  canns/analyzer/data/cell_classification/core/grid_cells.py,sha256=fRFixjvPVJy0QF9MygGqpIk1lnTToMZvvbGubM5woRk,21547
20
26
  canns/analyzer/data/cell_classification/core/grid_modules_leiden.py,sha256=xWrbL51BeU9pIaCzak54upFBeSUtnx_V_naILjzzExk,9032
21
27
  canns/analyzer/data/cell_classification/core/head_direction.py,sha256=CQKyon9pb3K5SBkesuqkBTU-QXx_-g0FBa0bblWDPOw,12060
@@ -27,7 +33,8 @@ canns/analyzer/data/cell_classification/utils/circular_stats.py,sha256=fQ1PNBiF_
27
33
  canns/analyzer/data/cell_classification/utils/correlation.py,sha256=57Ckn8OQGLipT7qZIGl6wgooQ_8gwp01g9lVc8I3Cs0,10354
28
34
  canns/analyzer/data/cell_classification/utils/geometry.py,sha256=jOLh3GeO-riR5a7r7Q7uON3HU_bYOZZJLbokU5bjCOQ,12683
29
35
  canns/analyzer/data/cell_classification/utils/image_processing.py,sha256=o9bLT4ycJ_IF7SKBe2RqSWIQwNcpi9v4AI-N5vpm_jM,12805
30
- canns/analyzer/data/cell_classification/visualization/__init__.py,sha256=HJy71bZuvvfFxrd4PTj3AUon68FBjZjtmjgky20oo5o,450
36
+ canns/analyzer/data/cell_classification/visualization/__init__.py,sha256=fmEHZBcurW6y6FwySLoq65b6CH2kNUB02NCVw2ou6Nc,590
37
+ canns/analyzer/data/cell_classification/visualization/btn_plots.py,sha256=wHP6jyzzqvD2bgYriQFu1tZQiHevlYDy8V1fFNBw4M0,7345
31
38
  canns/analyzer/data/cell_classification/visualization/grid_plots.py,sha256=NFtyYOe2Szt0EOIwQmZradwEvvRjjm7mm6VnnGThDQ0,7914
32
39
  canns/analyzer/data/cell_classification/visualization/hd_plots.py,sha256=nzw1jck3VHvAFsJAGelhrJf1q27A5PI0r3NKVgeea8U,5670
33
40
  canns/analyzer/metrics/__init__.py,sha256=DTsrv1HW133_RgvhWzz7Gx-bP2hOZbPO2unCPPyf9gs,178
@@ -41,16 +48,16 @@ canns/analyzer/slow_points/checkpoint.py,sha256=s4_-5HZJvmnyFqpK1O9WWYkhAhZj1i5j
41
48
  canns/analyzer/slow_points/finder.py,sha256=y-YKg-LI7lRM4JMghfcb5NGSYhIM2VPRA37YSCkVK_4,25437
42
49
  canns/analyzer/slow_points/fixed_points.py,sha256=Qp-iezwydWWUTchb2hGXJv0QKJqIm9gSG6hh0H9Eb6E,10099
43
50
  canns/analyzer/slow_points/visualization.py,sha256=sRmmxs900OSB680MTp0PNIGLpS5i5AmJ58ek20vmrSE,10610
44
- canns/analyzer/visualization/__init__.py,sha256=pNIokzS8y3ydzEMmVm1FNrOMRALDeuOHbcwZicPUm90,2131
51
+ canns/analyzer/visualization/__init__.py,sha256=_4a8mrVOr8TR63LZbXym-djYbW-6vxxI78dxiHpSsho,2211
45
52
  canns/analyzer/visualization/energy_plots.py,sha256=u0TOLzd7AWEfs-tRYZg1UBwsGYGPF_eWsMip1ZG9jPA,35671
46
53
  canns/analyzer/visualization/spatial_plots.py,sha256=30m02xhYkZfEETCtvBSwLix9SEOPcLZTg0AGGFvPc2w,34605
47
54
  canns/analyzer/visualization/spike_plots.py,sha256=wOm4gh_3obJy6gwo31maoaiZ7O8rsoYeFdhseoVmX78,12280
48
- canns/analyzer/visualization/theta_sweep_plots.py,sha256=2kiP7-IizqGm0q-ohQ4HhDZpm3sqs_lgn3GErHEZzbI,62262
55
+ canns/analyzer/visualization/theta_sweep_plots.py,sha256=BPW0VRR-rSJcJkMkY-Z1NpMS3iPIgLe3w0ZLBnHfeog,67723
49
56
  canns/analyzer/visualization/tuning_plots.py,sha256=9JOeC4dlulVzpHQWDVy3dlJnxcBZiOPeapPdVFR-7Zk,5178
50
57
  canns/analyzer/visualization/core/__init__.py,sha256=Vngm2A05cTu9ZVEYepTF7lVpuwQvMRjXs9XPLfZzedI,1928
51
58
  canns/analyzer/visualization/core/animation.py,sha256=qfBYMd81_GwWEw4MHOu3GrVXJtHS9W1xxtmOx-J5ZyM,7664
52
59
  canns/analyzer/visualization/core/backend.py,sha256=Nbk-ARL_xeWlb3nl5SUPrFQNns2wq5BeHU3Q_tAbd_c,9539
53
- canns/analyzer/visualization/core/config.py,sha256=PI4GnEwjwDhRpWPfe-bdYBLIO9ica5B3dYUC_VhpSek,25542
60
+ canns/analyzer/visualization/core/config.py,sha256=2-YIFa-eqtUrNPJERTpPO-PPX0PdOaAioi95VT9WUbQ,26268
54
61
  canns/analyzer/visualization/core/jupyter_utils.py,sha256=JD56VeeWb7w9t5DJ8TpgnxRWkUK46ArbbPSTlFdIM10,6034
55
62
  canns/analyzer/visualization/core/rendering.py,sha256=YCbiXu8MOAqE9FVb_id5JKr5g9O64sCh-dOs0EK4gnU,18291
56
63
  canns/analyzer/visualization/core/writers.py,sha256=HLsP953hgsv140ZX2XPzHfCUTqenjmjbLNrbknKam_s,15607
@@ -76,12 +83,12 @@ canns/pipeline/launcher.py,sha256=GASiWSfezljY56swjfLUR_QZCUU5Acm4v3mh9kNYayE,19
76
83
  canns/pipeline/asa/__init__.py,sha256=JR4T0onfmkKMOrUq-k0San1RTSb1om6cd27tWovBp0c,466
77
84
  canns/pipeline/asa/__main__.py,sha256=_KgAeuGQ2-SXmuZhvZCkRx9luFf7VgKUCuszNlUswyA,197
78
85
  canns/pipeline/asa/app.py,sha256=L5al6PrGoEzRNosZlHbn-VaTxXCoVyfKFn0f1e-0FUI,49906
79
- canns/pipeline/asa/runner.py,sha256=Bq1uKEEtn-qzOnftpmQ1YCbDr_ygYFj98C1H2Oylkfo,45246
86
+ canns/pipeline/asa/runner.py,sha256=FFz1Sfk5ysyHgoXAl-TK100nA27plLcO7Z7xUZ0COd4,45398
80
87
  canns/pipeline/asa/screens.py,sha256=DbqidxmoKe4KzSLuxuriVv1PIVFn5Z-PfScVfjrIiEA,5954
81
88
  canns/pipeline/asa/state.py,sha256=XukidfcFIOmm9ttT226FOTYR5hv2VAY8_DZt7V1Ml2g,6955
82
89
  canns/pipeline/asa/styles.tcss,sha256=eaXI3rQeWdBYmWdLJMMiSO6acHtreLRVKKoIHb2-dBk,3349
83
90
  canns/pipeline/asa/widgets.py,sha256=3vPGGQWP9V5FwuwqykCVp7dzAHdpcFkDqib0DtIw-lQ,8087
84
- canns/pipeline/asa_gui/__init__.py,sha256=38gJUuQGfZ5gTJOJfYx8gJuy_bF69Qdpi1HNEYDKaH8,2250
91
+ canns/pipeline/asa_gui/__init__.py,sha256=FthSerbWbpOjwNp9z4c20mu1fcIvRnBiYzl5ALVh_NE,2280
85
92
  canns/pipeline/asa_gui/__main__.py,sha256=2UOQtIE5oXkcq9HcuY13M3Jk6-uaDu8A0VJfvr203ck,134
86
93
  canns/pipeline/asa_gui/app.py,sha256=Wd-tVGNPE1mQ0S9bET-cyjfj5UWsTIFFHOQRu0lngBs,833
87
94
  canns/pipeline/asa_gui/main_window.py,sha256=kQp8DTmp7SuYVCglh5lVja7DyQ7hAOxPgCEUmjKHgbk,7019
@@ -94,14 +101,14 @@ canns/pipeline/asa_gui/analysis_modes/decode_mode.py,sha256=uEe3lfWAA0pqmCXzNpaA
94
101
  canns/pipeline/asa_gui/analysis_modes/fr_mode.py,sha256=xzx1RhGVDbx6huEtEHGfUqWgRN_C6Sf-Ycj9BzIgTRY,3961
95
102
  canns/pipeline/asa_gui/analysis_modes/frm_mode.py,sha256=8rgh_P7dxYJfx2TxrhD00Ja6tK0q6NboqwZ7n0Sw_2U,3992
96
103
  canns/pipeline/asa_gui/analysis_modes/gridscore_mode.py,sha256=XC-O2lMx3NPxUkSoZo_69g7B_yFAYUnKIPKLj9-gKM4,5712
97
- canns/pipeline/asa_gui/analysis_modes/pathcompare_mode.py,sha256=oRZPB8y7ORDFDPk99joRNQRj_e5qmR-GuJHrGnSynS4,10808
104
+ canns/pipeline/asa_gui/analysis_modes/pathcompare_mode.py,sha256=d3R19eHz44z2YP3UFUNcQFDJGg0qp3Giv_7uWGCMzAo,10838
98
105
  canns/pipeline/asa_gui/analysis_modes/tda_mode.py,sha256=xnsWv_zfstzYPf_nLbQkCNHxxhYRznz4m-73ClaBQKs,6094
99
106
  canns/pipeline/asa_gui/controllers/__init__.py,sha256=RuQz960T4kEuQsBI_cjS0cQgFyqAdblLXy_dDoLPbTE,198
100
107
  canns/pipeline/asa_gui/controllers/analysis_controller.py,sha256=8cKs-RYHh_NflP7xeS0u0_y9WsZ268H1Wyp-wHZC97I,1769
101
108
  canns/pipeline/asa_gui/controllers/preprocess_controller.py,sha256=uNZifNGadYPxAVyWnfonOs5pwCgxwB1nrBGqvv8Y3hU,2825
102
109
  canns/pipeline/asa_gui/core/__init__.py,sha256=vfJVs5T999vh04Fi98kRLjD8AkbqpIGxmRiUhaxCNYY,371
103
110
  canns/pipeline/asa_gui/core/cache.py,sha256=qAg9Su_T1xIR5j8DK9KzwSdCGs0lKtMaZKr0Lhcj0KU,327
104
- canns/pipeline/asa_gui/core/runner.py,sha256=6Gz9ptWhVrUfsxW0EkyrSjilEj5GjyajhJ08RU8wye8,74509
111
+ canns/pipeline/asa_gui/core/runner.py,sha256=PgD4WHxKDo9Nos-djo98DRcYKNB0sdgrc41WjtxG6TE,74693
105
112
  canns/pipeline/asa_gui/core/state.py,sha256=hjv8NrgROlACgjm5VZtQL58_podJFWS2sLHi5YiVLJY,10148
106
113
  canns/pipeline/asa_gui/core/worker.py,sha256=ig6fwcMLNR6N3oSX3LW-bJdXm3Hol29iAVX9pU6KWSc,7778
107
114
  canns/pipeline/asa_gui/models/__init__.py,sha256=Pr5wfeu_iA8bh2ob9tfWQcWmzWydYjMwups29R6c8-U,217
@@ -122,7 +129,7 @@ canns/pipeline/asa_gui/views/__init__.py,sha256=ThoLlMw7bKxA7lkv_AvIR1mbpaoM0vkI
122
129
  canns/pipeline/asa_gui/views/help_content.py,sha256=kL7MSwc9v3gHLz86Apiy64xbwymt9r7sPEjz5ka6EB0,8452
123
130
  canns/pipeline/asa_gui/views/pages/__init__.py,sha256=xB7VTY_hKfoCNMGeWZbV3gHG9ErrzmwqW30UlUkbqgE,161
124
131
  canns/pipeline/asa_gui/views/pages/analysis_page.py,sha256=X6PGW_cgvAiNFqUpsS2TuVWl258Q6Q90C9NEQT1TetQ,22807
125
- canns/pipeline/asa_gui/views/pages/preprocess_page.py,sha256=AHWidQqNKF0TBx8i2dDmPfxjT4Qy45_FjBYh-O1zB8E,31364
132
+ canns/pipeline/asa_gui/views/pages/preprocess_page.py,sha256=QNKLCL5y_nmmdYUh6GiDI12-sBXYU_z3OpU9ovZ-DXc,31303
126
133
  canns/pipeline/asa_gui/views/panels/__init__.py,sha256=Spqmc0Sjh38cgr42gszmiogZQFFOLN1yL7ekSpVJCrE,36
127
134
  canns/pipeline/asa_gui/views/widgets/__init__.py,sha256=xaTYXw99OL8ye1cpfoKgSwqC7c2B6lrLLsYHRB16m64,481
128
135
  canns/pipeline/asa_gui/views/widgets/artifacts_tab.py,sha256=U_fuOCfSmkDhx3G97aod-8UPSIFVz_MrsU4b_ik_5qE,1431
@@ -158,8 +165,8 @@ canns/trainer/utils.py,sha256=ZdoLiRqFLfKXsWi0KX3wGUp0OqFikwiou8dPf3xvFhE,2847
158
165
  canns/typing/__init__.py,sha256=mXySdfmD8fA56WqZTb1Nj-ZovcejwLzNjuk6PRfTwmA,156
159
166
  canns/utils/__init__.py,sha256=OMyZ5jqZAIUS2Jr0qcnvvrx6YM-BZ1EJy5uZYeA3HC0,366
160
167
  canns/utils/benchmark.py,sha256=oJ7nvbvnQMh4_MZh7z160NPLp-197X0rEnmnLHYlev4,1361
161
- canns-0.14.3.dist-info/METADATA,sha256=UMyUaYFYtHoS60udBftAohcR0mIxJygdyUXyVdxfK18,9799
162
- canns-0.14.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
163
- canns-0.14.3.dist-info/entry_points.txt,sha256=57YF2HZp_BG3GeGB8L0m3wR1sSfNyMXF1q4CKEjce6U,164
164
- canns-0.14.3.dist-info/licenses/LICENSE,sha256=u6NJ1N-QSnf5yTwSk5UvFAdU2yKD0jxG0Xa91n1cPO4,11306
165
- canns-0.14.3.dist-info/RECORD,,
168
+ canns-0.15.1.dist-info/METADATA,sha256=Rxhq9ndM1JJjHYGYaB_BjffkvlLXO-22xIzwzOm8h1I,9799
169
+ canns-0.15.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
170
+ canns-0.15.1.dist-info/entry_points.txt,sha256=57YF2HZp_BG3GeGB8L0m3wR1sSfNyMXF1q4CKEjce6U,164
171
+ canns-0.15.1.dist-info/licenses/LICENSE,sha256=u6NJ1N-QSnf5yTwSk5UvFAdU2yKD0jxG0Xa91n1cPO4,11306
172
+ canns-0.15.1.dist-info/RECORD,,
@@ -1,208 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import numbers
4
-
5
- import numpy as np
6
- from numpy.exceptions import AxisError
7
- from scipy.ndimage import _nd_image, _ni_support
8
- from scipy.ndimage._filters import _invalid_origin
9
-
10
-
11
- def _gaussian_filter1d(
12
- input,
13
- sigma,
14
- axis=-1,
15
- order=0,
16
- output=None,
17
- mode="reflect",
18
- cval=0.0,
19
- truncate=4.0,
20
- *,
21
- radius=None,
22
- ):
23
- """1-D Gaussian filter.
24
-
25
- Parameters
26
- ----------
27
- %(input)s
28
- sigma : scalar
29
- standard deviation for Gaussian kernel
30
- %(axis)s
31
- order : int, optional
32
- An order of 0 corresponds to convolution with a Gaussian
33
- kernel. A positive order corresponds to convolution with
34
- that derivative of a Gaussian.
35
- %(output)s
36
- %(mode_reflect)s
37
- %(cval)s
38
- truncate : float, optional
39
- Truncate the filter at this many standard deviations.
40
- Default is 4.0.
41
- radius : None or int, optional
42
- Radius of the Gaussian kernel. If specified, the size of
43
- the kernel will be ``2*radius + 1``, and `truncate` is ignored.
44
- Default is None.
45
-
46
- Returns
47
- -------
48
- gaussian_filter1d : ndarray
49
-
50
- Notes
51
- -----
52
- The Gaussian kernel will have size ``2*radius + 1`` along each axis. If
53
- `radius` is None, a default ``radius = round(truncate * sigma)`` will be
54
- used.
55
-
56
- Examples
57
- --------
58
- >>> from scipy.ndimage import gaussian_filter1d
59
- >>> import numpy as np
60
- >>> gaussian_filter1d([1.0, 2.0, 3.0, 4.0, 5.0], 1)
61
- array([ 1.42704095, 2.06782203, 3. , 3.93217797, 4.57295905])
62
- >>> _gaussian_filter1d([1.0, 2.0, 3.0, 4.0, 5.0], 4)
63
- array([ 2.91948343, 2.95023502, 3. , 3.04976498, 3.08051657])
64
- >>> import matplotlib.pyplot as plt
65
- >>> rng = np.random.default_rng()
66
- >>> x = rng.standard_normal(101).cumsum()
67
- >>> y3 = _gaussian_filter1d(x, 3)
68
- >>> y6 = _gaussian_filter1d(x, 6)
69
- >>> plt.plot(x, 'k', label='original data')
70
- >>> plt.plot(y3, '--', label='filtered, sigma=3')
71
- >>> plt.plot(y6, ':', label='filtered, sigma=6')
72
- >>> plt.legend()
73
- >>> plt.grid()
74
- >>> plt.show()
75
-
76
- """
77
- sd = float(sigma)
78
- # make the radius of the filter equal to truncate standard deviations
79
- lw = int(truncate * sd + 0.5)
80
- if radius is not None:
81
- lw = radius
82
- if not isinstance(lw, numbers.Integral) or lw < 0:
83
- raise ValueError("Radius must be a nonnegative integer.")
84
- # Since we are calling correlate, not convolve, revert the kernel
85
- weights = _gaussian_kernel1d(sigma, order, lw)[::-1]
86
- return _correlate1d(input, weights, axis, output, mode, cval, 0)
87
-
88
-
89
- def _gaussian_kernel1d(sigma, order, radius):
90
- """
91
- Computes a 1-D Gaussian convolution kernel.
92
- """
93
- if order < 0:
94
- raise ValueError("order must be non-negative")
95
- exponent_range = np.arange(order + 1)
96
- sigma2 = sigma * sigma
97
- x = np.arange(-radius, radius + 1)
98
- phi_x = np.exp(-0.5 / sigma2 * x**2)
99
- phi_x = phi_x / phi_x.sum()
100
-
101
- if order == 0:
102
- return phi_x
103
- else:
104
- # f(x) = q(x) * phi(x) = q(x) * exp(p(x))
105
- # f'(x) = (q'(x) + q(x) * p'(x)) * phi(x)
106
- # p'(x) = -1 / sigma ** 2
107
- # Implement q'(x) + q(x) * p'(x) as a matrix operator and apply to the
108
- # coefficients of q(x)
109
- q = np.zeros(order + 1)
110
- q[0] = 1
111
- D = np.diag(exponent_range[1:], 1) # D @ q(x) = q'(x)
112
- P = np.diag(np.ones(order) / -sigma2, -1) # P @ q(x) = q(x) * p'(x)
113
- Q_deriv = D + P
114
- for _ in range(order):
115
- q = Q_deriv.dot(q)
116
- q = (x[:, None] ** exponent_range).dot(q)
117
- return q * phi_x
118
-
119
-
120
- def _correlate1d(input, weights, axis=-1, output=None, mode="reflect", cval=0.0, origin=0):
121
- """Calculate a 1-D correlation along the given axis.
122
-
123
- The lines of the array along the given axis are correlated with the
124
- given weights.
125
-
126
- Parameters
127
- ----------
128
- %(input)s
129
- weights : array
130
- 1-D sequence of numbers.
131
- %(axis)s
132
- %(output)s
133
- %(mode_reflect)s
134
- %(cval)s
135
- %(origin)s
136
-
137
- Returns
138
- -------
139
- result : ndarray
140
- Correlation result. Has the same shape as `input`.
141
-
142
- Examples
143
- --------
144
- >>> from scipy.ndimage import correlate1d
145
- >>> correlate1d([2, 8, 0, 4, 1, 9, 9, 0], weights=[1, 3])
146
- array([ 8, 26, 8, 12, 7, 28, 36, 9])
147
- """
148
- input = np.asarray(input)
149
- weights = np.asarray(weights)
150
- complex_input = input.dtype.kind == "c"
151
- complex_weights = weights.dtype.kind == "c"
152
- if complex_input or complex_weights:
153
- if complex_weights:
154
- weights = weights.conj()
155
- weights = weights.astype(np.complex128, copy=False)
156
- kwargs = dict(axis=axis, mode=mode, origin=origin)
157
- output = _ni_support._get_output(output, input, complex_output=True)
158
- return _complex_via_real_components(_correlate1d, input, weights, output, cval, **kwargs)
159
-
160
- output = _ni_support._get_output(output, input)
161
- weights = np.asarray(weights, dtype=np.float64)
162
- if weights.ndim != 1 or weights.shape[0] < 1:
163
- raise RuntimeError("no filter weights given")
164
- if not weights.flags.contiguous:
165
- weights = weights.copy()
166
- axis = _normalize_axis_index(axis, input.ndim)
167
- if _invalid_origin(origin, len(weights)):
168
- raise ValueError(
169
- "Invalid origin; origin must satisfy "
170
- "-(len(weights) // 2) <= origin <= "
171
- "(len(weights)-1) // 2"
172
- )
173
- mode = _ni_support._extend_mode_to_code(mode)
174
- _nd_image.correlate1d(input, weights, axis, output, mode, cval, origin)
175
- return output
176
-
177
-
178
- def _complex_via_real_components(func, input, weights, output, cval, **kwargs):
179
- """Complex convolution via a linear combination of real convolutions."""
180
- complex_input = input.dtype.kind == "c"
181
- complex_weights = weights.dtype.kind == "c"
182
- if complex_input and complex_weights:
183
- # real component of the output
184
- func(input.real, weights.real, output=output.real, cval=np.real(cval), **kwargs)
185
- output.real -= func(input.imag, weights.imag, output=None, cval=np.imag(cval), **kwargs)
186
- # imaginary component of the output
187
- func(input.real, weights.imag, output=output.imag, cval=np.real(cval), **kwargs)
188
- output.imag += func(input.imag, weights.real, output=None, cval=np.imag(cval), **kwargs)
189
- elif complex_input:
190
- func(input.real, weights, output=output.real, cval=np.real(cval), **kwargs)
191
- func(input.imag, weights, output=output.imag, cval=np.imag(cval), **kwargs)
192
- else:
193
- if np.iscomplexobj(cval):
194
- raise ValueError("Cannot provide a complex-valued cval when the input is real.")
195
- func(input, weights.real, output=output.real, cval=cval, **kwargs)
196
- func(input, weights.imag, output=output.imag, cval=cval, **kwargs)
197
- return output
198
-
199
-
200
- def _normalize_axis_index(axis, ndim):
201
- # Check if `axis` is in the correct range and normalize it
202
- if axis < -ndim or axis >= ndim:
203
- msg = f"axis {axis} is out of bounds for array of dimension {ndim}"
204
- raise AxisError(msg)
205
-
206
- if axis < 0:
207
- axis = axis + ndim
208
- return axis
File without changes