Skip to content

Commit f1c85fe

Browse files
committed
return real hrf | correct handling of empty hrf
1 parent b3844bc commit f1c85fe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

code/python/cni_toolbox/RRT.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class RRT:
6161
4. results = rrt.perform_ridge(data);
6262
'''
6363

64-
def __init__(self, parameters, hrf = None):
64+
def __init__(self, parameters, hrf = []):
6565
self.f_sampling = parameters['f_sampling']
6666
self.p_sampling = 1 / self.f_sampling
6767
self.n_samples = parameters['n_samples']
@@ -70,7 +70,7 @@ def __init__(self, parameters, hrf = None):
7070
self.n_slices = parameters['n_slices']
7171
self.n_total = self.n_rows * self.n_cols * self.n_slices
7272

73-
if hrf != None:
73+
if np.size(hrf) != 0:
7474
self.l_hrf = hrf.shape[0]
7575
if hrf.ndim>2:
7676
hrf = np.reshape(hrf, (self.l_hrf, self.n_total))
@@ -109,7 +109,7 @@ def get_hrf(self):
109109
else:
110110
hrf = ifft(self.hrf_fft, axis = 0)[0:self.l_hrf]
111111

112-
return hrf
112+
return np.abs(hrf)
113113

114114

115115
def get_design(self):

0 commit comments

Comments
 (0)