Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
b411724
making the path optional in dataset, and layers
Aug 26, 2025
ba1fac5
typecheck. format. lint
Aug 26, 2025
20a84d0
add default for version. fix structuring
Aug 27, 2025
02c4685
fix more type errors
Aug 27, 2025
821dead
Merge branch 'master' of github.com:scalableminds/webknossos-libs int…
Sep 1, 2025
7b8e19b
add reserve manual upload.
Sep 2, 2025
87d1415
implement upload on dataset object.
Sep 2, 2025
8a2e741
Merge branch 'master' of github.com:scalableminds/webknossos-libs int…
Sep 3, 2025
1b3439d
update to api_version 11
Sep 3, 2025
69a6035
use enrich_path
Sep 3, 2025
b65135e
remove status from valid DatasetProperties
Sep 3, 2025
fb12c23
add default argument
Sep 3, 2025
004e656
always ask for included paths in dataset_info
Sep 3, 2025
b6b83c7
make dataset.path and layer.path optional
Sep 11, 2025
7b3cb28
moved dataset_properties
Sep 11, 2025
0ed681e
format
Sep 11, 2025
20b3e85
fix ruff for __init__
Sep 11, 2025
f9823f6
fix missing import
Sep 11, 2025
3804399
fix copy of attachments
Sep 11, 2025
8106055
fix imports
Sep 12, 2025
f719f79
fix import
Sep 12, 2025
dc51517
move layer_categories.py
Sep 12, 2025
ae47ced
reorder code in structuring
Sep 12, 2025
3a14b90
reorder is None check
Sep 12, 2025
9a8d31a
improve comment
Sep 12, 2025
c800547
move layer category
Sep 12, 2025
7176b0e
move imports
Sep 12, 2025
947ae35
no need for conversion anymore
Sep 12, 2025
15d8482
fix disambiguate
Sep 12, 2025
043a3dc
fix schema
Sep 12, 2025
ebbead2
wk now has lower case user emails
Sep 12, 2025
3500d9d
wk now has lower case user emails
Sep 12, 2025
5d822db
missing 7 cassettes.
Sep 12, 2025
5d016cc
elaborate comment about legacy field DatasetProperties.id
fm3 Sep 15, 2025
f31799a
add_attachment_as_copy now supports RemoteDatasets
Sep 15, 2025
0bae0c9
don't use RemoteDataset type
Sep 15, 2025
ae25d55
fix user names
Sep 15, 2025
b488f5e
missing one cassette
Sep 15, 2025
34f75f8
Merge branch 's3_remote_datasets' of github.com:scalableminds/webknos…
Sep 15, 2025
b41e219
separate type names and container names
Sep 16, 2025
be2a790
do not pass includePaths
Sep 16, 2025
a4b13e3
all cassettes!
Sep 16, 2025
d65b726
allow add_attachment_as_copy to publish attachments to remote datasets
Sep 16, 2025
7ff509c
Merge branch 'master' of github.com:scalableminds/webknossos-libs int…
Sep 16, 2025
80b18d2
update cassettes
Sep 16, 2025
7a6ab6e
rename manual_upload to upload_to_path*s
fm3 Sep 17, 2025
5239295
Adapt reserve routes to pass dataset_id in path; add new reserve_data…
fm3 Sep 17, 2025
8f2a182
remove default for version
Sep 17, 2025
bcf8c19
add publish_to_preliminary_dataset
Sep 17, 2025
5311b77
add announce_dataset_upload.py
Sep 18, 2025
56ca7c7
update docs
Sep 18, 2025
d510f47
Merge branch 'master' into s3_remote_datasets
valentin-pinkau Sep 18, 2025
0a25507
allow moving of the data when publishing
Sep 18, 2025
5109ca2
Merge remote-tracking branch 'origin/s3_remote_datasets' into s3_remo…
Sep 18, 2025
a8489d3
use dataset updatePartial, update snapshots
fm3 Sep 18, 2025
2a1ffc2
Merge branch 's3_remote_datasets' of github.com:scalableminds/webknos…
fm3 Sep 18, 2025
20b4093
Allow saving RemoteDataset DatasetProperties changes back to server
fm3 Sep 18, 2025
fc56dcd
in case of symlink, directly link, no move
Sep 22, 2025
cc7f29d
rename
Sep 22, 2025
d7c1686
add env variable to __init__.py
Sep 22, 2025
3fed75a
move layer to link
Sep 22, 2025
4039eda
consolidate upload
Sep 22, 2025
e3f2ca6
Revert "move layer to link"
Sep 22, 2025
a42fe2f
format
Sep 22, 2025
6994821
use corrent variable
Sep 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions docs/src/webknossos-py/examples/announce_dataset_upload.md

This file was deleted.

9 changes: 9 additions & 0 deletions docs/src/webknossos-py/examples/publish_to_webknossos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Publish dataset to WEBKNOSSOS

This example demonstrates the process of uploading a Dataset.

```python
--8<--
webknossos/examples/publish_to_webknossos.py
--8<--
```
30 changes: 0 additions & 30 deletions webknossos/examples/announce_dataset_upload.py

This file was deleted.

30 changes: 10 additions & 20 deletions webknossos/examples/apply_merger_mode.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
from pathlib import Path

import fastremap

import webknossos as wk

TESTDATA_DIR = Path(__file__).parent.parent / "testdata"


def main() -> None:
####################################
Expand All @@ -17,15 +13,14 @@ def main() -> None:
).skeleton

###############################################
# Download and open the corresponding dataset #
# Open the corresponding dataset #
###############################################

dataset = wk.Dataset.download(
input_dataset = wk.Dataset.open_remote(
"l4_sample",
bbox=wk.BoundingBox((3457, 3323, 1204), (40, 10, 10)),
path="testoutput/l4_sample",
organization_id="scalable_minds",
)
in_layer = dataset.get_segmentation_layer("segmentation")
in_layer = input_dataset.get_segmentation_layer("segmentation")
in_mag1 = in_layer.get_mag("1")

##############################
Expand All @@ -51,8 +46,10 @@ def main() -> None:
############################
# Creating an output layer #
############################

out_layer = dataset.add_layer(
output_dataset = wk.Dataset(
"testoutput/l4_sample", voxel_size=input_dataset.voxel_size
)
out_layer = output_dataset.add_layer(
"segmentation_remapped",
wk.SEGMENTATION_CATEGORY,
dtype_per_channel=in_layer.dtype_per_channel,
Expand Down Expand Up @@ -83,16 +80,9 @@ def apply_mapping_for_chunk(args: tuple[wk.View, wk.View, int]) -> None:
########################################

out_layer.downsample()
dataset.delete_layer("segmentation")
dataset.upload(
output_dataset.upload(
"l4_sample_remapped",
layers_to_link=[
wk.LayerToLink(
dataset_name="l4_sample",
layer_name="color",
organization_id="scalable_minds",
)
],
layers_to_link=[input_dataset.get_layer("color")],
)


Expand Down
3 changes: 1 addition & 2 deletions webknossos/examples/create_dataset_from_images.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from pathlib import Path

from webknossos import Dataset
from webknossos.dataset import COLOR_CATEGORY
from webknossos import COLOR_CATEGORY, Dataset

INPUT_DIR = Path(__file__).parent.parent / "testdata" / "tiff"
OUTPUT_DIR = Path("testoutput/my_tiff_dataset")
Expand Down
3 changes: 1 addition & 2 deletions webknossos/examples/image_stack_to_dataset.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from pathlib import Path

from webknossos import Dataset
from webknossos.dataset import COLOR_CATEGORY
from webknossos import COLOR_CATEGORY, Dataset

INPUT_FILES = (
Path(__file__).parent.parent / "testdata" / "tiff" / "test.0000.tiff",
Expand Down
32 changes: 32 additions & 0 deletions webknossos/examples/publish_to_webknossos.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import webknossos as wk
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import as wk or import directly. I wouldn't mix both.

from webknossos import LayerToLink
from webknossos.dataset.remote_folder import RemoteFolder
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
from webknossos.dataset.remote_folder import RemoteFolder
from webknossos import RemoteFolder



def main() -> None:
# Get the folder id of the upload destination:
folder_id = RemoteFolder.get_by_path("Datasets/").id

# Open your unpublished dataset
dataset = wk.Dataset.open("my_dataset.wkw")

existing_dataset = wk.Dataset.open_remote(
"https://webknossos.org/datasets/liconn_expid82-678f98e3010000dd017f4449/#3825,4866,795,0,1.3"
)
# Publish the dataset to webknossos
# The data will be uploaded to the upload destination folder
dataset.upload(
new_dataset_name="my_new_dataset_name",
folder_id=folder_id,
layers_to_link=[
LayerToLink(
existing_dataset.dataset_id,
layer_name="image_230130b",
new_layer_name="image",
)
],
)


if __name__ == "__main__":
main()
4 changes: 2 additions & 2 deletions webknossos/examples/upload_image_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from skimage import data

import webknossos as wk
from webknossos.dataset import COLOR_CATEGORY
from webknossos.dataset.properties import (
from webknossos import COLOR_CATEGORY
from webknossos.dataset_properties import (
DatasetViewConfiguration,
LayerViewConfiguration,
)
Expand Down
2 changes: 1 addition & 1 deletion webknossos/local_wk_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function ensure_local_test_wk {
echo "Using the already running local webknossos setup at localhost:9000. Make sure l4_sample exists and is set to public first!"
fi

if ! curl -s -H "X-Auth-Token: $WK_TOKEN" localhost:9000/api/user | grep user_A@scalableminds.com > /dev/null; then
if ! curl -s -H "X-Auth-Token: $WK_TOKEN" localhost:9000/api/user | grep user_a@scalableminds.com > /dev/null; then
echo "The login user user_A@scalableminds.com could not be found or changed."
echo "Please ensure that the test-db is prepared by running this in the webknossos repo"
echo "(⚠️ this overwrites your local webknossos database):"
Expand Down
1 change: 1 addition & 0 deletions webknossos/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ dependencies = [
"python-dateutil ~=2.8.0",
"python-dotenv ~=1.0.1",
"rich ~=13.8.0",
"s3fs>=2024.6.1",
"scipy >=1.13",
"tensorstore~=0.1.74",
"typer ~=0.12.5",
Expand Down

Large diffs are not rendered by default.

Loading
Loading