{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "id": "X1A9BoWNMjdT" }, "outputs": [], "source": [ "from caveclient import CAVEclient" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# List available annotation tables" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "id": "9FjgR8bxPI2K" }, "outputs": [ { "data": { "text/plain": [ "['h01_c3_flat', 'fish1_full', 'fish1_test']" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "url = \"https://global.brain-wire-test.org/\"\n", "datastack = \"fish1_full\"\n", "client = CAVEclient(datastack_name=datastack, server_address=url)\n", "client.info.get_datastacks()" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "SZOWBNUQPL4M", "outputId": "0f74678e-205c-4b3b-b055-806d8d42f7cf" }, "outputs": [ { "data": { "text/plain": [ "['synapses_axax', 'synapses_axde', 'synapses_axax_test']" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# get existing tables\n", "all_tables = client.annotation.get_tables()\n", "all_tables" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Create a table\n", "To create a table a description and a table schema is required. A list of available schemas can be found [here](https://global.brain-wire-test.org/schema/views/). \n" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "id": "Qu-2roASRZwi" }, "outputs": [], "source": [ "# create a new table\n", "table_name = \"soma_ids_locations\"\n", "description = \"\"\" \n", "This table contains soma IDs and their locations. The patient's position of the soma and the tag are the soma's fixed ID numbers. Data source: gs://fish1-public/lores_cbs_231218\"\"\"\n", "schema_name = \"bound_tag\"" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "Kb3182KOPP5Q", "outputId": "571c608a-ea65-40fe-9c3e-e2539b06de62" }, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "client.annotation.create_table(table_name=table_name, \n", " schema_name=schema_name, \n", " description=description, \n", " voxel_resolution=[8, 8, 30])" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['synapses_axax', 'synapses_axde', 'soma_ids_locations']" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "all_tables = client.annotation.get_tables()\n", "all_tables" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "colab": { "provenance": [] }, "kernelspec": { "display_name": "cave_py311", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.9" } }, "nbformat": 4, "nbformat_minor": 4 }