Batch creation of mrml scenes

I have a series of 3D ultrasounds that I converted to mhd+raw files.

I want to automate the creation of mrml scenes for all my files (> 500 files), to make it easier to visualize by others.

Goal: import mhd+raw -> save as .mrml

Is there any script I can use/adapt?

Thank you,

1 Like

These examples in the script repository should help:

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"

I haven’t tested this code
I don’t know if I understand what you mean