def connect(request): c = Cytomine.connect(request.config.getoption("--host"), request.config.getoption("--public_key"), request.config.getoption("--private_key"), logging.DEBUG) c.open_admin_session() return c
from cytomine.cytomine import Cytomine from cytomine.models.image import ImageInstanceCollection, AbstractImage from cytomine.models.imagegroup import ImageGroup, ImageSequence, ImageSequenceCollection, ImageGroupHDF5 from cytomine.models.storage import UploadedFile __author__ = "Rubens Ulysse <*****@*****.**>" __contributors__ = ["Marée Raphaël <*****@*****.**>"] __copyright__ = "Copyright 2010-2018 University of Liège, Belgium, http://www.cytomine.be/" upload = "demo-upload.cytomine.be" id_storage = 0 project_id = 0 priv = "" publ = "" c = Cytomine.connect('demo.cytomine.be', publ, priv) dir_path = "Rompp-ProteomeXChange2010/ionimages" onlyfiles = [ f for f in os.listdir(dir_path) if isfile(os.path.join(dir_path, f)) and f[-4:] == ".png" ] onlyfiles.sort() print(onlyfiles) # Upload files zstack = {} t = 0 for file_path in onlyfiles: print("Upload file {}".format(file_path)) p = os.path.join(dir_path, file_path)