|
4 | 4 | from importlib.metadata import version |
5 | 5 | from multiprocessing import cpu_count |
6 | 6 |
|
7 | | -from rawtools import convert, generate, nsihdr, qualitycontrol, log, raw2img |
| 7 | +from rawtools import convert, generate, log, qualitycontrol, raw2img |
8 | 8 |
|
9 | 9 | __version__ = version('rawtools') |
10 | 10 |
|
11 | 11 | def main(): |
12 | 12 | """Console script for rawtools.""" |
13 | | - parser = argparse.ArgumentParser() |
14 | | - parser.add_argument('_', nargs='*') |
15 | | - args = parser.parse_args() |
16 | | - |
17 | | - print("Arguments: " + str(args._)) |
18 | | - print("Replace this message by putting your code into " |
19 | | - "rawtools.cli.main") |
20 | 13 | return 0 |
21 | 14 |
|
22 | 15 | def raw_convert(): |
@@ -69,19 +62,27 @@ def raw_generate(): |
69 | 62 | generate.main(args) |
70 | 63 |
|
71 | 64 | def raw_nsihdr(): |
72 | | - description = "This tool converts a NSI project from 32-bit float to 16-bit unsigned integer format, and it extracts the midslice and generates a side-view projection of the volume." |
| 65 | + description = "This tool converts a NSI project from 32-bit float to 16-bit unsigned integer format." |
73 | 66 |
|
74 | 67 | parser = argparse.ArgumentParser(description=description, formatter_class=argparse.ArgumentDefaultsHelpFormatter) |
75 | 68 | parser.add_argument("-V", "--version", action="version", version=f'%(prog)s {__version__}') |
76 | | - parser.add_argument("-v", "--verbose", action="store_true", help="Increase output verbosity") |
| 69 | + parser.add_argument("-v", "--verbose", action="store_true", default=False, help="Increase output verbosity") |
77 | 70 | parser.add_argument("-f", "--force", action="store_true", default=False, help="Force file creation. Overwrite any existing files.") |
78 | | - parser.add_argument('path', metavar='PATH', type=str, nargs='+', help='List of .nsihdr files') |
| 71 | + parser.add_argument("--gui", action="store_true", default=False, help="(Experimental) Enable GUI") |
| 72 | + parser.add_argument('path', metavar='PATH', type=str, nargs="+", help='List of .nsihdr files') |
79 | 73 | args = parser.parse_args() |
80 | 74 |
|
81 | 75 | args.module_name = 'nsihdr' |
82 | 76 | log.configure(args) |
83 | 77 |
|
84 | | - rt.nsihdr.main(args) |
| 78 | + # Use a GUI to select the source directory |
| 79 | + if args.gui == True: |
| 80 | + from rawtools.gui import nsihdr |
| 81 | + nsihdr.App(args) |
| 82 | + # Otherwise, assume CLI use |
| 83 | + else: |
| 84 | + from rawtools import nsihdr |
| 85 | + nsihdr.main(args) |
85 | 86 |
|
86 | 87 | def raw_qc(): |
87 | 88 | """Quality control tools""" |
|
0 commit comments