-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpreview.py
More file actions
31 lines (24 loc) · 990 Bytes
/
preview.py
File metadata and controls
31 lines (24 loc) · 990 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
from dicomparser import DICOMParser
import argparse
def parse_args():
"""Parse command line arguments for input file and output folder."""
parser = argparse.ArgumentParser(description='Process input file and output folder.')
parser.add_argument('--input_file', '-i', required=True,
help='Path to the input file')
# Add required arguments
parser.add_argument('--output_folder', '-o', required=True,
help='Path to the output folder')
return parser.parse_args()
def main():
# Parse command line arguments
args = parse_args()
# Print the folder and file names
print(f"Input file: {args.input_file}")
print(f"Output folder: {args.output_folder}")
dicom_file = args.input_file
output_folder = args.output_folder
parser = DICOMParser.create_parser(dicom_file) # Factory method selects subclass
parser.preview(output_folder)
print('Done')
if __name__ == "__main__":
main()