昨天测试了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
)
;