|
42 | 42 | """) |
43 | 43 | parser.add_argument('-o', '--output', type=str, required=True, help='Output folder where the processed data will be saved (it will follow the same file structure as the input folder).') |
44 | 44 | parser.add_argument('-t', '--template', type=str, help='Path to the template image used to normalize intensities (optional, skip normalization if not given).') |
| 45 | +parser.add_argument('-f', '--intermediate_folder', type=str, help="""Path where intermediate files (transformations, transformed images and rough mask) are stored |
| 46 | + (default is an temporary directory created automatically and deleted after the process is finished ; |
| 47 | + intermediate files are deleted by default and kept if this option is given). |
| 48 | + """) |
45 | 49 |
|
46 | 50 | args = parser.parse_args() |
47 | 51 |
|
48 | 52 | patients = args.input |
49 | 53 | templateFlair = args.template if args.template else None |
50 | 54 | output = args.output |
| 55 | +intermediateFolder = args.intermediate_folder |
51 | 56 |
|
52 | 57 | # The configuration file for anima is ~/.anima/config.txt (can be overridden with -a and -s arguments) |
53 | 58 | configFilePath = os.path.join(os.path.expanduser("~"),'.anima', 'config.txt') |
@@ -112,7 +117,7 @@ def call(command): |
112 | 117 | mask = os.path.join(patientOutput, flairName.replace('.nii.gz', '_mask.nii.gz')) |
113 | 118 |
|
114 | 119 | # Extract brain |
115 | | - call(["python", animaBrainExtraction, "-i", flair, "--mask", mask, "--brain", brain]) |
| 120 | + call(["python", animaBrainExtraction, "-i", flair, "--mask", mask, "--brain", brain, "-f", intermediateFolder]) |
116 | 121 |
|
117 | 122 | masks.append(mask) |
118 | 123 |
|
|
0 commit comments