Now that Python 3 works with Slicer, are there any plans to add support for the standard
pathlib library? Currently I just cast all the paths to str before feeding them to Slicer functions:
import os myDir = '/tmp/images' for root, dirs, files in os.walk(myDir, topdown=False): for name in files: _, ext = os.splitext(name) if ext == '.nrrd': loadVolume(os.path.join(root, name))
from pathlib import Path myDir = Path('/tmp/images') for file in myDir.glob('**/*.nrrd'): loadVolume(str(file)) # need str until pathlib is supported
Let me know if I can help.