@@ -606,6 +606,7 @@ def cost2thresh(cost, sub, bl, lk, idc=[], costlist=[]):
606
606
be registered.
607
607
608
608
"""
609
+ return cost2thresh2 (cost , sub , bl , axis0 = None , lk = lk , last = None , idc = idc ,costlist = costlist )
609
610
# For this subject and block, find the indices corresponding to this cost.
610
611
# Note there may be more than one such index. There will be no such
611
612
# indices if cost is not a value in the array.
@@ -632,7 +633,8 @@ def cost2thresh(cost, sub, bl, lk, idc=[], costlist=[]):
632
633
return th
633
634
634
635
635
- def cost2thresh2 (cost , sub , sc , c , lk , last = None , idc = [], costlist = []):
636
+ def cost2thresh2 (cost , sub , axis1 , axis0 , lk ,
637
+ last = None , idc = [], costlist = []):
636
638
"""A definition for loading the lookup table and finding the threshold
637
639
associated with a particular cost for a particular subject in a
638
640
particular block of data
@@ -663,7 +665,7 @@ def cost2thresh2(cost, sub, sc, c, lk, last = None, idc = [], costlist=[]):
663
665
threshold : float
664
666
threshold value for this cost"""
665
667
666
- subject_lookup = slice_data (lk , sub , c , subcond = sc )
668
+ subject_lookup = slice_data (lk , sub , axis0 , subcond = axis1 )
667
669
index = np .where (subject_lookup [1 ] == cost )
668
670
threshold = subject_lookup [0 ][ind ]
669
671
@@ -676,7 +678,7 @@ def cost2thresh2(cost, sub, sc, c, lk, last = None, idc = [], costlist=[]):
676
678
elif len (threshold ) < 1 :
677
679
idc = idc - 1
678
680
newcost = costlist [idc ]
679
- threshold = cost2thresh2 (newcost , sub , sc , c , lk ,
681
+ threshold = cost2thresh2 (newcost , sub , axis1 , axis0 , lk ,
680
682
idc = idc , costlist = costlist )
681
683
print (' ' .join (['Subject %s does not have cost at %s' % (sub , cost ),
682
684
'index 1: %s, index 2: %s' % (c , sc ),
0 commit comments