rapidtide 3.0a10__py3-none-any.whl → 3.0a12__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 (37) hide show
  1. rapidtide/Colortables.py +45 -10
  2. rapidtide/RapidtideDataset.py +21 -3
  3. rapidtide/Refiner.py +464 -0
  4. rapidtide/__init__.py +1 -2
  5. rapidtide/_version.py +63 -93
  6. rapidtide/data/examples/src/testfmri +3 -119
  7. rapidtide/data/examples/src/testhappy +1 -6
  8. rapidtide/data/examples/src/testinitdelay +19 -0
  9. rapidtide/data/examples/src/testnewrefine +49 -0
  10. rapidtide/data/examples/src/testrefineonly +22 -0
  11. rapidtide/glmpass.py +8 -1
  12. rapidtide/refinedelay.py +72 -32
  13. rapidtide/refineregressor.py +38 -24
  14. rapidtide/tests/test_fastresampler.py +6 -2
  15. rapidtide/tests/test_fullrunhappy_v1.py +0 -1
  16. rapidtide/tests/test_fullrunhappy_v4.py +1 -0
  17. rapidtide/tests/test_runmisc.py +4 -4
  18. rapidtide/tidepoolTemplate.py +1 -0
  19. rapidtide/tidepoolTemplate.ui +1 -0
  20. rapidtide/tidepoolTemplate_alt.py +5 -4
  21. rapidtide/tidepoolTemplate_alt.ui +3 -2
  22. rapidtide/tidepoolTemplate_alt_qt6.py +5 -4
  23. rapidtide/tidepoolTemplate_big.py +1 -0
  24. rapidtide/tidepoolTemplate_big.ui +1 -0
  25. rapidtide/tidepoolTemplate_big_qt6.py +1 -0
  26. rapidtide/tidepoolTemplate_qt6.py +1 -0
  27. rapidtide/workflows/parser_funcs.py +10 -2
  28. rapidtide/workflows/rapidtide.py +197 -325
  29. rapidtide/workflows/rapidtide_parser.py +35 -13
  30. rapidtide/workflows/retroglm.py +145 -60
  31. rapidtide/workflows/tidepool.py +34 -15
  32. {rapidtide-3.0a10.dist-info → rapidtide-3.0a12.dist-info}/METADATA +1 -1
  33. {rapidtide-3.0a10.dist-info → rapidtide-3.0a12.dist-info}/RECORD +37 -33
  34. {rapidtide-3.0a10.dist-info → rapidtide-3.0a12.dist-info}/WHEEL +1 -1
  35. {rapidtide-3.0a10.dist-info → rapidtide-3.0a12.dist-info}/LICENSE +0 -0
  36. {rapidtide-3.0a10.dist-info → rapidtide-3.0a12.dist-info}/entry_points.txt +0 -0
  37. {rapidtide-3.0a10.dist-info → rapidtide-3.0a12.dist-info}/top_level.txt +0 -0
rapidtide/refinedelay.py CHANGED
@@ -17,6 +17,7 @@
17
17
  #
18
18
  #
19
19
  import numpy as np
20
+ import numpy.polynomial.polynomial as poly
20
21
  from scipy.interpolate import CubicSpline, UnivariateSpline
21
22
  from scipy.ndimage import median_filter
22
23
  from statsmodels.robust import mad
@@ -25,7 +26,6 @@ import rapidtide.filter as tide_filt
25
26
  import rapidtide.io as tide_io
26
27
  import rapidtide.workflows.glmfrommaps as tide_glmfrommaps
27
28
 
28
-
29
29
  global ratiotooffsetfunc, maplimits
30
30
 
31
31
 
@@ -45,6 +45,7 @@ def trainratiotooffset(
45
45
  numpoints=501,
46
46
  smoothpts=3,
47
47
  edgepad=5,
48
+ glmderivs=1,
48
49
  debug=False,
49
50
  ):
50
51
  global ratiotooffsetfunc, maplimits
@@ -58,6 +59,7 @@ def trainratiotooffset(
58
59
  print("\tmaxdelay:", maxdelay)
59
60
  print("\tsmoothpts:", smoothpts)
60
61
  print("\tedgepad:", edgepad)
62
+ print("\tglmderivs:", glmderivs)
61
63
  print("\tlagtcgenerator:", lagtcgenerator)
62
64
  # make a delay map
63
65
  delaystep = (maxdelay - mindelay) / (numpoints - 1)
@@ -129,18 +131,32 @@ def trainratiotooffset(
129
131
  None,
130
132
  None,
131
133
  optiondict,
134
+ glmderivs=glmderivs,
132
135
  debug=debug,
133
136
  )
134
137
  if debug:
135
138
  print("before trimming")
136
139
  print(f"{glmderivratios.shape=}")
137
140
  print(f"{lagtimes.shape=}")
138
- smoothglmderivratios = tide_filt.unpadvec(
139
- smooth(tide_filt.padvec(glmderivratios, padlen=20, padtype="constant"), smoothpts),
140
- padlen=20,
141
- )
142
- glmderivratios = glmderivratios[edgepad:-edgepad]
143
- smoothglmderivratios = smoothglmderivratios[edgepad:-edgepad]
141
+ if glmderivs == 1:
142
+ smoothglmderivratios = tide_filt.unpadvec(
143
+ smooth(tide_filt.padvec(glmderivratios, padlen=20, padtype="constant"), smoothpts),
144
+ padlen=20,
145
+ )
146
+ glmderivratios = glmderivratios[edgepad:-edgepad]
147
+ smoothglmderivratios = smoothglmderivratios[edgepad:-edgepad]
148
+ else:
149
+ smoothglmderivratios = np.zeros_like(glmderivratios)
150
+ for i in range(glmderivs):
151
+ smoothglmderivratios[i, :] = tide_filt.unpadvec(
152
+ smooth(
153
+ tide_filt.padvec(glmderivratios[i, :], padlen=20, padtype="constant"),
154
+ smoothpts,
155
+ ),
156
+ padlen=20,
157
+ )
158
+ glmderivratios = glmderivratios[:, edgepad:-edgepad]
159
+ smoothglmderivratios = smoothglmderivratios[:, edgepad:-edgepad]
144
160
  lagtimes = lagtimes[edgepad:-edgepad]
145
161
  if debug:
146
162
  print("after trimming")
@@ -164,16 +180,6 @@ def trainratiotooffset(
164
180
  maplimits = (xaxis[0], xaxis[-1])
165
181
 
166
182
  if outputlevel != "min":
167
- """tide_io.writebidstsv(
168
- f"{outputname}_desc-ratiotodelaymapping_timeseries",
169
- np.stack((xaxis, yaxis)),
170
- 1.0,
171
- columns=["smoothglmderivratio", "delay"],
172
- extraheaderinfo={
173
- "Description": "The ratio of sLFO derivative to the sLFO, and the corresponding delay offset"
174
- },
175
- append=False,
176
- )"""
177
183
  resampaxis = np.linspace(xaxis[0], xaxis[-1], num=len(xaxis), endpoint=True)
178
184
  tide_io.writebidstsv(
179
185
  f"{outputname}_desc-ratiotodelayfunc_timeseries",
@@ -181,9 +187,7 @@ def trainratiotooffset(
181
187
  1.0 / (resampaxis[1] - resampaxis[0]),
182
188
  starttime=resampaxis[0],
183
189
  columns=["delay"],
184
- extraheaderinfo={
185
- "Description": "The function mapping derivative ratio to delay"
186
- },
190
+ extraheaderinfo={"Description": "The function mapping derivative ratio to delay"},
187
191
  append=False,
188
192
  )
189
193
 
@@ -198,6 +202,34 @@ def ratiotodelay(theratio):
198
202
  return ratiotooffsetfunc(theratio)
199
203
 
200
204
 
205
+ def coffstodelay(thecoffs, mindelay=-3.0, maxdelay=3.0, debug=False):
206
+ justaone = np.array([1.0], dtype=thecoffs.dtype)
207
+ allcoffs = np.concatenate((justaone, thecoffs))
208
+ theroots = (poly.Polynomial(allcoffs, domain=(mindelay, maxdelay))).roots()
209
+ if theroots is None:
210
+ return 0.0
211
+ elif len(theroots) == 1:
212
+ return theroots[0].real
213
+ else:
214
+ candidates = []
215
+ for i in range(len(theroots)):
216
+ if np.isreal(theroots[i]) and (mindelay <= theroots[i] <= maxdelay):
217
+ if debug:
218
+ print(f"keeping root {i} ({theroots[i]})")
219
+ candidates.append(theroots[i].real)
220
+ else:
221
+ if debug:
222
+ print(f"discarding root {i} ({theroots[i]})")
223
+ else:
224
+ pass
225
+ if len(candidates) > 0:
226
+ chosen = candidates[np.argmin(np.fabs(np.array(candidates)))].real
227
+ if debug:
228
+ print(f"{theroots=}, {candidates=}, {chosen=}")
229
+ return chosen
230
+ return 0.0
231
+
232
+
201
233
  def getderivratios(
202
234
  fmri_data_valid,
203
235
  validvoxels,
@@ -219,12 +251,14 @@ def getderivratios(
219
251
  LGR,
220
252
  TimingLGR,
221
253
  optiondict,
254
+ glmderivs=1,
222
255
  debug=False,
223
256
  ):
224
257
  if debug:
225
258
  print("getderivratios")
226
259
  print(f"{fitNorm.shape=}")
227
260
  print(f"{fitcoeff.shape=}")
261
+ print(f"{glmderivs=}")
228
262
  voxelsprocessed_glm, regressorset, evset = tide_glmfrommaps.glmfrommaps(
229
263
  fmri_data_valid,
230
264
  validvoxels,
@@ -249,7 +283,7 @@ def getderivratios(
249
283
  optiondict["saveminimumglmfiles"],
250
284
  nprocs_makelaggedtcs=optiondict["nprocs_makelaggedtcs"],
251
285
  nprocs_glm=optiondict["nprocs_glm"],
252
- glmderivs=1,
286
+ glmderivs=glmderivs,
253
287
  mp_chunksize=optiondict["mp_chunksize"],
254
288
  showprogressbar=optiondict["showprogressbar"],
255
289
  alwaysmultiproc=optiondict["alwaysmultiproc"],
@@ -258,13 +292,19 @@ def getderivratios(
258
292
  )
259
293
 
260
294
  # calculate the ratio of the first derivative to the main regressor
261
- glmderivratio = np.nan_to_num(fitcoeff[:, 1] / fitcoeff[:, 0])
295
+ if glmderivs == 1:
296
+ glmderivratios = np.nan_to_num(fitcoeff[:, 1] / fitcoeff[:, 0])
297
+ else:
298
+ numvoxels = fitcoeff.shape[0]
299
+ glmderivratios = np.zeros((glmderivs, numvoxels), dtype=np.float64)
300
+ for i in range(glmderivs):
301
+ glmderivratios[i, :] = np.nan_to_num(fitcoeff[:, i + 1] / fitcoeff[:, 0])
262
302
 
263
- return glmderivratio
303
+ return glmderivratios
264
304
 
265
305
 
266
306
  def filterderivratios(
267
- glmderivratio,
307
+ glmderivratios,
268
308
  nativespaceshape,
269
309
  validvoxels,
270
310
  thedims,
@@ -283,7 +323,7 @@ def filterderivratios(
283
323
  print(f"\t{nativespaceshape=}")
284
324
 
285
325
  # filter the ratio to find weird values
286
- themad = mad(glmderivratio).astype(np.float64)
326
+ themad = mad(glmderivratios).astype(np.float64)
287
327
  print(f"MAD of GLM derivative ratios = {themad}")
288
328
  outmaparray, internalspaceshape = tide_io.makedestarray(
289
329
  nativespaceshape,
@@ -291,24 +331,24 @@ def filterderivratios(
291
331
  fileiscifti=fileiscifti,
292
332
  rt_floattype=rt_floattype,
293
333
  )
294
- mappedglmderivratio = tide_io.populatemap(
295
- glmderivratio,
334
+ mappedglmderivratios = tide_io.populatemap(
335
+ glmderivratios,
296
336
  internalspaceshape,
297
337
  validvoxels,
298
338
  outmaparray,
299
339
  debug=debug,
300
340
  )
301
341
  if textio or fileiscifti:
302
- medfilt = glmderivratio
303
- filteredarray = glmderivratio
342
+ medfilt = glmderivratios
343
+ filteredarray = glmderivratios
304
344
  else:
305
345
  if debug:
306
- print(f"{glmderivratio.shape=}, {mappedglmderivratio.shape=}")
346
+ print(f"{glmderivratios.shape=}, {mappedglmderivratios.shape=}")
307
347
  medfilt = median_filter(
308
- mappedglmderivratio.reshape(nativespaceshape), size=(3, 3, 3)
348
+ mappedglmderivratios.reshape(nativespaceshape), size=(3, 3, 3)
309
349
  ).reshape(internalspaceshape)[validvoxels]
310
350
  filteredarray = np.where(
311
- np.fabs(glmderivratio - medfilt) > patchthresh * themad, medfilt, glmderivratio
351
+ np.fabs(glmderivratios - medfilt) > patchthresh * themad, medfilt, glmderivratios
312
352
  )
313
353
  if gausssigma > 0:
314
354
  mappedfilteredarray = tide_io.populatemap(
@@ -151,6 +151,9 @@ def alignvoxels(
151
151
  """
152
152
  inputshape = np.shape(fmridata)
153
153
  volumetotal = np.sum(lagmask)
154
+ if debug:
155
+ print("alignvoxels: {inputshape}")
156
+ print("volumetotal: {volumetotal}")
154
157
 
155
158
  # timeshift the valid voxels
156
159
  if nprocs > 1 or alwaysmultiproc:
@@ -253,6 +256,7 @@ def makerefinemask(
253
256
  bipolar=False,
254
257
  includemask=None,
255
258
  excludemask=None,
259
+ fixdelay=False,
256
260
  debug=False,
257
261
  rt_floatset=np.float64,
258
262
  rt_floattype="float64",
@@ -321,35 +325,45 @@ def makerefinemask(
321
325
  LGR.info(f"setting ampthresh to the {-100.0 * ampthresh}th percentile ({theampthresh})")
322
326
  else:
323
327
  theampthresh = ampthresh
328
+ if debug:
329
+ print(f"makerefinemask: {theampthresh=}")
324
330
  if bipolar:
325
331
  ampmask = np.where(np.fabs(lagstrengths) >= theampthresh, np.int16(1), np.int16(0))
326
332
  else:
327
333
  ampmask = np.where(lagstrengths >= theampthresh, np.int16(1), np.int16(0))
328
- if lagmaskside == "upper":
329
- delaymask = np.where(
330
- (lagtimes - offsettime) > lagminthresh,
331
- np.int16(1),
332
- np.int16(0),
333
- ) * np.where(
334
- (lagtimes - offsettime) < lagmaxthresh,
335
- np.int16(1),
336
- np.int16(0),
337
- )
338
- elif lagmaskside == "lower":
339
- delaymask = np.where(
340
- (lagtimes - offsettime) < -lagminthresh,
341
- np.int16(1),
342
- np.int16(0),
343
- ) * np.where(
344
- (lagtimes - offsettime) > -lagmaxthresh,
345
- np.int16(1),
346
- np.int16(0),
347
- )
334
+ if fixdelay:
335
+ delaymask = lagmask + 0
348
336
  else:
349
- abslag = abs(lagtimes - offsettime)
350
- delaymask = np.where(abslag > lagminthresh, np.int16(1), np.int16(0)) * np.where(
351
- abslag < lagmaxthresh, np.int16(1), np.int16(0)
352
- )
337
+ if lagmaskside == "upper":
338
+ delaymask = np.where(
339
+ (lagtimes - offsettime) > lagminthresh,
340
+ np.int16(1),
341
+ np.int16(0),
342
+ ) * np.where(
343
+ (lagtimes - offsettime) < lagmaxthresh,
344
+ np.int16(1),
345
+ np.int16(0),
346
+ )
347
+ elif lagmaskside == "lower":
348
+ delaymask = np.where(
349
+ (lagtimes - offsettime) < -lagminthresh,
350
+ np.int16(1),
351
+ np.int16(0),
352
+ ) * np.where(
353
+ (lagtimes - offsettime) > -lagmaxthresh,
354
+ np.int16(1),
355
+ np.int16(0),
356
+ )
357
+ else:
358
+ abslag = abs(lagtimes - offsettime)
359
+ delaymask = np.where(abslag > lagminthresh, np.int16(1), np.int16(0)) * np.where(
360
+ abslag < lagmaxthresh, np.int16(1), np.int16(0)
361
+ )
362
+ if debug:
363
+ print(f"makerefinemask: {lagmaskside=}")
364
+ print(f"makerefinemask: {lagminthresh=}")
365
+ print(f"makerefinemask: {lagmaxthresh=}")
366
+ print(f"makerefinemask: {offsettime=}")
353
367
  sigmamask = np.where(lagsigma < sigmathresh, np.int16(1), np.int16(0))
354
368
  locationmask = lagmask + 0
355
369
  if includemask is not None:
@@ -16,12 +16,15 @@
16
16
  # limitations under the License.
17
17
  #
18
18
  #
19
+ import os
20
+
19
21
  import matplotlib as mpl
20
22
  import matplotlib.pyplot as plt
21
23
  import numpy as np
22
24
 
23
25
  from rapidtide.resample import FastResampler, FastResamplerFromFile
24
26
  from rapidtide.tests.utils import mse
27
+ from rapidtide.tests.utils import get_test_temp_path
25
28
 
26
29
 
27
30
  def test_FastResampler(debug=False):
@@ -45,8 +48,9 @@ def test_FastResampler(debug=False):
45
48
  print(f"{genlaggedtc.hiresstart=}, {genlaggedtc.hiresend=}, {genlaggedtc.hiresstep=}")
46
49
 
47
50
  # save and reload with another name
48
- genlaggedtc.save("savedresampler")
49
- genlaggedtc2 = FastResamplerFromFile("savedresampler", padtime=padtime, debug=debug)
51
+ resamplername = os.path.join(get_test_temp_path(), "savedresampler")
52
+ genlaggedtc.save(resamplername)
53
+ genlaggedtc2 = FastResamplerFromFile(resamplername, padtime=padtime, debug=debug)
50
54
  if debug:
51
55
  print(f"{genlaggedtc2.initstart=}, {genlaggedtc2.initend=}, {genlaggedtc2.initstep=}")
52
56
  print(f"{genlaggedtc2.hiresstart=}, {genlaggedtc2.hiresend=}, {genlaggedtc2.hiresstep=}")
@@ -36,7 +36,6 @@ def test_fullrunhappy_v1(debug=False, displayplots=False):
36
36
  "--spatialglm",
37
37
  "--model",
38
38
  "model_revised",
39
- "--aliasedcorrelation",
40
39
  ]
41
40
  happy_workflow.happy_main(happy_parser.process_args(inputargs=inputargs))
42
41
 
@@ -41,6 +41,7 @@ def test_fullrunhappy_v4(debug=False, displayplots=False):
41
41
  "model_revised",
42
42
  "--motionfile",
43
43
  os.path.join(get_examples_path(), "sub-HAPPYTEST_mcf.par"),
44
+ "--aliasedcorrelation",
44
45
  ]
45
46
  happy_workflow.happy_main(happy_parser.process_args(inputargs=inputargs))
46
47
 
@@ -22,7 +22,7 @@ import matplotlib as mpl
22
22
 
23
23
  import rapidtide.workflows.parser_funcs as pf
24
24
  import rapidtide.workflows.showtc as showtc
25
- from rapidtide.tests.utils import get_examples_path
25
+ from rapidtide.tests.utils import get_examples_path, get_test_temp_path
26
26
 
27
27
 
28
28
  def test_runmisc(debug=False, displayplots=False):
@@ -35,7 +35,7 @@ def test_runmisc(debug=False, displayplots=False):
35
35
  "--sampletime",
36
36
  "12.5",
37
37
  "--tofile",
38
- "showtcout1.jpg",
38
+ os.path.join(get_test_temp_path(), "showtcout1.jpg"),
39
39
  "--starttime",
40
40
  "100",
41
41
  "--endtime",
@@ -55,7 +55,7 @@ def test_runmisc(debug=False, displayplots=False):
55
55
  "--displaytype",
56
56
  "power",
57
57
  "--tofile",
58
- "showtcout2.jpg",
58
+ os.path.join(get_test_temp_path(), "showtcout2.jpg"),
59
59
  "--noxax",
60
60
  "--noyax",
61
61
  "--nolegend",
@@ -90,7 +90,7 @@ def test_runmisc(debug=False, displayplots=False):
90
90
  "--displaytype",
91
91
  "phase",
92
92
  "--tofile",
93
- "showtcout3.jpg",
93
+ os.path.join(get_test_temp_path(), "showtcout3.jpg"),
94
94
  ]
95
95
  pf.generic_init(showtc._get_parser, showtc.showtc, inputargs=inputargs)
96
96
 
@@ -39,6 +39,7 @@ class Ui_MainWindow(object):
39
39
  self.logOutput.setGeometry(QtCore.QRect(10, 30, 651, 131))
40
40
  font = QtGui.QFont()
41
41
  font.setFamily("Courier")
42
+ font.setBold(True)
42
43
  self.logOutput.setFont(font)
43
44
  self.logOutput.setObjectName("logOutput")
44
45
  self.imageData_groupBox = QtWidgets.QGroupBox(self.centralwidget)
@@ -80,6 +80,7 @@
80
80
  <property name="font">
81
81
  <font>
82
82
  <family>Courier</family>
83
+ <bold>true</bold>
83
84
  </font>
84
85
  </property>
85
86
  </widget>
@@ -14,14 +14,14 @@ from PyQt5 import QtCore, QtGui, QtWidgets
14
14
  class Ui_MainWindow(object):
15
15
  def setupUi(self, MainWindow):
16
16
  MainWindow.setObjectName("MainWindow")
17
- MainWindow.resize(1380, 810)
17
+ MainWindow.resize(1375, 805)
18
18
  sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.MinimumExpanding)
19
19
  sizePolicy.setHorizontalStretch(1)
20
20
  sizePolicy.setVerticalStretch(1)
21
21
  sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
22
22
  MainWindow.setSizePolicy(sizePolicy)
23
- MainWindow.setMinimumSize(QtCore.QSize(1380, 810))
24
- MainWindow.setMaximumSize(QtCore.QSize(1380, 810))
23
+ MainWindow.setMinimumSize(QtCore.QSize(1375, 805))
24
+ MainWindow.setMaximumSize(QtCore.QSize(1375, 805))
25
25
  MainWindow.setSizeIncrement(QtCore.QSize(1, 1))
26
26
  self.centralwidget = QtWidgets.QWidget(MainWindow)
27
27
  self.centralwidget.setObjectName("centralwidget")
@@ -684,6 +684,7 @@ class Ui_MainWindow(object):
684
684
  font = QtGui.QFont()
685
685
  font.setFamily("Courier New")
686
686
  font.setPointSize(11)
687
+ font.setBold(True)
687
688
  self.logOutput.setFont(font)
688
689
  self.logOutput.setObjectName("logOutput")
689
690
  self.simfunc_groupBox = QtWidgets.QGroupBox(self.centralwidget)
@@ -718,7 +719,7 @@ class Ui_MainWindow(object):
718
719
  self.simfunc_groupBox.raise_()
719
720
  MainWindow.setCentralWidget(self.centralwidget)
720
721
  self.menubar = QtWidgets.QMenuBar(MainWindow)
721
- self.menubar.setGeometry(QtCore.QRect(0, 0, 1373, 24))
722
+ self.menubar.setGeometry(QtCore.QRect(0, 0, 1375, 24))
722
723
  self.menubar.setObjectName("menubar")
723
724
  MainWindow.setMenuBar(self.menubar)
724
725
  self.statusbar = QtWidgets.QStatusBar(MainWindow)
@@ -1766,6 +1766,7 @@
1766
1766
  <font>
1767
1767
  <family>Courier New</family>
1768
1768
  <pointsize>11</pointsize>
1769
+ <bold>true</bold>
1769
1770
  </font>
1770
1771
  </property>
1771
1772
  </widget>
@@ -1847,7 +1848,7 @@
1847
1848
  <rect>
1848
1849
  <x>0</x>
1849
1850
  <y>0</y>
1850
- <width>1373</width>
1851
+ <width>1375</width>
1851
1852
  <height>24</height>
1852
1853
  </rect>
1853
1854
  </property>
@@ -1891,7 +1892,7 @@
1891
1892
  </property>
1892
1893
  </designerdata>
1893
1894
  <buttongroups>
1894
- <buttongroup name="colormap_buttonGroup"/>
1895
1895
  <buttongroup name="stats_buttonGroup"/>
1896
+ <buttongroup name="colormap_buttonGroup"/>
1896
1897
  </buttongroups>
1897
1898
  </ui>
@@ -12,14 +12,14 @@ from PyQt6 import QtCore, QtGui, QtWidgets
12
12
  class Ui_MainWindow(object):
13
13
  def setupUi(self, MainWindow):
14
14
  MainWindow.setObjectName("MainWindow")
15
- MainWindow.resize(1380, 810)
15
+ MainWindow.resize(1375, 805)
16
16
  sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.MinimumExpanding)
17
17
  sizePolicy.setHorizontalStretch(1)
18
18
  sizePolicy.setVerticalStretch(1)
19
19
  sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
20
20
  MainWindow.setSizePolicy(sizePolicy)
21
- MainWindow.setMinimumSize(QtCore.QSize(1380, 810))
22
- MainWindow.setMaximumSize(QtCore.QSize(1380, 810))
21
+ MainWindow.setMinimumSize(QtCore.QSize(1375, 805))
22
+ MainWindow.setMaximumSize(QtCore.QSize(1375, 805))
23
23
  MainWindow.setSizeIncrement(QtCore.QSize(1, 1))
24
24
  self.centralwidget = QtWidgets.QWidget(parent=MainWindow)
25
25
  self.centralwidget.setObjectName("centralwidget")
@@ -682,6 +682,7 @@ class Ui_MainWindow(object):
682
682
  font = QtGui.QFont()
683
683
  font.setFamily("Courier New")
684
684
  font.setPointSize(11)
685
+ font.setBold(True)
685
686
  self.logOutput.setFont(font)
686
687
  self.logOutput.setObjectName("logOutput")
687
688
  self.simfunc_groupBox = QtWidgets.QGroupBox(parent=self.centralwidget)
@@ -716,7 +717,7 @@ class Ui_MainWindow(object):
716
717
  self.simfunc_groupBox.raise_()
717
718
  MainWindow.setCentralWidget(self.centralwidget)
718
719
  self.menubar = QtWidgets.QMenuBar(parent=MainWindow)
719
- self.menubar.setGeometry(QtCore.QRect(0, 0, 1373, 24))
720
+ self.menubar.setGeometry(QtCore.QRect(0, 0, 1375, 24))
720
721
  self.menubar.setObjectName("menubar")
721
722
  MainWindow.setMenuBar(self.menubar)
722
723
  self.statusbar = QtWidgets.QStatusBar(parent=MainWindow)
@@ -868,6 +868,7 @@ class Ui_MainWindow(object):
868
868
  font = QtGui.QFont()
869
869
  font.setFamily("Courier New")
870
870
  font.setPointSize(11)
871
+ font.setBold(True)
871
872
  self.logOutput.setFont(font)
872
873
  self.logOutput.setObjectName("logOutput")
873
874
  self.simfunc_groupBox = QtWidgets.QGroupBox(self.centralwidget)
@@ -2254,6 +2254,7 @@
2254
2254
  <font>
2255
2255
  <family>Courier New</family>
2256
2256
  <pointsize>11</pointsize>
2257
+ <bold>true</bold>
2257
2258
  </font>
2258
2259
  </property>
2259
2260
  </widget>
@@ -866,6 +866,7 @@ class Ui_MainWindow(object):
866
866
  font = QtGui.QFont()
867
867
  font.setFamily("Courier New")
868
868
  font.setPointSize(11)
869
+ font.setBold(True)
869
870
  self.logOutput.setFont(font)
870
871
  self.logOutput.setObjectName("logOutput")
871
872
  self.simfunc_groupBox = QtWidgets.QGroupBox(parent=self.centralwidget)
@@ -37,6 +37,7 @@ class Ui_MainWindow(object):
37
37
  self.logOutput.setGeometry(QtCore.QRect(10, 30, 651, 131))
38
38
  font = QtGui.QFont()
39
39
  font.setFamily("Courier")
40
+ font.setBold(True)
40
41
  self.logOutput.setFont(font)
41
42
  self.logOutput.setObjectName("logOutput")
42
43
  self.imageData_groupBox = QtWidgets.QGroupBox(parent=self.centralwidget)
@@ -83,7 +83,7 @@ def invert_float(parser, arg):
83
83
  return arg
84
84
 
85
85
 
86
- def is_float(parser, arg):
86
+ def is_float(parser, arg, minval=None, maxval=None):
87
87
  """
88
88
  Check if argument is float or auto.
89
89
  """
@@ -92,6 +92,10 @@ def is_float(parser, arg):
92
92
  arg = float(arg)
93
93
  except parser.error:
94
94
  parser.error('Value {0} is not a float or "auto"'.format(arg))
95
+ if minval is not None and arg < minval:
96
+ parser.error("Value {0} is smaller than {1}".format(arg, minval))
97
+ if maxval is not None and arg > maxval:
98
+ parser.error("Value {0} is larger than {1}".format(arg, maxval))
95
99
 
96
100
  return arg
97
101
 
@@ -115,7 +119,7 @@ def is_valid_file_or_float(parser, arg):
115
119
  return arg
116
120
 
117
121
 
118
- def is_int(parser, arg):
122
+ def is_int(parser, arg, minval=None, maxval=None):
119
123
  """
120
124
  Check if argument is int or auto.
121
125
  """
@@ -124,6 +128,10 @@ def is_int(parser, arg):
124
128
  arg = int(arg)
125
129
  except parser.error:
126
130
  parser.error('Value {0} is not an int or "auto"'.format(arg))
131
+ if minval is not None and arg < minval:
132
+ parser.error("Value {0} is smaller than {1}".format(arg, minval))
133
+ if maxval is not None and arg > maxval:
134
+ parser.error("Value {0} is larger than {1}".format(arg, maxval))
127
135
 
128
136
  return arg
129
137