Always wanted to have your very own 3D printed brain?
With modern technique this is possible and do-able for everyone!
The only costs that you will have are the one of the 3D printing.
What you need:
- The raw data of an MRI scan of your brain (T1 scan, but maybe T2 also works). Files should be in NIFTI (.nii or .nii.gz) or DICOM format (.dcm or no file extension). You can easily get a MRI scan by participating in an (f)MRI study of your local university (check the medical/neuroscience/psychology department). Often they even pay you quite well for participation. It's important that you request the raw data. Sometimes the hospital only gives you PNG files, which can not be processed.
- FreeSurfer: In my case I used the version for Virtualbox for Windows. If you use Mac/Linux you will be able to install FreeSurfer directly to your computer and I assume that you have enough computer knowledge to do so. I'm using version 5.3.0, but probably newer versions will work as well.
- MeshLab: To process and refine the mesh.
- (optional) 3D printer
I have found a couple of tutorials on the internet, but non of them really seemed to work for me. I found this instruction, but it was not very detailed and still took me quite long to figure out how to do the individual steps. My instruction here is basically the one that I linked but in a step-by-step manor, so that everyone can follow.
Step 1: Install VirtualBox and FreeSurfer (and Convert DICOM to NIFTI)
(Update September 2017: There is a newer version of FreeSurfer which is not provided for Windows.The instructions were made using FreeSurfer 5.3.0. I provided a link to the old version at point 2.)
These are instructions for Windows. If you have Linux of Mac you can install FreeSurfer directly using the instructions on the FreeSurfer website
- Install VirtualBox for "Windows hosts x86/amd64" from this link (~110MB)
- Download and extract the FreeSurfer Virtualbox (Xubuntu) image from here (the last link, ~9GB)
- Follow these instructions to install FreeSurfer for VirtualBox. I recommend using more Memory than they use (like 2-4GB).
If you have your MRI files in DICOM you can convert them using the dcm2nii tool by MRIcron: win.zip
(If they are already in NIFTI format, then you can skip this step.)
- Exctract the files and open dcm2niigui.exe
- Click "file->DICOM to NIFTI"
- Select folder with your DICOM files inside and click "open"
- The programm should run for a few seconds
- Inside your DICOM folder there should now be one or more .nii.gz files. If in doubt just use the largest one. I renamed it to "brainscan.nii.gz" to make it easier to find and handle.
You can also use DICOM files directly in FreeSurfer, but for simplicity I assume that you use NIFTI files.
(more information to dcm2nii can be found here)
Step 2: Extract Brain Tissue Using FreeSurfer
Brain tissue reconstruction from MRI image is a science on its own. What seems quite easy is actually a computationally demanding task. There are various programs of various complexity do the job. The advantage of FreeSurfer is, that it runs without setting any parameters. This makes it easy to use for people with no neuroscience background.
This step is necessary to allow easy drag&drop between the host and the guest system
- Open the VirtualBox and start the FreeSurfer image
- Click on Device -> Insert Guest Addition CD image
- Double click "autorun.sh", insert sudo password "freesurfer"
- Restart the virtual machine (upper right corner "fsuser" -> restart)
- Drag your NIFTI file (brainscan.nii.gz in my case) to the Desktop of the Virtual Machine
- Open the Terminal
- Type recon-all -s mybrain -all -i /home/fsuser/Desktop/brainscan.nii.gz and press enter, where brainscan.nii.gz is the name of your NIFTI file. (see picture)
- Wait for the process to finish. After finishing it will say something like "[..] mybrain finished without error [..]"
Depending on your computer speed this can take up to 2 days. On my 4x3Ghz it took 12 hours. You can pause and resume the Virtualbox at any time using “Machine->Pause”. This way you can resume the process after turning off your host computer.-
- If you want to speed up this process, you might want to consider giving the virtual machine more RAM and the usage of more CPUs (you can do so in the machine settings). You need to restart the virtual machine after that.
- If the Freesurfer process gets cancelled or crashes you need to use a different subject name (mybrain2) or delete the subject folder to try again.
- What is happening in the background: FreeSurfer will try various things to determine the best brain extraction parameters. It will iterate through thousands of different parameters and see if the results are good or not. This is necessary because every brain is different and requires different parameters.
(If you want any further information on FreeSurfer, please read here)
Step 3: Convert Your Brain to .stl
The computed brain is in .pial format, but what we need is .stl
Luckily FreeSurfer includes a tool to convert the files.
Open a terminal window and type
- mris_convert /usr/local/freesurfer/subjects/mybrain/surf/rh.pial rh.stl
- mris_convert /usr/local/freesurfer/subjects/mybrain/surf/lh.pial lh.stl
- and last: xdg-open /usr/local/freesurfer/subjects/mybrain/surf/ (or alternatively navigate there yourself with the file manager)
Now try to find the two files rh.stl and lh.stl and drag them to you Windows system
One of them is the right hemisphere (rh.stl) left hemisphere (lh.stl).
FreeSurfer can also extract the cerebellum and other parts of the brain, but in this tutorial we'll focus on the hemispheres only. This has one advantages: Your brain will nicely stand on it's own. As the cerebellum is round and at the bottom of your brain, it might not do so with it. I've found a nice tutorial here: https://github.com/miykael/3dprintyourbrain that shows you how to extract it.
Step 4: Install MeshLab and Refine the Mesh
Now you just need to combine the two hemisphere meshes that we obtained from FreeSurfer.
To do so you can use any modeling software, I chose MeshLab as it's free. But be aware: MeshLab does not have an "undo"-Button. So every change you make on the mesh can't be undone, you can only reload your mesh.
- Download and install MeshLab from sourceforge (~35MB)
- Start MeshLab and import lh.stl and rh.stl (left and right hemisphere) via "File" -> "import mesh". Whatever message comes up, just click ok.
- Click on "Filters" -> "Mesh Layer" -> "Flatten Visible Layers" and apply
Now your brain mesh is technically ready to go! Your mesh might only have too vertices (=it is too complex) for most current 3D printers. So we can simplify it.
- "Filters" -> "Remeshing, Simplification, Reconstruction" -> "Quadratic Edge Collapse Decimation"
- Enter your number of vertices, I took 150.000, which seemed to be simple enough. Click apply.
- To make it look nicer, now use "Filters" -> "Smoothing, Fairing and Deformation'" -> "Laplacian Smooth" and just click apply once.
Now you just need to export the brain in whatever format you prefer (File -> Export as).
Step 5: 3D Print Your Brain
Voilà you're done! :)
So either you owning a 3D printer and know what to do with the mesh
You can send your mesh now to a 3D printing service. I printed mine with 3dhubs.com, this is a service where private people provide their printer for you.
If you want, you can also create a chocolate mould and make chocolate brains like these guys.
If you have any questions or feedback, please leave a comment.
If you want to print subcortical parts like the cerebellum, look at these instructions.