-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathminutiae_dtct.py
More file actions
35 lines (29 loc) · 1.35 KB
/
minutiae_dtct.py
File metadata and controls
35 lines (29 loc) · 1.35 KB
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
import os
import argparse
'''
This Python generates the .xyt files from the given .jpeg or .wsq image,
in addition to the .xyt files, the mindtct, program of NBIS also generates
other formats, which can be removed using a seperate Pyhton file named
'delete_files.py'. Provide the path of the directory containing the images
and path of the directory to store the files generated by the mindtct program.
Make sure that mindtct in available on your path for this code to work
correctly, if your don't want to add mindtct to yout path, change it here.
'''
# Change this according to path in your system,
# Do not change if mindtctc is added to the path
mindtct_path = "mindtct"
os_path_join = os.path.join
def run_mindtct(source_path, save_path):
for image in os.listdir(source_path):
image_name = image.split('.')[0]
os.system(
" ".join([mindtct_path, os_path_join(source_path, image), os_path_join(save_path, image_name)]))
if __name__ == "__main__":
# code for cli arguments
parser = argparse.ArgumentParser(description='desc')
parser.add_argument(
'-p', '--path', help='Required. Path to the source directory', required=True)
parser.add_argument(
'-s', '--save', help='Required. Path to the destination directory', required=True)
args = vars(parser.parse_args())
run_mindtct(args['path'], args['save'])