You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: asltk/reconstruction/ultralong_te_mapping.py
+27-10Lines changed: 27 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -211,7 +211,7 @@ def create_map(
211
211
self,
212
212
ub: list= [np.inf],
213
213
lb: list= [0.0],
214
-
par0: list= [400],
214
+
par0: list= [80000],
215
215
cores: Union[int, str] ='auto',
216
216
smoothing=None,
217
217
smoothing_params=None,
@@ -427,6 +427,7 @@ def create_map(
427
427
)
428
428
429
429
# Adjusting output image boundaries
430
+
# TODO O ADJUST_LIMITS TEM QUE SER TESTADO E AJUSTADO PARA O CASO DO CSF-GM --> OK para a nova forma de adjust_image. Fazer a mesma coisa para multiTE e commitar o codigo
430
431
self._t1csfgm_map=self._adjust_image_limits(
431
432
self._t1csfgm_map, par0[0]
432
433
)
@@ -460,15 +461,31 @@ def create_map(
460
461
)
461
462
462
463
def_adjust_image_limits(self, map, init_guess):
463
-
img=sitk.GetImageFromArray(map)
464
-
thr_filter=sitk.ThresholdImageFilter()
465
-
thr_filter.SetUpper(
466
-
4*init_guess
467
-
) # assuming upper to 4x the initial guess
468
-
thr_filter.SetLower(0.0)
469
-
img=thr_filter.Execute(img)
470
-
471
-
returnsitk.GetArrayFromImage(img)
464
+
"""Adjust image limits by rescaling values within realistic bounds.
465
+
466
+
This method removes outliers and rescales T1csfGM values to a realistic
467
+
physiological range based on the initial guess parameter.
468
+
469
+
Args:
470
+
map (np.ndarray): The T1csfGM map to adjust
471
+
init_guess (float): Initial guess value used for determining bounds
472
+
473
+
Returns:
474
+
np.ndarray: Adjusted map with values rescaled to [0, 2*init_guess]
475
+
"""
476
+
# Remove voxels that failed fitting (still at initial guess)
0 commit comments