Skip to content

Commit

Permalink
ENH: Keep the input file format in preprocessing script
Browse files Browse the repository at this point in the history
Keep the input file format in the preprocessing script: make the
destination file have the same extension as the input file.
  • Loading branch information
jhlegarreta committed Oct 12, 2023
1 parent 42d9c86 commit fadb777
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bin/wm_preprocess_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
import argparse
import multiprocessing
from pathlib import Path

import whitematteranalysis as wma

Expand Down Expand Up @@ -171,7 +172,9 @@ def pipeline(inputPolyDatas, sidx, args):
msg = "**Writing output data for subject:", subjectID
print(id_msg, msg)

fname = os.path.join(args.outputDirectory, subjectID+'_pp.vtp')
ext = Path(inputPolyDatas[sidx]).suffixes[0][1:]
fname = os.path.join(args.outputDirectory, subjectID+'_pp'+'.'+ext)

try:
print("Writing output polydata", fname, "...")
wma.io.write_polydata(wm3, fname)
Expand Down

0 comments on commit fadb777

Please sign in to comment.