Skip to content

Commit e0df0f1

Browse files
committed
enable to give intermediateFolder
1 parent c1e02a2 commit e0df0f1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ms_lesion_segmentation/animaMSLongitudinalPreprocessing.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,17 @@
4242
""")
4343
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).')
4444
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+
""")
4549

4650
args = parser.parse_args()
4751

4852
patients = args.input
4953
templateFlair = args.template if args.template else None
5054
output = args.output
55+
intermediateFolder = args.intermediate_folder
5156

5257
# The configuration file for anima is ~/.anima/config.txt (can be overridden with -a and -s arguments)
5358
configFilePath = os.path.join(os.path.expanduser("~"),'.anima', 'config.txt')
@@ -112,7 +117,7 @@ def call(command):
112117
mask = os.path.join(patientOutput, flairName.replace('.nii.gz', '_mask.nii.gz'))
113118

114119
# Extract brain
115-
call(["python", animaBrainExtraction, "-i", flair, "--mask", mask, "--brain", brain])
120+
call(["python", animaBrainExtraction, "-i", flair, "--mask", mask, "--brain", brain, "-f", intermediateFolder])
116121

117122
masks.append(mask)
118123

0 commit comments

Comments
 (0)