rapidtide 3.0a11__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.
- rapidtide/Refiner.py +464 -0
- rapidtide/data/examples/src/testfmri +2 -124
- rapidtide/data/examples/src/testinitdelay +19 -0
- rapidtide/data/examples/src/testnewrefine +49 -0
- rapidtide/data/examples/src/testrefineonly +22 -0
- rapidtide/glmpass.py +8 -1
- rapidtide/refinedelay.py +72 -32
- rapidtide/refineregressor.py +38 -24
- rapidtide/tidepoolTemplate.py +1 -0
- rapidtide/tidepoolTemplate.ui +1 -0
- rapidtide/tidepoolTemplate_alt.py +5 -4
- rapidtide/tidepoolTemplate_alt.ui +3 -2
- rapidtide/tidepoolTemplate_alt_qt6.py +5 -4
- rapidtide/tidepoolTemplate_big.py +1 -0
- rapidtide/tidepoolTemplate_big.ui +1 -0
- rapidtide/tidepoolTemplate_big_qt6.py +1 -0
- rapidtide/tidepoolTemplate_qt6.py +1 -0
- rapidtide/workflows/parser_funcs.py +10 -2
- rapidtide/workflows/rapidtide.py +197 -325
- rapidtide/workflows/rapidtide_parser.py +35 -13
- rapidtide/workflows/retroglm.py +145 -60
- rapidtide/workflows/tidepool.py +2 -2
- {rapidtide-3.0a11.dist-info → rapidtide-3.0a12.dist-info}/METADATA +1 -1
- {rapidtide-3.0a11.dist-info → rapidtide-3.0a12.dist-info}/RECORD +28 -24
- {rapidtide-3.0a11.dist-info → rapidtide-3.0a12.dist-info}/WHEEL +1 -1
- {rapidtide-3.0a11.dist-info → rapidtide-3.0a12.dist-info}/LICENSE +0 -0
- {rapidtide-3.0a11.dist-info → rapidtide-3.0a12.dist-info}/entry_points.txt +0 -0
- {rapidtide-3.0a11.dist-info → rapidtide-3.0a12.dist-info}/top_level.txt +0 -0
rapidtide/glmpass.py
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
#
|
|
18
18
|
#
|
|
19
19
|
import numpy as np
|
|
20
|
+
from scipy.special import factorial
|
|
20
21
|
from tqdm import tqdm
|
|
21
22
|
|
|
22
23
|
import rapidtide.filter as tide_filt
|
|
@@ -350,11 +351,17 @@ def makevoxelspecificderivs(theevs, nderivs=1, debug=False):
|
|
|
350
351
|
if nderivs == 0:
|
|
351
352
|
thenewevs = theevs
|
|
352
353
|
else:
|
|
354
|
+
taylorcoffs = np.zeros((nderivs + 1), dtype=np.float64)
|
|
355
|
+
taylorcoffs[0] = 1.0
|
|
353
356
|
thenewevs = np.zeros((theevs.shape[0], theevs.shape[1], nderivs + 1), dtype=float)
|
|
357
|
+
for i in range(1, nderivs + 1):
|
|
358
|
+
taylorcoffs[i] = 1.0 / factorial(i)
|
|
354
359
|
for thevoxel in range(0, theevs.shape[0]):
|
|
355
360
|
thenewevs[thevoxel, :, 0] = theevs[thevoxel, :] * 1.0
|
|
356
361
|
for i in range(1, nderivs + 1):
|
|
357
|
-
thenewevs[thevoxel, :, i] = np.gradient(
|
|
362
|
+
thenewevs[thevoxel, :, i] = taylorcoffs[i] * np.gradient(
|
|
363
|
+
thenewevs[thevoxel, :, i - 1]
|
|
364
|
+
)
|
|
358
365
|
if debug:
|
|
359
366
|
print(f"{nderivs=}")
|
|
360
367
|
print(f"{thenewevs.shape=}")
|
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
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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=
|
|
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
|
-
|
|
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
|
|
303
|
+
return glmderivratios
|
|
264
304
|
|
|
265
305
|
|
|
266
306
|
def filterderivratios(
|
|
267
|
-
|
|
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(
|
|
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
|
-
|
|
295
|
-
|
|
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 =
|
|
303
|
-
filteredarray =
|
|
342
|
+
medfilt = glmderivratios
|
|
343
|
+
filteredarray = glmderivratios
|
|
304
344
|
else:
|
|
305
345
|
if debug:
|
|
306
|
-
print(f"{
|
|
346
|
+
print(f"{glmderivratios.shape=}, {mappedglmderivratios.shape=}")
|
|
307
347
|
medfilt = median_filter(
|
|
308
|
-
|
|
348
|
+
mappedglmderivratios.reshape(nativespaceshape), size=(3, 3, 3)
|
|
309
349
|
).reshape(internalspaceshape)[validvoxels]
|
|
310
350
|
filteredarray = np.where(
|
|
311
|
-
np.fabs(
|
|
351
|
+
np.fabs(glmderivratios - medfilt) > patchthresh * themad, medfilt, glmderivratios
|
|
312
352
|
)
|
|
313
353
|
if gausssigma > 0:
|
|
314
354
|
mappedfilteredarray = tide_io.populatemap(
|
rapidtide/refineregressor.py
CHANGED
|
@@ -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
|
|
329
|
-
delaymask =
|
|
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
|
-
|
|
350
|
-
|
|
351
|
-
|
|
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:
|
rapidtide/tidepoolTemplate.py
CHANGED
|
@@ -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)
|
rapidtide/tidepoolTemplate.ui
CHANGED
|
@@ -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(
|
|
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(
|
|
24
|
-
MainWindow.setMaximumSize(QtCore.QSize(
|
|
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,
|
|
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>
|
|
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(
|
|
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(
|
|
22
|
-
MainWindow.setMaximumSize(QtCore.QSize(
|
|
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,
|
|
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)
|
|
@@ -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
|
|