catmaid 5d笔记4---catmaid 5d数据库表的结构

本文档介绍了在catmaid 5d分支中遇到的问题以及解决思路,包括运行主分支、测试功能、搭建5d分支和使用pdb调试。在这一过程中,需要熟悉django框架和postgresql数据库。接着,作者探讨了catmaid数据库的表结构,并提供查询表定义的命令,为后续分析表间关系奠定了基础。
摘要由CSDN通过智能技术生成

昨天测试了catmaid主分支的Tracing Neurons功能。主分支的功能上都OK。
参考内容:
Instructions for Tracing Neurons
https://catmaid.readthedocs.io/en/stable/tracing_neurons.html

可以5d分支就有各种bugs →_→

现在总结了下:要搞这个事情的思路是
1. 首先应该把catmaid主分支跑起来
2. 测试catmaid主分支的功能,了解catmaid要做什么事情。这个参考catmaid主分支用户文档 https://catmaid.readthedocs.io/en/stable/user.html
3. 把5d分支先搭建起来
4. 学习python的pdb来调试bug

在做上面事情的过程中,需要一些知识储备:
1.要学习django框架,django的高级特性。最好把django玩的比较溜
参考教程:The Django Book
http://djangobook.py3k.cn/2.0/
2.学习postgresql,在这里要掌握基本的sql增删改查知识。以及Postgresql的配置。和postgresql的python接口psycopg2。这里psycopg2知道怎么用。学习一些例子。
参考教程:学习postgresql参考 postgresql官网文档
学习psycopg2参考:PostgreSQL连接Python
http://www.yiibai.com/html/postgresql/2013/080998.html

接下来要说一说catmaid 5d的数据库表的结构了,首先,catmaid数据库里有很多张表

查看每张表的定义:用下面的命令
参考知识:
The Django Book
第5章 模型
http://djangobook.py3k.cn/2.0/chapter05/

python manage.py sqlall catmaid

如下图
这里写图片描述

产生的结果如下:

CREATE TABLE "relation_instance" (
    "id" serial NOT NULL PRIMARY KEY,
    "user_id" integer NOT NULL REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED,
    "creation_time" timestamp with time zone NOT NULL,
    "edition_time" timestamp with time zone NOT NULL,
    "project_id" integer NOT NULL REFERENCES "project" ("id") DEFERRABLE INITIALLY DEFERRED,
    "relation_id" integer NOT NULL REFERENCES "relation" ("id") DEFERRABLE INITIALLY DEFERRED
)
;
CREATE TABLE "class_instance_class_instance" (
    "id" serial NOT NULL PRIMARY KEY,
    "user_id" integer NOT NULL REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED,
    "creation_time" timestamp with time zone NOT NULL,
    "edition_time" timestamp with time zone NOT NULL,
    "project_id" integer NOT NULL REFERENCES "project" ("id") DEFERRABLE INITIALLY DEFERRED,
    "relation_id" integer NOT NULL REFERENCES "relation" ("id") DEFERRABLE INITIALLY DEFERRED,
    "class_instance_a" integer NOT NULL REFERENCES "class_instance" ("id") DEFERRABLE INITIALLY DEFERRED,
    "class_instance_b" integer NOT NULL REFERENCES "class_instance" ("id") DEFERRABLE INITIALLY DEFERRED
)
;
CREATE TABLE "broken_slice" (
    "id" serial NOT NULL PRIMARY KEY,
    "stack_id" integer NOT NULL REFERENCES "stack" ("id") DEFERRABLE INITIALLY DEFERRED,
    "index" integer NOT NULL
)
;
CREATE TABLE "class_class" (
    "id" serial NOT NULL PRIMARY KEY,
    "user_id" integer NOT NULL REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED,
    "creation_time" timestamp with time zone NOT NULL,
    "edition_time" timestamp with time zone NOT NULL,
    "project_id" integer NOT NULL REFERENCES "project" ("id") DEFERRABLE INITIALLY DEFERRED,
    "relation_id" integer NOT NULL REFERENCES "relation" ("id") DEFERRABLE INITIALLY DEFERRED,
    "class_a" integer NOT NULL REFERENCES "class" ("id") DEFERRABLE INITIALLY DEFERRED,
    "class_b" integer NOT NULL REFERENCES "class" ("id") DEFERRABLE INITIALLY DEFERRED
)
;
CREATE TABLE "message" (
    "id" serial NOT NULL PRIMARY KEY,
    "user_id" integer NOT NULL REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED,
    "time" timestamp with time zone NOT NULL,
    "read" boolean NOT NULL,
    "title" text NOT NULL,
    "text" text,
    "action" text
)
;
CREATE TABLE "settings" (
    "key" text NOT NULL PRIMARY KEY,
    "value" text
)
;
CREATE TABLE "textlabel" (
    "id" serial NOT NULL PRIMARY KEY,
    "type" varchar(32) NOT NULL,
    "text" text NOT NULL,
    "colour" rgba NOT NULL,
    "font_name" text,
    "font_style" text,
    "font_size" double precision NOT NULL,
    "project_id" integer NOT NULL REFERENCES "project" ("id") DEFERRABLE INITIALLY DEFERRED,
    "scaling" boolean NOT NULL,
    "creation_time" timestamp with time zone NOT NULL,
    "edition_time" timestamp with time zone NOT NULL,
    "deleted" boolean NOT NULL
)
;
CREATE TABLE "textlabel_location" (
    "id" serial NOT NULL PRIMARY KEY,
    "textlabel_id" integer NOT NULL REFERENCES "textlabel" ("id") DEFERRABLE INITIALLY DEFERRED,
    "location" double3d NOT NULL,
    "deleted" boolean NOT NULL
)
;
CREATE TABLE "location" (
    "id" serial NOT NULL PRIMARY KEY,
    "user_id" integer NOT NULL REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED,
    "project_id" integer NOT NULL REFERENCES "project" ("id") DEFERRABLE INITIALLY DEFERRED,
    "creation_time" timestamp with time zone NOT NULL,
    "edition_time" timestamp with time zone NOT NULL,
    "editor_id" integer NOT NULL REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED,
    "location" double3d NOT NULL,
    "reviewer_id" integer NOT NULL,
    "review_time" timestamp with time zone NOT NULL,
    "location_t" integer NOT NULL,
    "location_c" integer NOT NULL
)
;
CREATE TABLE "treenode" (
    "id" serial NOT NULL PRIMARY KEY,
    "user_id" integer NOT NULL REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED,
    "project_id" integer NOT NULL REFERENCES "project" ("id") DEFERRABLE INITIALLY DEFERRED,
    "creation_time" timestamp with time zone NOT NULL,
    "edition_time" timestamp with time zone NOT NULL,
    "editor_id" integer NOT NULL REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED,
    "location" double3d NOT NULL,
    "parent_id" integer,
    "radius" double precision NOT NULL,
    "confidence" integer NOT NULL,
    "skeleton_id" integer NOT NULL REFERENCES "class_instance" ("id") DEFERRABLE INITIALLY DEFERRED,
    "reviewer_id" integer NOT NULL,
    "review_time" timestamp with time zone NOT NULL,
    "location_t" integer NOT NULL,
    "location_c" integer NOT NULL
)
;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值