3D Print Your Own Brain

36,098

269

33

Introduction: 3D Print Your Own Brain

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

  1. Install VirtualBox for "Windows hosts x86/amd64" from this link (~110MB)
  2. Download and extract the FreeSurfer Virtualbox (Xubuntu) image from here (the last link, ~9GB)
  3. 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.)

  1. Exctract the files and open dcm2niigui.exe
  2. Click "file->DICOM to NIFTI"
  3. Select folder with your DICOM files inside and click "open"
  4. The programm should run for a few seconds
  5. 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.

Peparation:

This step is necessary to allow easy drag&drop between the host and the guest system

  1. Open the VirtualBox and start the FreeSurfer image
  2. Click on Device -> Insert Guest Addition CD image
  3. Double click "autorun.sh", insert sudo password "freesurfer"
  4. Restart the virtual machine (upper right corner "fsuser" -> restart)

Brain exctraction

  1. Drag your NIFTI file (brainscan.nii.gz in my case) to the Desktop of the Virtual Machine
  2. Open the Terminal
  3. 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)
  4. 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.

  1. Download and install MeshLab from sourceforge (~35MB)
  2. Start MeshLab and import lh.stl and rh.stl (left and right hemisphere) via "File" -> "import mesh". Whatever message comes up, just click ok.
  3. 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.

  1. "Filters" -> "Remeshing, Simplification, Reconstruction" -> "Quadratic Edge Collapse Decimation"
  2. Enter your number of vertices, I took 150.000, which seemed to be simple enough. Click apply.
  3. 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

OR

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.

3 People Made This Project!

Recommendations

  • Hand Tools Only Challenge

    Hand Tools Only Challenge
  • Modify It Speed Challenge

    Modify It Speed Challenge
  • Remix Contest

    Remix Contest

33 Discussions

0
monomgabriel
monomgabriel

8 months ago

Hello and thank you for sharing this knowledge!!
Just a quick question, how can I make sure FreeSurfer is actually computing my brain? I see "Nine parameter search. Iteration 1 nscales = 0 ..."
Is that good or bad ? Hahah
Thank you again <3

0
3d_printed_brain
3d_printed_brain

Reply 8 months ago

yep, that seems correct. it's trying to figure out which parameters are best. that's why it takes so long

0
monomgabriel
monomgabriel

Reply 8 months ago

It seemed to work until I got this error, I suppose it has to do with my computer memory :-(
I have to find a better PC, am I right ?

Excessive topologic defect encountered: could not allocate 140742253 edges for r
etessellation
Cannot allocate memory
Linux xubuntu-Virtua1Box 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:41:14 UTC
2012 1686 1686 1386 GNU/Linux
5 15:27:40 EST 2020
recon-all -s mybrain02 exited with ERRORS at Wed Feb
For more details, see the log file /usr/local/freesurfer/subjects/mybrain02/scri
VBox GApts/recon-all.log

0
3d_printed_brain
3d_printed_brain

Reply 8 months ago

sounds quite like it! how much memory do you have assigned to the virtual machine? and how much do you have in total? although it's a bit strange as the pre-allocated memory of the freesurfer-vmware should have by default enough memory set.

If you want, send it to me and I'll run it for you ;-) just send me a private message

0
monomgabriel
monomgabriel

Reply 8 months ago

I tried with another PC which has'nt more memory and got the same error.
The desktop one (the first) has 8gb RAM in total and 5276 RAM allocated to the VM
The laptop one (the second) has 8gb RAM in total and 8192mb RAM allocated to the VM (the maximum possible)
I attached screenshots of the errors.
In both cases I was'nt able to install Guest Addition CD image (I sent my NIFTI file through email). Might that be a cause of the error?
Thank you for your help, I could'nt attach files to my private message so I attached my NIFTI file here :-)

FreeSurferDesktop.pngFreeSurferLaptop.PNG
0
3d_printed_brain
3d_printed_brain

Reply 8 months ago

Your scan only contains part of your brain. The clinics often only scan a particular region of interest to save time (MRI scans are expensive, so time=money). It's unfortunately not possible to reconstruct it hence.

0
monomgabriel
monomgabriel

Reply 8 months ago

Oh that's a sad news :-(
But how could you know that ?
Thank you for your time Simon

0
roeulogy
roeulogy

10 months ago

So as someone who has recently been diagnosed with MS, this is an oddly cool thing. Just got a printer and going to try this out as I have ample MRI scans to work with. Would make an interesting gift for the Doctor working with me. If anything has changed I'll see if I can update it.

0
JosephO85
JosephO85

2 years ago

What materials have people used to print brains? I was told by a operator on 3D Hubs that PLA isn't possible due to the supports being difficult to remove, so he suggested SLS, but SLS is very expensive.

0
3d_printed_brain
3d_printed_brain

Reply 2 years ago

I've used PLA for all brains I've printed so far. You just need to make sure to place the brain in the right orientation so that the supports will disturb be less visible in the end (placing the supports at the back/bottom). I have, however, found substantial differences in quality from different printers.

Just use a different hub!

brain_new2.jpg
0
Mtroy0620
Mtroy0620

2 years ago

Could someone print me a large (like 10-12" long) brain? What would you charge? Thanks.

0
tandero
tandero

2 years ago

Hey! Looks super-cool.

I get to the point where the instruction is to drag the NIFTI file to the desktop of the VM, but when I do that, nothing happens. I just re-installed the VM and everything and still nothing. Bidirectional Drag&Drop is checked, I did the Guest Additions, restart, and still nothing. No error, the mouse-cursor just turns to the "Unavailable" circle-with-bisecting-line.

My main machine is Windows 7 64bit.

Any advice?

0
3d_printed_brain
3d_printed_brain

Reply 2 years ago

If drag&drop don't work send it to yourself via mail and receive if inside the VM via the web interface of your email client. Cumber-sum but the quickest solution.

0
waterdragon2145
waterdragon2145

3 years ago

Hey,

Sorry this is probably going to sound woefully unspecific, but I've now tried to run my NIFTI files on three separate occasions and each time it has "exited with ERRORS" and has failed to produce a PIAL file. I'm running the virtual machine with 4 Gigs of RAM and each time the cycle has run for about 12 hours. I am using the largest file size file from the DICOM to NIFTI conversion. Any thoughts/recommendations?

Marc Chmielewski

0
3d_printed_brain
3d_printed_brain

Reply 2 years ago

what error exactly? You probably have to look into the FreeSurfer support to ask for help (it's open source, so don't expect too much help). Have you tried using the the DICOM as input (look in the FreeSurfer documentation for help)?

0
frarugi87
frarugi87

3 years ago

Sorry, but... Why don't you use a 3D scanner instead of the MRI? You only need to remove the brain from the cranium, but just remember to put it back like it was before and you should be ok...

0
linda1234c
linda1234c

3 years ago

do you need to use you mri scans, or can you use a picture of one from google?

0
3d_printed_brain
3d_printed_brain

Reply 3 years ago

you can certainly use any MRI scan that you want. But it needs to be a whole scan, not just an image from Google images.

0
commander574
commander574

4 years ago

would this work on annoying people? To the best of my knowledge they don't have brains

0
dddman
dddman

4 years ago

8 hours of computing later I'm ready to heat up the 3D printer!!!