Skip to content

Commit

Permalink
Merge pull request #18 from arthursw/long-ms-preprocessing
Browse files Browse the repository at this point in the history
Enable to give intermediateFolder (in case creating the tmp/ dir is a problem)
  • Loading branch information
ocommowi authored May 7, 2021
2 parents 99ac5fe + e0df0f1 commit 70f6f50
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ms_lesion_segmentation/animaMSLongitudinalPreprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,17 @@
""")
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).')
parser.add_argument('-t', '--template', type=str, help='Path to the template image used to normalize intensities (optional, skip normalization if not given).')
parser.add_argument('-f', '--intermediate_folder', type=str, help="""Path where intermediate files (transformations, transformed images and rough mask) are stored
(default is an temporary directory created automatically and deleted after the process is finished ;
intermediate files are deleted by default and kept if this option is given).
""")

args = parser.parse_args()

patients = args.input
templateFlair = args.template if args.template else None
output = args.output
intermediateFolder = args.intermediate_folder

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

# Extract brain
call(["python", animaBrainExtraction, "-i", flair, "--mask", mask, "--brain", brain])
call(["python", animaBrainExtraction, "-i", flair, "--mask", mask, "--brain", brain, "-f", intermediateFolder])

masks.append(mask)

Expand Down

0 comments on commit 70f6f50

Please sign in to comment.