source_dir='C:\\mhddir\\'
for parent, dirnames, filenames in os.walk(source_dir):
for filename in filenames:
mhdfile = os.path.join(parent, filename)
if mhdfile.endswith(".mhd"):
[success, mhdNode] = slicer.util.loadVolume(mhdfile, returnNode=True)
sceneSaveFilename ="c:\\test.mrb"
slicer.util.saveScene(sceneSaveFilename)
I haven’t tested this code
I don’t know if I understand what you mean