Multiple node export now supported

This is a follow up on New export functionality

Exporting multiple nodes is now supported. Right click on a node in the data subject hierarchy, and you should see “Export as…” show up if the clicked node can be exported, or if it has at least one descendant in the hierarchy that can be exported.

export_multiple_feature

export_multiple_feature2

A format and options selector will show up for each node type. So, for example, if all the nodes under a folder have the same type, then there would only be one format and options selector.

As is visible in the screenshot, filename entry is disabled when exporting more than one node. Node name is used automatically.

When it is relevant, a checkbox will show up to let you choose whether or not to include children of the selected item. Another checkbox can also show up to let you choose whether to include children recursively (i.e. include all descendants in the subject hierarchy).

Thanks to @jcfr, @lassoan, and @pieper for their feedback and support throughout this work!

Comments and questions are welcome.

3 Likes

This is great. Is there a way to obtain similar functionality from the python interactor within Slicer?

Exporting a single node can be done with slicer.util.exportNode:
https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#save-volume-to-file

Exporting multiple nodes is not exposed through the nice slicer.util module, but you could always see how qSlicerCoreIOManager::exportNodes is accessed internally in slicer.util.exportNode and follow that as a guide:

The script repository also shows a python implementation of a similar functionality using single node export:

https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#save-files-to-directory-structure-matching-subject-hierarchy-folders

2 Likes

Perfect. Thanks @ebrahim