Creating Models in Unity
By Shreya D'Souza
This tutorial goes through how to view models of medical data (in this case MRIs) in Unity. Viewing medical files in Unity has been explored, but I have yet to see a tutorial online that does not require several plugins that are potentially not compatible with all types of operating systems. The reason for this is that many medical data models are saved as .vtk files, which cannot be directly imported into Unity without using some sort of downloaded asset (the ones currently recommended include VTKUnity-MedicalViewer, which is only available on Windows).
This tutorial relies on the fact that Slicer allows users to save models as .stl files and assumes that a model has already been created in Slicer. To learn how to create a model in Slicer follow the following tutorials:
EXPORTING SLICER MODELS AS .STL FILES
Open your Slicer File with the generated model
Click on the "Save" Button
Select any files you want to visualize in Unity, and ensure that their file type is set to .stl
Download Blender here
Delete any of the default files under the collection hierarchy on the right side of the screen
Import the four .stl files
Export each .stl file as an .obj file, taking care to make sure that you are selecting the "Selection only" option on the right side of the save window.
Download Unity here
Create a new Unity File
Add the newly-created .obj files to the assets folder of Unity
Drag each .obj to the Sample Scene in the hierarchy. You should see a brain that is opaque and white.
Click on Assets > Create > Material. This should create a spherical object in the assets folder.
Open the inspector for the material object and change the white colour to your desired colour.
Drag the material object in the assets folder to the object in the scene. This should change the colour of the object.
When creating the material for the brain tissue, select the transparent rendering mode. Change the colour and opacity in the colour picker so that you can see the tumour segments within the brain tissue.