-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
54 lines (48 loc) · 2.39 KB
/
main.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
import os
from config import root_directory, LOOP, ROUND, DEBUG_FLG
from handler import try_mkdir, organize_folder
import logging
logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s',
datefmt='%m/%d/%Y %I:%M:%S',
level=logging.DEBUG) # logging.DEBUG, logging.INFO
def main():
logging.info(f"Programming running with Debug Mode: {DEBUG_FLG}")
#########################################
# Step 1: Set up Parameters
##########################################
# File Prefixes ----------
file_base_name1 = "Brightfield_BF_1msec_image_"
file_base_name2 = "DAPI_DAPI_10msec_image_"
file_base_name3 = "GFP_GFP_10msec_image_"
file_base_name4 = "Cy 3_Cy3_50msec_image_"
# Source Directory ----------
directory1 = os.path.join(root_directory, "Brightfield")
directory2 = os.path.join(root_directory, "DAPI")
directory3 = os.path.join(root_directory, "GFP")
directory4 = os.path.join(root_directory, "Cy 3")
# Destination Directory ----------
move_directory1 = directory1
move_directory2 = directory2
move_directory3 = directory3
move_directory4 = directory4
##########################################
# Step 2: Create Directories
##########################################
logging.info("Creating Directories...")
try_mkdir(root_directory, "Analytical Model Fitting", debug=DEBUG_FLG)
try_mkdir(root_directory, "Analysis Code", debug=DEBUG_FLG)
try_mkdir(root_directory, "DAPI Analysis", debug=DEBUG_FLG)
try_mkdir(root_directory, "DAPI+BF", debug=DEBUG_FLG)
try_mkdir(root_directory, "GFP ImageJ Analysis", debug=DEBUG_FLG)
try_mkdir(root_directory, "Cy 3 ImageJ Analysis", debug=DEBUG_FLG)
##########################################
# Step 3: Organize the folders
##########################################
logging.info("Organizing Directories...")
organize_folder(directory1, move_directory1, file_base_name1, loop=LOOP, around=1, debug=DEBUG_FLG)
organize_folder(directory2, move_directory2, file_base_name2, loop=LOOP, around=1, debug=DEBUG_FLG)
# organize_folder(directory3, move_directory3, file_base_name3, loop=LOOP, around=ROUND, debug=DEBUG_FLG)
# TODO: number of images is not 9600 but 6096?
# organize_folder(directory4, move_directory4, file_base_name4, loop=LOOP, around=ROUND, debug=DEBUG_FLG)
if __name__ == "__main__":
main()