[ab8281]: / brats_toolkit / util / prep_utils.py

Download this file

15 lines (11 with data), 383 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
import os
import shutil
from pathlib import Path
def tempFiler(orgFilePath, modality, tempFolder):
stemName = Path(orgFilePath).stem
stemName = stemName.rsplit(".", 2)[0]
stemName = stemName + "_" + modality + ".nii.gz"
tempFile = os.path.join(tempFolder, stemName)
# print("tempFile:", tempFile)
shutil.copyfile(orgFilePath, tempFile)
return tempFile