forked from datajoint/workflow-calcium-imaging
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpipeline.py
86 lines (64 loc) · 1.97 KB
/
pipeline.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import datajoint as dj
from element_lab import lab
from element_animal import subject
from element_session import session_with_datetime as session
from element_event import trial, event
from element_calcium_imaging import scan, imaging
from element_lab.lab import Source, Lab, Protocol, User, Location, Project
from element_animal.subject import Subject
from .paths import (
get_imaging_root_data_dir,
get_scan_image_files,
get_scan_box_files,
get_nd2_files,
get_prairieview_files,
)
from . import analysis
if "custom" not in dj.config:
dj.config["custom"] = {}
db_prefix = dj.config["custom"].get("database.prefix", "")
__all__ = [
"subject",
"lab",
"session",
"Equipment",
"trial",
"event",
"scan",
"imaging",
"Subject",
"Source",
"Lab",
"Protocol",
"User",
"Project",
"Session",
"Location",
"get_imaging_root_data_dir",
"get_scan_image_files",
"get_scan_box_files",
"get_nd2_files",
"get_prairieview_files",
]
# ------------- Activate "lab", "subject", "session" schema -------------
lab.activate(db_prefix + "lab")
subject.activate(db_prefix + "subject", linking_module=__name__)
Session = session.Session
Experimenter = lab.User
session.activate(db_prefix + "session", linking_module=__name__)
# Activate "event" and "trial" schema ---------------------------------
trial.activate(db_prefix + "trial", db_prefix + "event", linking_module=__name__)
# ------------- Declare table Equipment for use in element_calcium_imaging -------------
@lab.schema
class Equipment(dj.Manual):
"""Equipment
Attributes:
scanner (str): Scanner used in imaging.
"""
definition = """
scanner: varchar(32)
"""
# ------------- Activate "imaging" schema -------------
imaging.activate(db_prefix + "imaging", db_prefix + "scan", linking_module=__name__)
# ------------- Activate "analysis" schema ------------
analysis.activate(db_prefix + "analysis", linking_module=__name__)