Hi all,
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:
Old style:
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))
New style:
from pathlib import Path
myDir = Path('/tmp/images')
for file in myDir.glob('**/*.nrrd'):
loadVolume(str(file)) # need str until pathlib is supported
Here are some issues from big Python libraries:
nibabel
pandas
numpy
PIL
matplotlib
Let me know if I can help.