rapidtide 3.0a8__py3-none-any.whl → 3.0a9__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.
@@ -23,6 +23,7 @@ A simple GUI for looking at the results of a rapidtide analysis
23
23
  import argparse
24
24
  import os
25
25
  import sys
26
+ from functools import partial
26
27
 
27
28
  import numpy as np
28
29
  import pandas as pd
@@ -35,7 +36,7 @@ import rapidtide.util as tide_util
35
36
  from rapidtide.Colortables import *
36
37
  from rapidtide.helper_classes import SimilarityFunctionFitter
37
38
  from rapidtide.OrthoImageItem import OrthoImageItem
38
- from rapidtide.RapidtideDataset import RapidtideDataset
39
+ from rapidtide.RapidtideDataset import RapidtideDataset, check_rt_spatialmatch
39
40
  from rapidtide.workflows.atlasaverage import summarizevoxels
40
41
 
41
42
  try:
@@ -103,11 +104,12 @@ def _get_parser():
103
104
  "--maskname", help="Set geometric mask image", dest="geommaskname", default=None
104
105
  )
105
106
  parser.add_argument(
106
- "--oldstyle",
107
- help="Use the old style layout",
108
- dest="compact",
109
- action="store_false",
110
- default=True,
107
+ "--uistyle",
108
+ action="store",
109
+ type=str,
110
+ choices=["normal", "old", "big"],
111
+ help="Set the window layout style. Default is 'normal'.",
112
+ default="normal",
111
113
  )
112
114
  parser.add_argument(
113
115
  "--verbosity",
@@ -115,7 +117,14 @@ def _get_parser():
115
117
  dest="verbose",
116
118
  metavar="VERBOSITY",
117
119
  type=int,
118
- default=1,
120
+ default=0,
121
+ )
122
+ parser.add_argument(
123
+ "--ignoredimmatch",
124
+ help="Do not check to see if dataset sizes match",
125
+ dest="ignoredimmatch",
126
+ action="store_true",
127
+ default=False,
119
128
  )
120
129
 
121
130
  return parser
@@ -460,24 +469,52 @@ class xyztlocation(QtWidgets.QWidget):
460
469
  self.movieTimer.start(int(self.frametime))
461
470
 
462
471
 
463
- class KeyPressWindow(QtWidgets.QMainWindow):
472
+ """class KeyPressWindow(QtWidgets.QMainWindow):
464
473
  sigKeyPress = QtCore.pyqtSignal(object)
465
474
 
466
475
  def __init__(self, *args, **kwargs):
467
476
  super().__init__(*args, **kwargs)
468
477
 
469
478
  def keyPressEvent(self, ev):
470
- self.sigKeyPress.emit(ev)
479
+ self.sigKeyPress.emit(ev)"""
471
480
 
472
481
 
473
- def keyPressed(evt):
482
+ def nextFileButtonPressed():
483
+ global currentdataset, thesubjects, whichsubject
484
+ global defaultdict, overlayGraphicsViews
485
+ numsubjects = len(thesubjects)
486
+ whichsubject = (whichsubject + 1) % numsubjects
487
+ print(f"subject number set to {whichsubject}")
488
+ thesubjects[whichsubject].setfocusregressor(currentdataset.focusregressor)
489
+ thesubjects[whichsubject].setfocusmap(currentdataset.focusmap)
490
+ currentdataset = thesubjects[whichsubject]
491
+ activatedataset(
492
+ currentdataset,
493
+ ui,
494
+ win,
495
+ defaultdict,
496
+ overlayGraphicsViews,
497
+ verbosity=verbosity,
498
+ doinit=False,
499
+ )
500
+ updateRegressor()
501
+ updateRegressorSpectrum()
502
+ updateUI(
503
+ callingfunc="nextFileButtonPressed",
504
+ orthoimages=True,
505
+ histogram=True,
506
+ focusvals=True,
507
+ )
508
+
509
+
510
+ """def keyPressed(evt):
474
511
  global currentsubject, thesubjects, whichsubject
475
512
  global defaultdict, overlayGraphicsViews
476
513
  numsubjects = len(thesubjects)
477
- if evt.key() == QtCore.Qt.Key.Key_Up:
514
+ if evt.key() == QtCore.Qt.Key.Key_F:
478
515
  whichsubject = (whichsubject + 1) % numsubjects
479
516
  print("Key_Up")
480
- elif evt.key() == QtCore.Qt.Key.Key_Down:
517
+ elif evt.key() == QtCore.Qt.Key.Key_B:
481
518
  whichsubject = (whichsubject - 1) % numsubjects
482
519
  print("Key_Down")
483
520
  elif evt.key() == QtCore.Qt.Key.Key_Left:
@@ -490,7 +527,7 @@ def keyPressed(evt):
490
527
  print(evt.key())
491
528
  print(f"subject number set to {whichsubject}")
492
529
  currentdataset = thesubjects[whichsubject]
493
- """activatedataset(
530
+ activatedataset(
494
531
  currentdataset,
495
532
  ui,
496
533
  win,
@@ -498,7 +535,8 @@ def keyPressed(evt):
498
535
  overlayGraphicsViews,
499
536
  verbosity=verbosity,
500
537
  doinit=False,
501
- )"""
538
+ )
539
+ updateOrthoImages()"""
502
540
 
503
541
 
504
542
  def logstatus(thetextbox, thetext):
@@ -707,6 +745,8 @@ def updateRegressor():
707
745
  size = [upperlim - lowerlim, tctop - tcbottom]
708
746
  therectangle = RectangleItem(bottomleft, size)
709
747
  regressor_ax.addItem(therectangle)
748
+ else:
749
+ print("currentdataset.focusregressor is None!")
710
750
 
711
751
 
712
752
  def updateRegressorSpectrum():
@@ -994,178 +1034,53 @@ def rainbow_radioButton_clicked(enabled):
994
1034
  updateLUT()
995
1035
 
996
1036
 
997
- def set_atlasmask():
998
- global overlays, loadedfuncmaps, ui, currentdataset
999
- print("Using all defined atlas regions as functional mask")
1000
- ui.setMask_Button.setText("Valid mask")
1001
- for themap in currentdataset.loadedfuncmaps:
1002
- overlays[themap].setFuncMask(overlays["atlasmask"].data)
1003
- updateUI(callingfunc="set_atlasmask", orthoimages=True, histogram=True)
1004
-
1005
-
1006
- def set_lagmask():
1037
+ def set_mask(maskname):
1007
1038
  global overlays, loadedfuncmaps, ui, atlasaveragingdone, currentdataset
1008
- print("Using valid fit points as functional mask")
1009
- ui.setMask_Button.setText("Valid mask")
1010
- for themap in currentdataset.loadedfuncmaps:
1011
- overlays[themap].setFuncMask(overlays["lagmask"].data)
1012
- atlasaveragingdone = False
1013
- updateAveragingMode()
1014
- updateUI(callingfunc="set_lagmask()", orthoimages=True, histogram=True)
1015
-
1016
-
1017
- def set_refinemask():
1018
- global overlays, loadedfuncmaps, ui, atlasaveragingdone, currentdataset
1019
- print("Voxel refinement mask")
1020
- ui.setMask_Button.setText("Refine mask")
1021
- for themap in currentdataset.loadedfuncmaps:
1022
- overlays[themap].setFuncMask(overlays["refinemask"].data)
1023
- atlasaveragingdone = False
1024
- updateAveragingMode()
1025
- updateUI(callingfunc="set_refinemask", orthoimages=True, histogram=True)
1026
-
1027
-
1028
- def set_meanmask():
1029
- global overlays, loadedfuncmaps, ui, atlasaveragingdone, currentdataset
1030
- print("Mean regressor seed mask")
1031
- ui.setMask_Button.setText("Mean mask")
1032
- for themap in currentdataset.loadedfuncmaps:
1033
- overlays[themap].setFuncMask(overlays["meanmask"].data)
1034
- atlasaveragingdone = False
1035
- updateAveragingMode()
1036
- updateUI(callingfunc="set_meanmask", orthoimages=True, histogram=True)
1037
-
1038
-
1039
- def set_preselectmask():
1040
- global overlays, loadedfuncmaps, ui, atlasaveragingdone, currentdataset
1041
- print("Preselected mean regressor seed mask")
1042
- ui.setMask_Button.setText("Preselect mask")
1043
- for themap in currentdataset.loadedfuncmaps:
1044
- overlays[themap].setFuncMask(overlays["preselectmask"].data)
1045
- atlasaveragingdone = False
1046
- updateAveragingMode()
1047
- updateUI(callingfunc="set_preselectmask", orthoimages=True, histogram=True)
1048
-
1049
-
1050
- def set_nomask():
1051
- global overlays, loadedfuncmaps, ui, atlasaveragingdone, currentdataset
1052
- print("disabling functional mask")
1053
- ui.setMask_Button.setText("No Mask")
1054
- for themap in currentdataset.loadedfuncmaps:
1055
- overlays[themap].setFuncMask(None)
1056
- atlasaveragingdone = False
1057
- updateAveragingMode()
1058
- updateUI(callingfunc="set_nomask", orthoimages=True, histogram=True)
1059
-
1060
-
1061
- def set_0p05():
1062
- global overlays, loadedfuncmaps, ui, atlasaveragingdone, currentdataset
1063
- print("setting functional mask to p<0.05")
1064
- ui.setMask_Button.setText("p<0.05")
1065
- # overlays['jit_mask'] = tide_stats.makepmask(overlays['lagstrengths'], 0.05, sighistfit, onesided=True)
1066
- for themap in currentdataset.loadedfuncmaps:
1067
- overlays[themap].setFuncMask(overlays["p_lt_0p050_mask"].data)
1068
- # overlays[themap].setFuncMask(overlays['jit_mask'].data)
1069
- atlasaveragingdone = False
1070
- updateAveragingMode()
1071
- updateUI(callingfunc="set_0p05", orthoimages=True, histogram=True)
1072
-
1073
-
1074
- def set_0p01():
1075
- global overlays, loadedfuncmaps, ui, atlasaveragingdone, currentdataset
1076
- print("setting functional mask to p<0.01")
1077
- ui.setMask_Button.setText("p<0.01")
1078
- for themap in currentdataset.loadedfuncmaps:
1079
- overlays[themap].setFuncMask(overlays["p_lt_0p010_mask"].data)
1080
- atlasaveragingdone = False
1081
- updateAveragingMode()
1082
- updateUI(callingfunc="set_0p01", orthoimages=True, histogram=True)
1083
-
1084
-
1085
- def set_0p005():
1086
- global overlays, loadedfuncmaps, ui, atlasaveragingdone, currentdataset
1087
- print("setting functional mask to p<0.005")
1088
- ui.setMask_Button.setText("p<0.005")
1039
+ maskinfodicts = {}
1040
+ maskinfodicts["nomask"] = {
1041
+ "msg": "Disabling functional mask",
1042
+ "label": "No mask",
1043
+ }
1044
+ maskinfodicts["meanmask"] = {
1045
+ "msg": "Mean regressor seed mask",
1046
+ "label": "Mean mask",
1047
+ }
1048
+ maskinfodicts["lagmask"] = {
1049
+ "msg": "Using valid fit points as functional mask",
1050
+ "label": "Valid mask",
1051
+ }
1052
+ maskinfodicts["refinemask"] = {
1053
+ "msg": "Voxel refinement mask",
1054
+ "label": "Refine mask",
1055
+ }
1056
+ maskinfodicts["preselectmask"] = {
1057
+ "msg": "Preselected mean regressor seed mask",
1058
+ "label": "Preselect mask",
1059
+ }
1060
+ for pval in [0.05, 0.01, 0.005, 0.001]:
1061
+ maskinfodicts[f"p_lt_{(str(pval) + '0').replace('.','p')[0:5]}_mask"] = {
1062
+ "msg": f"Setting functional mask to p<{str(pval)}",
1063
+ "label": f"p<{str(pval)}",
1064
+ }
1065
+ print(maskinfodicts[maskname]["msg"])
1066
+ ui.setMask_Button.setText(maskinfodicts[maskname]["label"])
1089
1067
  for themap in currentdataset.loadedfuncmaps:
1090
- overlays[themap].setFuncMask(overlays["p_lt_0p005_mask"].data)
1068
+ if maskname == "nomask":
1069
+ overlays[themap].setFuncMask(None)
1070
+ else:
1071
+ overlays[themap].setFuncMask(overlays[maskname].data)
1091
1072
  atlasaveragingdone = False
1092
1073
  updateAveragingMode()
1093
- updateUI(callingfunc="set_0p005", orthoimages=True, histogram=True)
1074
+ updateUI(callingfunc=f"set_mask({maskname})", orthoimages=True, histogram=True)
1094
1075
 
1095
1076
 
1096
- def set_0p001():
1097
- global overlays, loadedfuncmaps, ui, atlasaveragingdone, currentdataset
1098
- print("setting functional mask to p<0.001")
1099
- ui.setMask_Button.setText("p<0.001")
1077
+ def set_atlasmask():
1078
+ global overlays, loadedfuncmaps, ui, currentdataset
1079
+ print("Using all defined atlas regions as functional mask")
1080
+ ui.setMask_Button.setText("Valid mask")
1100
1081
  for themap in currentdataset.loadedfuncmaps:
1101
- overlays[themap].setFuncMask(overlays["p_lt_0p001_mask"].data)
1102
- atlasaveragingdone = False
1103
- updateAveragingMode()
1104
- updateUI(callingfunc="set_0p001", orthoimages=True, histogram=True)
1105
-
1106
-
1107
- def overlay_radioButton_01_clicked(enabled):
1108
- overlay_radioButton_clicked(0, enabled)
1109
-
1110
-
1111
- def overlay_radioButton_02_clicked(enabled):
1112
- overlay_radioButton_clicked(1, enabled)
1113
-
1114
-
1115
- def overlay_radioButton_03_clicked(enabled):
1116
- overlay_radioButton_clicked(2, enabled)
1117
-
1118
-
1119
- def overlay_radioButton_04_clicked(enabled):
1120
- overlay_radioButton_clicked(3, enabled)
1121
-
1122
-
1123
- def overlay_radioButton_05_clicked(enabled):
1124
- overlay_radioButton_clicked(4, enabled)
1125
-
1126
-
1127
- def overlay_radioButton_06_clicked(enabled):
1128
- overlay_radioButton_clicked(5, enabled)
1129
-
1130
-
1131
- def overlay_radioButton_07_clicked(enabled):
1132
- overlay_radioButton_clicked(6, enabled)
1133
-
1134
-
1135
- def overlay_radioButton_08_clicked(enabled):
1136
- overlay_radioButton_clicked(7, enabled)
1137
-
1138
-
1139
- def overlay_radioButton_09_clicked(enabled):
1140
- overlay_radioButton_clicked(8, enabled)
1141
-
1142
-
1143
- def overlay_radioButton_10_clicked(enabled):
1144
- overlay_radioButton_clicked(9, enabled)
1145
-
1146
-
1147
- def overlay_radioButton_11_clicked(enabled):
1148
- overlay_radioButton_clicked(10, enabled)
1149
-
1150
-
1151
- def overlay_radioButton_12_clicked(enabled):
1152
- overlay_radioButton_clicked(11, enabled)
1153
-
1154
-
1155
- def overlay_radioButton_13_clicked(enabled):
1156
- overlay_radioButton_clicked(12, enabled)
1157
-
1158
-
1159
- def overlay_radioButton_14_clicked(enabled):
1160
- overlay_radioButton_clicked(13, enabled)
1161
-
1162
-
1163
- def overlay_radioButton_15_clicked(enabled):
1164
- overlay_radioButton_clicked(14, enabled)
1165
-
1166
-
1167
- def overlay_radioButton_16_clicked(enabled):
1168
- overlay_radioButton_clicked(15, enabled)
1082
+ overlays[themap].setFuncMask(overlays["atlasmask"].data)
1083
+ updateUI(callingfunc="set_atlasmask", orthoimages=True, histogram=True)
1169
1084
 
1170
1085
 
1171
1086
  def overlay_radioButton_clicked(which, enabled):
@@ -1404,44 +1319,9 @@ def printfocusvals():
1404
1319
  logstatus(ui.logOutput, outstring)
1405
1320
 
1406
1321
 
1407
- def prefilt_radioButton_clicked(enabled):
1408
- global currentdataset
1409
- currentdataset.setfocusregressor("prefilt")
1410
- updateRegressor()
1411
- updateRegressorSpectrum()
1412
-
1413
-
1414
- def postfilt_radioButton_clicked(enabled):
1415
- global currentdataset
1416
- currentdataset.setfocusregressor("postfilt")
1417
- updateRegressor()
1418
- updateRegressorSpectrum()
1419
-
1420
-
1421
- def pass1_radioButton_clicked(enabled):
1422
- global currentdataset
1423
- currentdataset.setfocusregressor("pass1")
1424
- updateRegressor()
1425
- updateRegressorSpectrum()
1426
-
1427
-
1428
- def pass2_radioButton_clicked(enabled):
1429
- global currentdataset
1430
- currentdataset.setfocusregressor("pass2")
1431
- updateRegressor()
1432
- updateRegressorSpectrum()
1433
-
1434
-
1435
- def pass3_radioButton_clicked(enabled):
1436
- global currentdataset
1437
- currentdataset.setfocusregressor("pass3")
1438
- updateRegressor()
1439
- updateRegressorSpectrum()
1440
-
1441
-
1442
- def pass4_radioButton_clicked(enabled):
1322
+ def regressor_radioButton_clicked(theregressor, enabled):
1443
1323
  global currentdataset
1444
- currentdataset.setfocusregressor("pass4")
1324
+ currentdataset.setfocusregressor(theregressor)
1445
1325
  updateRegressor()
1446
1326
  updateRegressorSpectrum()
1447
1327
 
@@ -1456,10 +1336,12 @@ def activatedataset(
1456
1336
  global usecorrout
1457
1337
  global orthoimagedict
1458
1338
 
1459
- print("getting regressors")
1339
+ if verbosity > 1:
1340
+ print("getting regressors")
1460
1341
  regressors = currentdataset.getregressors()
1461
1342
 
1462
- print("getting overlays")
1343
+ if verbosity > 1:
1344
+ print("getting overlays")
1463
1345
  overlays = currentdataset.getoverlays()
1464
1346
  try:
1465
1347
  test = overlays["corrout"].display_state
@@ -1467,7 +1349,8 @@ def activatedataset(
1467
1349
  usecorrout = False
1468
1350
 
1469
1351
  # activate the appropriate regressor radio buttons
1470
- print("activating radio buttons")
1352
+ if verbosity > 1:
1353
+ print("activating radio buttons")
1471
1354
  if "prefilt" in regressors.keys():
1472
1355
  ui.prefilt_radioButton.setDisabled(False)
1473
1356
  ui.prefilt_radioButton.show()
@@ -1530,7 +1413,8 @@ def activatedataset(
1530
1413
  bgmap = None
1531
1414
 
1532
1415
  # set up the timecourse plot window
1533
- print("setting up timecourse plot window")
1416
+ if verbosity > 1:
1417
+ print("setting up timecourse plot window")
1534
1418
  xpos = int(currentdataset.xdim) // 2
1535
1419
  ypos = int(currentdataset.ydim) // 2
1536
1420
  zpos = int(currentdataset.zdim) // 2
@@ -1557,7 +1441,8 @@ def activatedataset(
1557
1441
  tpos = 0
1558
1442
 
1559
1443
  # set position and scale of images
1560
- print("setting position and scale of images")
1444
+ if verbosity > 1:
1445
+ print("setting position and scale of images")
1561
1446
  lg_imgsize = 256.0
1562
1447
  sm_imgsize = 32.0
1563
1448
  xfov = currentdataset.xdim * currentdataset.xsize
@@ -1692,7 +1577,12 @@ def activatedataset(
1692
1577
  if verbosity > 1:
1693
1578
  print("not loading map ", themap, "(", idx, "): display_state is False")
1694
1579
  else:
1695
- print(orthoimagedict)
1580
+ for thismap in panetomap:
1581
+ if thismap != "":
1582
+ try:
1583
+ orthoimagedict[thismap].setMap(overlays[thismap])
1584
+ except KeyError:
1585
+ pass
1696
1586
  if verbosity > 1:
1697
1587
  print("done loading panes")
1698
1588
  if numnotloaded > 0:
@@ -1738,7 +1628,7 @@ def tidepool(args):
1738
1628
  global vLine
1739
1629
  global ui, win
1740
1630
  global movierunning
1741
- global focusmap, bgmap
1631
+ global focusmap, bgmap, focusregressor
1742
1632
  global maps
1743
1633
  global roi
1744
1634
  global overlays, regressors, regressorfilterlimits, regressorsimcalclimits, loadedfuncmaps, atlasstats, averagingmode
@@ -1783,13 +1673,17 @@ def tidepool(args):
1783
1673
  simfuncFitter = None
1784
1674
 
1785
1675
  if pyqtversion == 5:
1786
- if args.compact:
1676
+ if args.uistyle == "normal":
1787
1677
  import rapidtide.tidepoolTemplate_alt as uiTemplate
1678
+ elif args.uistyle == "big":
1679
+ import rapidtide.tidepoolTemplate_big as uiTemplate
1788
1680
  else:
1789
1681
  import rapidtide.tidepoolTemplate as uiTemplate
1790
1682
  else:
1791
- if args.compact:
1683
+ if args.uistyle == "normal":
1792
1684
  import rapidtide.tidepoolTemplate_alt_qt6 as uiTemplate
1685
+ elif args.uistyle == "big":
1686
+ import rapidtide.tidepoolTemplate_big_qt6 as uiTemplate
1793
1687
  else:
1794
1688
  import rapidtide.tidepoolTemplate_qt6 as uiTemplate
1795
1689
 
@@ -1835,9 +1729,9 @@ def tidepool(args):
1835
1729
  # make the main window
1836
1730
  app = QtWidgets.QApplication([])
1837
1731
  print("setting up output window")
1838
- win = KeyPressWindow()
1839
- win.sigKeyPress.connect(keyPressed)
1840
- # win = QtWidgets.QMainWindow()
1732
+ # win = KeyPressWindow()
1733
+ # win.sigKeyPress.connect(keyPressed)
1734
+ win = QtWidgets.QMainWindow()
1841
1735
  ui = uiTemplate.Ui_MainWindow()
1842
1736
  ui.setupUi(win)
1843
1737
  win.show()
@@ -2117,8 +2011,19 @@ def tidepool(args):
2117
2011
  ui.overlay_radioButton_07,
2118
2012
  ui.overlay_radioButton_08,
2119
2013
  ]
2014
+ if args.uistyle == "big":
2015
+ overlaybuttons += [
2016
+ ui.overlay_radioButton_09,
2017
+ ui.overlay_radioButton_10,
2018
+ ui.overlay_radioButton_11,
2019
+ ui.overlay_radioButton_12,
2020
+ ui.overlay_radioButton_13,
2021
+ ui.overlay_radioButton_14,
2022
+ ui.overlay_radioButton_15,
2023
+ ui.overlay_radioButton_16,
2024
+ ]
2120
2025
  for i in range(len(overlaybuttons)):
2121
- clickfunc = globals()[f"overlay_radioButton_{str(i + 1).zfill(2)}_clicked"]
2026
+ clickfunc = partial(overlay_radioButton_clicked, i)
2122
2027
  overlaybuttons[i].clicked.connect(clickfunc)
2123
2028
 
2124
2029
  for button in overlaybuttons:
@@ -2135,7 +2040,17 @@ def tidepool(args):
2135
2040
  ui.overlay_graphicsView_07,
2136
2041
  ui.overlay_graphicsView_08,
2137
2042
  ]
2138
-
2043
+ if args.uistyle == "big":
2044
+ overlayGraphicsViews += [
2045
+ ui.overlay_graphicsView_09,
2046
+ ui.overlay_graphicsView_10,
2047
+ ui.overlay_graphicsView_11,
2048
+ ui.overlay_graphicsView_12,
2049
+ ui.overlay_graphicsView_13,
2050
+ ui.overlay_graphicsView_14,
2051
+ ui.overlay_graphicsView_15,
2052
+ ui.overlay_graphicsView_16,
2053
+ ]
2139
2054
  panetomap = []
2140
2055
 
2141
2056
  for theview in overlayGraphicsViews:
@@ -2149,25 +2064,26 @@ def tidepool(args):
2149
2064
  else:
2150
2065
  qactionfunc = QtGui.QAction
2151
2066
  sel_nomask = qactionfunc("No mask", win)
2152
- sel_nomask.triggered.connect(set_nomask)
2153
2067
  sel_lagmask = qactionfunc("Valid fit", win)
2154
- sel_lagmask.triggered.connect(set_lagmask)
2155
2068
  sel_refinemask = qactionfunc("Voxels used in refine", win)
2156
2069
  sel_meanmask = qactionfunc("Voxels used in mean regressor calculation", win)
2157
2070
  sel_preselectmask = qactionfunc(
2158
2071
  "Voxels chosen for the mean regressor calculation in the preselect pass", win
2159
2072
  )
2160
- sel_refinemask.triggered.connect(set_refinemask)
2161
- sel_meanmask.triggered.connect(set_meanmask)
2162
- sel_preselectmask.triggered.connect(set_preselectmask)
2163
2073
  sel_0p05 = qactionfunc("p<0.05", win)
2164
- sel_0p05.triggered.connect(set_0p05)
2165
2074
  sel_0p01 = qactionfunc("p<0.01", win)
2166
- sel_0p01.triggered.connect(set_0p01)
2167
2075
  sel_0p005 = qactionfunc("p<0.005", win)
2168
- sel_0p005.triggered.connect(set_0p005)
2169
2076
  sel_0p001 = qactionfunc("p<0.001", win)
2170
- sel_0p001.triggered.connect(set_0p001)
2077
+
2078
+ sel_nomask.triggered.connect(partial(set_mask, "nomask"))
2079
+ sel_lagmask.triggered.connect(partial(set_mask, "lagmask"))
2080
+ sel_refinemask.triggered.connect(partial(set_mask, "refinemask"))
2081
+ sel_meanmask.triggered.connect(partial(set_mask, "meanmask"))
2082
+ sel_preselectmask.triggered.connect(partial(set_mask, "preselectmask"))
2083
+ sel_0p05.triggered.connect(partial(set_mask, "p_lt_0p050_mask"))
2084
+ sel_0p01.triggered.connect(partial(set_mask, "p_lt_0p010_mask"))
2085
+ sel_0p005.triggered.connect(partial(set_mask, "p_lt_0p005_mask"))
2086
+ sel_0p001.triggered.connect(partial(set_mask, "p_lt_0p001_mask"))
2171
2087
  popMenu.addAction(sel_nomask)
2172
2088
  numspecial = 0
2173
2089
 
@@ -2187,13 +2103,12 @@ def tidepool(args):
2187
2103
  ui.pass3_radioButton,
2188
2104
  ui.pass4_radioButton,
2189
2105
  ]
2190
-
2191
- ui.prefilt_radioButton.clicked.connect(prefilt_radioButton_clicked)
2192
- ui.postfilt_radioButton.clicked.connect(postfilt_radioButton_clicked)
2193
- ui.pass1_radioButton.clicked.connect(pass1_radioButton_clicked)
2194
- ui.pass2_radioButton.clicked.connect(pass2_radioButton_clicked)
2195
- ui.pass3_radioButton.clicked.connect(pass3_radioButton_clicked)
2196
- ui.pass4_radioButton.clicked.connect(pass4_radioButton_clicked)
2106
+ ui.prefilt_radioButton.clicked.connect(partial(regressor_radioButton_clicked, "prefilt"))
2107
+ ui.postfilt_radioButton.clicked.connect(partial(regressor_radioButton_clicked, "postfilt"))
2108
+ ui.pass1_radioButton.clicked.connect(partial(regressor_radioButton_clicked, "pass1"))
2109
+ ui.pass2_radioButton.clicked.connect(partial(regressor_radioButton_clicked, "pass2"))
2110
+ ui.pass3_radioButton.clicked.connect(partial(regressor_radioButton_clicked, "pass3"))
2111
+ ui.pass4_radioButton.clicked.connect(partial(regressor_radioButton_clicked, "pass4"))
2197
2112
 
2198
2113
  for thebutton in regressorbuttons:
2199
2114
  thebutton.setDisabled(True)
@@ -2220,8 +2135,15 @@ def tidepool(args):
2220
2135
  )
2221
2136
  if len(thesubjects) > 0:
2222
2137
  # check to see that the dimensions match
2223
- pass
2224
- thesubjects.append(thissubject)
2138
+ dimmatch, sizematch, spacematch, affinematch = check_rt_spatialmatch(
2139
+ thissubject, thesubjects[0]
2140
+ )
2141
+ if dimmatch or args.ignoredimmatch:
2142
+ thesubjects.append(thissubject)
2143
+ else:
2144
+ print(f"dataset {thisdatafileroot} does not match loaded data - skipping")
2145
+ else:
2146
+ thesubjects.append(thissubject)
2225
2147
  whichsubject = 0
2226
2148
  currentdataset = thesubjects[whichsubject]
2227
2149
  activatedataset(
@@ -2234,6 +2156,13 @@ def tidepool(args):
2234
2156
  doinit=True,
2235
2157
  )
2236
2158
 
2159
+ for thebutton in [ui.nextFile_Button]:
2160
+ if len(thesubjects) == 1:
2161
+ thebutton.setDisabled(True)
2162
+ thebutton.hide()
2163
+ else:
2164
+ thebutton.clicked.connect(nextFileButtonPressed)
2165
+
2237
2166
  # wire up the display range controls
2238
2167
  ui.resetDispLimits_Button.clicked.connect(resetDispLimits)
2239
2168
  ui.resetDispSmart_Button.clicked.connect(resetDispSmart)
@@ -2395,7 +2324,7 @@ def tidepool(args):
2395
2324
  # timecourse_ax.enableAutoRange()
2396
2325
 
2397
2326
  # select the first pane
2398
- overlay_radioButton_01_clicked(True)
2327
+ overlay_radioButton_clicked(0, True)
2399
2328
 
2400
2329
  # have to do this after the windows are created
2401
2330
  imageadj.sigGradientChanged.connect(updateLUT)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: rapidtide
3
- Version: 3.0a8
3
+ Version: 3.0a9
4
4
  Summary: Tools for performing correlation analysis on fMRI data.
5
5
  Author: Taylor Salo, Daniel M. Drucker, Ph.D., Jeffrey N Stout, Yaroslav O. Halchenko, Derek Monroe
6
6
  Author-email: "Blaise deB. Frederick" <blaise.frederick@gmail.com>