def get_synapse_from_layer(cur,layer):
    """
    Returns synapses in given layer list of tuples:
    (mid_object,x-pos,y-pos)
    
    Parameters
    ----------
    cur : MySQLdb cursor
    layer : str
      Name of layer
    
    """

    sql = ("select synapsecombined.mid,"
           "object.OBJ_X,"
           "object.OBJ_Y "
           #"image.IMG_SectionNumber "
           "from synapsecombined "
           "join object on object.OBJ_Name=synapsecombined.mid "
           "join image on image.IMG_Number=object.IMG_Number "
           "where object.IMG_Number='%s' "
           #"and synapsecombined.type='chemical'"
           %layer)
    cur.execute(sql)
    return [(int(a[0]),int(a[1]),int(a[2])) for a in cur.fetchall()]