-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into add-zarrarray-as-mag
- Loading branch information
Showing
28 changed files
with
6,014 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Accessing Metadata | ||
|
||
This example show how to access and work with metadata in [remote datasets](../../api/webknossos/dataset/dataset.md#webknossos.dataset.dataset.RemoteDataset) and [remote folders](../../api/webknossos/dataset/remote_folder.md#webknossos.dataset.remote_folder.RemoteFolder). | ||
|
||
```python | ||
--8<-- | ||
webknossos/examples/accessing_metadata.py | ||
--8<-- | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Explore and add Remote Dataset | ||
|
||
This example shows how to create a [remote dataset](../../api/webknossos/dataset/dataset.md#webknossos.dataset.dataset.RemoteDataset) in webknossos from an existing Zarr dataset. | ||
|
||
```python | ||
--8<-- | ||
webknossos/examples/explore_and_add_remote.py | ||
--8<-- | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Teams and Users | ||
|
||
This example uses the [`User` class](../../api/webknossos/administration/user.md#webknossos.administration.user.User) and the [`Team` class](../../api/webknossos/administration/user.md#webknossos.administration.user.Team) to access information about the current user, all managed users and all teams this user is in. It also shows how to add a new team and assign a user as a team manager. | ||
|
||
```python | ||
--8<-- | ||
webknossos/examples/teams_and_users.py | ||
--8<-- | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import webknossos as wk | ||
|
||
|
||
def main() -> None: | ||
with wk.webknossos_context(url="https://webknossos.org/"): | ||
l4_sample_dataset = wk.Dataset.open_remote("l4_sample") | ||
# Access the metadata of the dataset | ||
print(l4_sample_dataset.metadata) | ||
|
||
# Edit the metadata of the dataset | ||
l4_sample_dataset.metadata["new_key"] = "new_value" | ||
|
||
# Access metadata of a folder | ||
print(l4_sample_dataset.folder.metadata) | ||
|
||
# Edit the metadata of the folder | ||
l4_sample_dataset.folder.metadata["new_folder_key"] = "new_folder_value" | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import webknossos as wk | ||
|
||
|
||
def main() -> None: | ||
# Explore a zarr dataset with webknossos by adding it as a remote dataset | ||
wk.RemoteDataset.explore_and_add_remote( | ||
"https://data-humerus.webknossos.org/data/zarr/b2275d664e4c2a96/HuaLab-CBA_Ca-mouse-unexposed-M1/color", | ||
"Ca-mouse-unexposed-M1", | ||
"/Datasets", | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import webknossos as wk | ||
|
||
|
||
def main() -> None: | ||
# Get the current user | ||
current_user = wk.User.get_current_user() | ||
print( | ||
f"You are currently logged in as: {current_user.first_name} {current_user.last_name} ({current_user.email})." | ||
) | ||
|
||
# Get all users managed by the current user | ||
all_my_users = wk.User.get_all_managed_users() | ||
print("Managed users:") | ||
for user in all_my_users: | ||
print(f"\t{user.first_name} {user.last_name} ({user.email})") | ||
|
||
# Get teams of current user | ||
all_my_teams = wk.Team.get_list() | ||
print("Teams:") | ||
for team in all_my_teams: | ||
print(f"\t{team.name} ({team.organization_id})") | ||
|
||
# Add a new team | ||
wk.Team.add("My new team") | ||
|
||
# Set current user as team manager | ||
current_user.assign_team_roles("My new team", is_team_manager=True) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
Oops, something went wrong.