From 041c7859e64fe35b0e52064e908267b681279153 Mon Sep 17 00:00:00 2001 From: Paul Elliott Date: Tue, 10 Sep 2024 16:56:19 -0400 Subject: [PATCH] feat: add pipeline_cli.py --- oai_analysis/pipeline_cli.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 oai_analysis/pipeline_cli.py diff --git a/oai_analysis/pipeline_cli.py b/oai_analysis/pipeline_cli.py new file mode 100644 index 0000000..c49d31e --- /dev/null +++ b/oai_analysis/pipeline_cli.py @@ -0,0 +1,24 @@ +# Usage +# python oai_analysis/pipeline_cli.py oai_analysis/data/test_data/colab_case/image_preprocessed.nii.gz OAI_results + +import argparse +from pipeline import analysis_pipeline + + +def main(): + parser = argparse.ArgumentParser(description='OAI Analysis CLI') + parser.add_argument('input_path', type=str, help='Path to image file or directory containing DICOM series') + parser.add_argument('output_dir', type=str, help='Directory to make output files') + parser.add_argument( + '--no_intermediates', + action='store_true', + help='Do not write files representing intermediate steps to the output directory', + ) + + args = parser.parse_args() + + analysis_pipeline(args.input_path, args.output_dir, not args.no_intermediates) + + +if __name__ == '__main__': + main()