Skip to content

Commit 06248c8

Browse files
committed
corrected handling mask
1 parent 0d9a609 commit 06248c8

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

code/python/cni_toolbox/IRM.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def create_timecourses(self, FUN, xdata):
204204

205205
self.tc_fft = fft(tc, axis = 0)
206206

207-
def mapping(self, data, threshold = 100, mask = None):
207+
def mapping(self, data, threshold = 100, mask = []):
208208
'''
209209
identifies the best fitting timecourse for each voxel and
210210
returns a dictionary with keyes corresponding to the
@@ -230,7 +230,7 @@ def mapping(self, data, threshold = 100, mask = None):
230230
mean_signal = np.mean(data, axis = 0)
231231
data = zscore(data, axis = 0)
232232

233-
if mask.all()==None:
233+
if np.size(mask)==0:
234234
mask = mean_signal >= threshold
235235

236236
mask = np.reshape(mask,self.n_total)

code/python/cni_toolbox/RRT.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def set_design(self, X, convolve = False):
169169
self.X = zscore(X[0:self.n_samples,], axis = 0)
170170

171171
def optimize_penalty(self, data, candidates, folds = 4,
172-
mask = None):
172+
mask =[]):
173173
'''
174174
performs k-fold cross-validation to find an optimal value
175175
for the penalty parameter.
@@ -189,7 +189,7 @@ def optimize_penalty(self, data, candidates, folds = 4,
189189
190190
'''
191191

192-
if mask.all()==None:
192+
if np.size(mask)==0:
193193
mask = np.ones(self.n_total).astype(bool)
194194
else:
195195
mask = np.reshape(mask,self.n_total)

code/python/cni_toolbox/pRF.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def create_timecourses(self, max_radius = 10.0, n_xy = 30,
287287
sys.stdout.write("creating timecourses [%-20s] %d%%\n" % ('='*20, 100))
288288
self.tc_fft = fft(tc, axis = 0)
289289

290-
def mapping(self, data, threshold = 100, mask = None):
290+
def mapping(self, data, threshold = 100, mask = []):
291291
'''
292292
identifies the best fitting timecourse for each voxel and
293293
returns a dictionary with the following keys
@@ -320,7 +320,7 @@ def mapping(self, data, threshold = 100, mask = None):
320320
mean_signal = np.mean(data, axis = 0)
321321
data = zscore(data, axis = 0)
322322

323-
if mask.all()==None:
323+
if np.size(mask)==0:
324324
mask = mean_signal >= threshold
325325

326326
mask = np.reshape(mask,self.n_total)

0 commit comments

Comments
 (0)