spikesorting.py 文件源码

python
阅读 35 收藏 0 点赞 0 评论 0

项目:NeoAnalysis 作者: neoanalysis 项目源码 文件源码
def __indexs_select_pk2(self,pk2_roi_pos):
        x_min = pk2_roi_pos[:,0].min()
        x_max = pk2_roi_pos[:,0].max()
        y_min = pk2_roi_pos[:,1].min()
        y_max = pk2_roi_pos[:,1].max()
        pca_1,pca_2 = self.PCAusedList.currentText().split("-")
        pca_1 = np.int(pca_1)-1
        pca_2 = np.int(pca_2)-1
        x = np.logical_and(self.wavePCAs[:,pca_1]>x_min, \
                            self.wavePCAs[:,pca_1]<x_max)
        y = np.logical_and(self.wavePCAs[:,pca_2]>y_min, \
                            self.wavePCAs[:,pca_2]<y_max)
        ind_0 = np.logical_and(x, y)
        ind_0 = np.where(ind_0 == True)[0]
        ind_0 = np.array(ind_0,dtype=np.int32)
        if ind_0.shape[0]>0:
            segments = []
            for i in range(pk2_roi_pos.shape[0]-1):
                segments.append([pk2_roi_pos[i],pk2_roi_pos[i+1]])
            segments.append([pk2_roi_pos[-1],pk2_roi_pos[0]])
            segments = np.array(segments)
            temp_pcas = self.wavePCAs[ind_0]
            temp_pcas = temp_pcas[:,[pca_1,pca_2]]
            is_intersect = np.apply_along_axis(self.__intersect_roi2,1,temp_pcas,segments,pca_1)
            return ind_0[is_intersect]
        else:
            return np.array([],dtype=np.int32)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号