Package: wkconnect
webknossos-connectAwebKnossoscompatible data connector written in Python.webKnossos-connect serves as an adapter between the webKnossos data store interface and other alternative data storage servers (e.g BossDB) or static files hosted on Cloud Storage (e.g. Neuroglancer Precomputed)Available Adapaters / Supported Data Formats:BossDBNeuroglancer PrecomputedWKWTiled TIFFUsage1. Installation / DockerInstall webKnossos-connect using Docker or use the instructions for native installation below.docker-compose up --build webknossos-connect2. Connecting to webKnossosRegister your webknossos-connect instance with your main webKnossos instance. Modify the webKnossos Postgres database:INSERT INTO "webknossos"."datastores"("name","url","publicurl","key","isscratch","isdeleted","isforeign","isconnector")
VALUES (E'connect', E'http://localhost:8000', E'http://localhost:8000', E'secret-key', FALSE, FALSE, FALSE, TRUE);3. Adding DatasetsAdd and configure datasets to webKnossos-connect to make them available for viewing in webKnossos3.1 REST APIYou can add new datasets to webKnossos-connect through the REST interface. POST a JSON configuration to:http://<webKnossos-connect>/data/datasets?tokenThe accesstokencan be obained from your user profile in the webKnossos main instance.Read more in the webKnosssos docs.Example JSON body. More examples can be foundhere.{
    "boss": {
        "Test Organisation": {
            "ara": {
                "domain": "https://api.boss.neurodata.io",
                "collection": "ara_2016",
                "experiment": "sagittal_50um",
                "username": "<NEURODATA_IO_USER>",
                "password": "<NEURODATA_IO_PW>"
            },
        }
    },
    "neuroglancer": {
        "Test Organisation": {
            "fafb_v14": {
                "layers": {
                    "image": {
                        "source": "gs://neuroglancer-fafb-data/fafb_v14/fafb_v14_clahe",
                        "type": "image"
                    }
                }
            }
        }
    },
    "tiff": {
        "Test Organization": {
            "my_2d_tiff_dataset": {
                "scale": [2.1,2.1]
            }
        }
    }
}Note that tiff datasets are hosted locally. Create compatible tifs withvips tiffsave source.tif color.tif --tile --pyramid --bigtiff --compression none --tile-width 256 --tile-height 256and save the generatedcolor.tiffile atdata/binary/sample_organization/my_2d_tiff_dataset.CURL Examplecurl http:/<webKnossos-connect>/data/datasets -X POST -H "Content-Type: application/json" --data-binary "@datasets.json"3.2 webKnossos UIAlternatively, new datasets can be added directly through the webKnossos UI. Configure and import a new datasets from the webKnossos dashboard. (Dashboard -> Datasets -> Upload Dataset -> Add wk-connect Dataset)Read more in the webKnossos docs.3.3 Default test datasetsBy default, some public datasets are added to webKnossos-connect to get you started when using the Docker image.DevelopmentIn Docker :whale:Start it withdocker-compose up devRun other commandsdocker-compose run --rm dev pipenv run lintCheck belowfor moar commands.If you change the packages, rebuild the image withdocker-compose build devNativeInstallationYou need Python 3.8 withpoetryinstalled.pipinstallpoetry
poetryinstallRunAdd webknossos-connect to the webKnossos database:INSERT INTO "webknossos"."datastores"("name","url","publicurl","key","isscratch","isdeleted","isforeign","isconnector")
VALUES (E'connect', E'http://localhost:8000', E'http://localhost:8000', E'secret-key', FALSE, FALSE, FALSE, TRUE);python -m wkconnectcurl http://localhost:8000/api/neuroglancer/Demo_Lab/test \
  -X POST -H "Content-Type: application/json" \
  --data-binary "@datasets.json"MoarUseful commands:Lint withpylint&flake8Format withblack,isort&autoflakeType-check withmypyBenchark withtimeitTrace withpy-spyUse the commands:scripts/pretty.shscripts/pretty-check.shscripts/lint.shscripts/type-check.shbenchmarks/run_all.shTrace the server onhttp://localhost:8000/trace.LicenseAGPLv3
Copyrightscalable minds