Changing default mesh files from VTK to OBJ

Operating system: Windows 10
Slicer version: 4.6.2

Hey guys,

I’m using Slicer to create OBJ models of Freesurfer parcellations, which requires going through each individual region and changing the file type from VTK to OBJ (see image below). Changing all ~250 white matter & grey matter region takes about 30 mins per participant.

Does anyone know a quicker way of doing this? Is it possible to change the default mesh file type from VTK to OBJ? Or to subsequently convert the files? Or can it be done in Freesurfer (by a complete novice like myself)?

image

For context, I’ve been using the OBJ files for renderings in [Keyshot] and for EEG data visualisation projects in Unity & Unreal. (https://petersimpsonyoung.github.io/Alexei_VR/Alexei_VR.179.html)

Many thanks,

Peter

I have also wanted to batch-apply a change to all nodes of a specific type.

For a quick solution though, are you using Slicer just to do this conversion? If you are loading all the models from a directory and then immediately re-saving as OBJ, then we could provide a simple script do that in batch for all files in a directory.

You can change default save file format as described here: https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Change_default_file_type_for_nodes_.28that_have_never_been_saved_yet.29

Just below that there is a script that changes file format for existing nodes.

1 Like