Example #1
0
def create_3Dlabels_Potts(condition_defs,beta,dims,mask):
    labels = []
    graph = graph_from_lattice(mask, kerMask=kerMask3D_6n,toroidal=True)
    for c in condition_defs:
	tmp = genPotts(graph, beta,2 )
        tmp = np.reshape(tmp,dims)
        labels.append(tmp)
    return np.array(labels)
Example #2
0
def create_labels_Potts(condition_defs,beta,nb_voxels):
    labels = []
    nb_voxels = nb_voxels**.5 #assume square shape
    shape = (nb_voxels,nb_voxels)
    mask = np.ones(shape, dtype=int)
    graph = graph_from_lattice(mask, kerMask=kerMask2D_4n, toroidal=True)
    shape = (1,nb_voxels,nb_voxels)
    for c in condition_defs:
	tmp = genPotts(graph, beta,2 )
        tmp = np.reshape(tmp,shape)
        labels.append(tmp)
    return np.array(labels)