-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdo_img_registration_LGG_PRE.py
More file actions
40 lines (31 loc) · 928 Bytes
/
Copy pathdo_img_registration_LGG_PRE.py
File metadata and controls
40 lines (31 loc) · 928 Bytes
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
# pylint: disable= invalid-name, duplicate-code
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 20 15:02:02 2016
@author: dahoiv
"""
import os
import sqlite3
import image_registration
import util
def find_images():
""" Find images for registration """
conn = sqlite3.connect(util.DB_PATH)
conn.text_factory = str
cursor = conn.execute('''SELECT pid from Patient''')
ids = []
for row in cursor:
cursor2 = conn.execute('''SELECT id from Images where pid = ? AND diag_pre_post = ?''',
(row[0], "pre"))
for _id in cursor2:
ids.append(_id[0])
cursor2.close()
cursor.close()
conn.close()
return ids
# pylint: disable= invalid-name
if __name__ == "__main__":
os.nice(19)
util.setup("LGG_PRE/")
pre_images = find_images()
image_registration.get_transforms(pre_images, image_registration.SYN, save_to_db=True)