-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgrail_conversion_KONT.py
57 lines (44 loc) · 1.49 KB
/
grail_conversion_KONT.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
"""
@author: Arthur Garon, Thomas Seidel
Department of Pharmaceutical Sciences
University of Vienna
"""
import sys
import os
import CDPL.Grid as Grid
import CDPL.Math as Math
import argparse
from common import *
def parseArguments():
parser = argparse.ArgumentParser(description='>>> Generate kont files (GRID program format) from a grid.cdf file.')
parser.add_argument('-gcdf',
dest='gcdf',
required=True,
help='[Required] The path of the grid.cdf file',
nargs=1)
parser.add_argument('-o',
dest='output',
help='[Optional] The output folder where the kont files will be generated (Default: current directory)',
nargs=1,
default=None)
parser.add_argument('-fi',
dest='frame_index',
help='[Optional] Index of the frame to consider (Default: 0)',
nargs=1,
default=None)
parse_args = parser.parse_args()
return parse_args
if __name__ == '__main__':
args = parseArguments()
gcdf = args.gcdf[0]
if args.output is None:
output = './'
else:
output = args.output[0]
if output[-1] != '/':
output += '/'
if args.frame_index is None:
frame_index = 0
else:
frame_index = int(args.frame_index[0])
kont_conversion(gcdf, frame_index, output)