You Own Your MRI Brainscan; Do Something Interesting With It

The most complicated and fascinating gadget you will ever own is your brain. Why not pay tribute to this wonder by creating a 3D scale model that you can print yourself? If you have had a full-head MRI scan, it is simple to take this data and create a 3D model that you can print out on any 3D printer. Here’s how to print your brain.

To begin, you are going to need an MRI scan. Unfortunately, the low-field MRI that [Peter Jansen] is working on won’t quite cut it (yet): you’ll have to get the pros to do it. The type of scan also matters, because we want a scan that focusses in on the brain itself, not the bits around it. What type you get depends on what your doctor wants to know, as the radiologist can run a lot of different scans and analysis of the data to show different types of tissue. After looking through the scans that I got, I settled on one that was labelled eB1000i(BRAIN) With and Without Contrast. To a radiologist, that information means a lot, telling you what type of scan it is, and that it was done with a contrast agent, a metal dye that is injected to make water-rich tissues (like my brain) more visible. The number refers to something called the diffusion weighting, which helps the doctor look for swelling that can indicate things like strokes, tumors, etc. There’s a good guide to some of the jargon here.

Request your DICOM Data

If you are having an MRI, you can request a CD immediately after the scan, or contact your doctor: as a patient, you have a right to a copy of this data. You’ll receive a CD that includes the MRI images in a format called DICOM. Short for Digital Images and Communications in Medicine, this is an open format that is used by most medical systems. The CD will include a Windows program that allows you to view these files, which is worth checking out, as scrolling through your own brain is a rather surreal experience. If you haven’t had an MRI, there are a lot of sample scans available that you can use. Osirix offers a few of the brain (and other bits), and there are a number of scans available here.

Phillips MRI
A Phillips MRI Machine [Image by Jan Ainali CC BY]
Magnetic Resonance Imaging is a fascinating bit of science where a very strong magnetic field is used to excite the water atoms in your body. After the hydrogen atoms in these molecules are excited by this field, they emit a radio signal, which the MRI machine detects. By shaping the magnetic field, the MRI gradually maps the brain, figuring out which tissues have lots of water (such as blood vessels) and which have less, such as bone. The device gradually combines this info into images of your insides without having to actually get in there and poke them. If you are interested in the physics and mathematics of this process, there is an in-depth guide here.

To process and convert these images, there are several free and open source programs available, such as Slicerweb, Osirix, 3DSlicer and Invesialus. These all have their own pros and cons, but I’m going to use Invesalius in this tutorial, as it is the easiest to work with and is available for windows, mac and Linux.

Your Brain in Software

Once you have installed the program, open it and select Import DICOM Images. If you had several different series of scans done, you can load them all at once: just select the top level directory of the CD, and the program will go into each directory and sort them so you can select the best scan. After it loads the files, it will show you previews of each scan. Choose the one that shows the brain the clearest, with as little of the rest of you as possible. To load these images for analysis, select import.

After loading the scans into Invesalius, you create the masks (in green)
After loading the scans into Invesalius, you create the masks (in green)

This will load the scan images, and show you four windows. Three of these are views (or slices, as the pros call them) through your head from different angles: from the top (Axial), the side (Sagittal) and the front(Coronal). The fourth will be blank at the moment: that is where the 3D model will show up. You can scan through the images for each view using the scroll bars on the side of the window.

Next, we are going to pick out the bits we are interested in. This is done using a mask, where you pick the good bits and discard the rest. This mask works like a narrowpass filter: you can create a narrow band of stuff you want, and disregard the rest. On the left is a window with a slider in it. When you change the upper and lower boundaries of this slider, you will see that the selected area of the scan (shown in green) changes. You want to set this so that as much of the brain is selected and as little of everything else. The program does offer a number of presets for different types of tissue from the drop-down menu, but I found that the custom preset was more effective. Again, you can scroll through the images using the scroll bar to the left of each window to see how the different slices are being masked. If you are having problems making a clean mask, click on manual edition and use the erase brush to get rid of the bits that are not brain. 

The 3D surface has been created (bottom right)
The 3D surface has been created (bottom right)

When you are done, hit the create surface button. After some pondering, the program will create the 3D surface from the masks and show it in the fourth window. Don’t worry if there are some odd bits that aren’t brain: we’ll get rid of these later. To spin the surface, click and hold on the left mouse button. If you are happy with this surface, click on Next Step and select Export 3D surface. Save this surface as a .STL file.

Editing the model in MeshLab. The red bit is a scanning error, about to be deleted.
Editing the model in MeshLab. The red bit is a scanning error, about to be deleted.

We now have an STL file. However, it isn’t ready for printing yet. Next, we are going to use MeshLab to clean the model up and getting it ready for printing. Run MeshLab and load the STL file with File>Import Mesh. MeshLab will allow us to remove the bits of the model we don’t need. I found that the easiest way to do this was to spin the model around and use the Select Faces In a Rectangular Area and the Delete Points, Verticies and Faces tool to remove the bits we don’t need. MeshLab uses a lot of memory when processing complex models like this, so don’t be surprised if it is unresponsive. If you are really struggling, try a filter that reduces the number of faces on the model, such as Filters>Remeshing, Simplification and Remodelling>Quadric Edge Collapse Decimation. Be careful, though: too much filtering will remove the detail from the model, which is what we are after.

Once you have removed all of the extraneous parts of the model, select Filter>Remeshing, Simplification and Remodelling>Close Holes. This will seal any holes in the model and get it ready for printing.

Finally, select File>Export Mesh and save the file as an STL file. Now, you are ready to load the model for printing! Any 3D printing program should be able to load the program and process it for printing out. I printed mine using Cura on a TAZ 5 printer.

3D Printing Your Brain

I was quite pleased with how my print turned out. The convoluted texture of my grey matter was well captured and printed on the top of the brain, but the similar texture on the side wasn’t quite as clear. That’s probably because of the way the scan was processed. I could get more detail on the side by using other scans and combining the results.

Now I have the 3D model, the possibilities are endless. I could print it in flexible plastic to give my cats an amusing toy. I could laser-cut it out in wood to produce an interesting ornament. Or I could do a small print to have available the next time someone asks to speak to the brains of this organization….

46 thoughts on “You Own Your MRI Brainscan; Do Something Interesting With It

  1. You can also acquire DICOM images from CT/PET scans. Years back I had cancer and all but the first CT scan I requested a copy of my scans. Hell, if I’m paying for it I might as well get a souvenir from it, right? Another fun thing to do with it is do a virtual endoscopy with it. At least with CT scan. I should isolate my skeleton and get it 3d printed for Halloween this year!

  2. “the possibilities are endless”

    But only ones that come off the top of your head are a cat toy or a holiday ornament?

    Look, this is actually really amazing if you stop and think about how much technology is at play here (MRI, software, 3d printing, etc) and thank you very much for the writeup because I have yet to see this put together despite it being possible for the past quite a few years now. Also, Magics would actually be better than Meshlab but that’s splitting hairs.

    Anyway, surely there have got to be better possibilities than those usage models? Obviously preoperative planning if necessary would be one possibility if necessary but there is nothing “better” that can be done with this data than a cat toy and a decorative ornament? It seems like a neat but otherwise pointless exercise rather than something actually, well, useful?

        1. The software I used comes from a very real-world application: Invesaliys was developed by the Brazilian government to lower the cost and language barriers for the analysis of these types of images. It is free software.

          Other real works applications? The same model can be used in surgery preparation systems, or for many forms of brain research. The Freesurfer application others mentioned is used in mapping brain function from fMRI and other scans, so researchers can understand how brain damage affects brain function.

          But that really wasn’t what this post was about, so I didn’t get into that.

    1. Apologies for my weak attempt at humor. I was attempting to show that the technology is awesome, but that it is also free, and that you have a right to access and use it yourself. This stuff is no longer just the province of doctors and surgeons: we all have access to tools that can image our brains.

      And thanks for the idea: a string of LED illuminated brains on a string would make a great halloween or holiday decoration!

  3. You’re probably better off going with a high resolution structural scan, like a T1-SPGR or MPRAGE scan. It will include a bunch of non-brain stuff, but there are analysis packages that will reliably remove the non-brain material. In fact, Freesurfer can automatically calculate a surface mesh from a T1 brain scan, and includes a utility to convert the results into an STL file.

    1. Daenris, I did download and look at Freesurfer, but it made my brain hurt. Sorry. I get that it’s an incredibly powerful package, but I think it needs more technical knowledge to use effectively.

      Actually, as you seem to have expertise in this, I would like to extract my skull from this to do a print to put my brain in (as it were). What’s the best approach for extracting bone from the rest of me? That would be difficult to do manually, and Invelisys didn’t seem to be able to do it easily.

      1. Hmmm. I’m actually not sure about that off the top of my head. I work with brain imaging data analysis, so we’re interested in just the brain, but there are definitely methods for bone extraction that would leave just the skull.

        This is one that I did from a high resolution structural image using Freesurfer to extract the brain surface, and then had printed in Shapeways Alumide for a former boss.

    2. Disclaimer: I have not used the imaging software described to process MRI images, so there may be limitations that limit the relevancy of my comments:

      I concur that a diffusion weighted scan (DWI) is not ideal for your intent. DWI uses algorithmic transforms that do a great job at identify stroke or edema, but also significantly lower the overall resolution. I would also avoid T2 and any contrasted scan, and SWI weighting.

      Go with a non-contrast T1 or MPRAGE.

      Additionally, ensuring you had the scan done in an MRI with at least a 1.5 tesla or (preferably) 3 tesla magnet will ensure the highest output resolution with the tradeoff of increased scan time. There is a large difference between even 0.6 and 1.5T.

      It would also be worth making sure that the DICOM images you’re using are not compressed in any way. I don’t think that they would be if you sourced them directly from the original image files. However, DICOM images transmitted across a PACS system and in the viewer included with the disc often use lossy compression for routine viewing. I have occasionally seen lower-than-captured-resolution DICOM files burned to patient discs.

      1. cyanmauve, good advice, but I should point out that the doctor who ordered the scan should be the one who decides what gets scanned. That’s kind of the point: we are just having fun with the result.

        1. It’s great to see people repurposing MRI data. It is almost a miraculous device considering the extremely small level of risk involved compared the amount of useful data received.

          I am a strong advocate of allowing the physician to order only what is needed. However, medico-legal constraints often prevent that in the real world. Just a little additional info for those that might be browsing their own scans at the moment:

          MRIs are typically ordered with a relatively standard imaging “package”. Meaning, a T1 and T2 scan are typically going to be done together because they are both needed to reliably screen for and interpret a wide variety of pathology. The physician will typically order “MRI brain with and without contrast”, and then provide an indication for the test, such as “tumor”, or “stroke”. Typically, that’s the extent of communication between the ordering physician and the radiology department. The radiologist is not even typically involved before the imaging is complete. He or she only act to interpret.

          Interestingly, many radiology groups will not allow primary care physicans, neurologists, or others to order just the sequence needed in isolation, frequently partially for liability reasons. For example, a T2 with and without contrast is all that is really needed to look for active and old multiple sclerosis lesions, however, a T1 sequence is almost always included and interpreted. That has real consequences, as it doubles the scan time (different magnet settings) and theoretically increases the cost of interpretation (radiologist has double the number of images to review).

          DWI (anything with b0, b500, or b1000 in the name) and ADC sequences are also relatively routinely performed, even though they are primarily looking for acute to subacute stroke, and even though a reliable physical exam and history can often move those conditions very far down the differential diagnosis list.

          Keep up the great writing!

  4. Okay, so you voluntarily let them inject you with heavy metals? A lanthanide series heavy metal at that? Just for a 3D print? Tell me you at least got your kidney and liver function checked first? Or that you picked a contrast that is a Gd containing molecule and not the metal ion and a chelation agent, or that you talked to the radiologist about the difference between the two?

    This is the problem with “citizen science” and walking into a lab and asking a doctor to order a specific scan. We, as non-medical folks, can not possibly know all the fine details that they spend years studying. And those seemingly small details can be, like in the case of MRI contrast, deadly details if you mess up.

    I know others will say that they should be able to ask their doctors and their primary care/general practice doctor should be able to warn them of these details. And, technically, they should since they all should have done a round in radiology. But the guy who graduated with barely a C- is still a M.D. and may have forgotten all the tests that are required to safely do a contrast MRI. And the radiologist may assume that if you look healthy, your doctor must have a reason to do this scan, and since the proper liver and kidney tests take days to process, would go ahead and do the scan.

    How do I know this stuff since I’m not an M.D.? I had a doctor order a contrast MRI and lab work to make sure it was safe, but he didn’t know anything about what was in the contrast material. So I asked around, read scholarly articles, and prepared to ask the right questions. Given what I know about my own medical case (I keep detailed records) I knew to look out for these details. But the only tip off I got that I should look into what the MRI contrast was, was that the physician’s assistant who was ordering it asked if I had problems iodine contrast and mused aloud if a contrast CT might be better; I perked up and asked why, what was involved in the two contrasts, and which would provide the details that they needed. Turned out that MRI was best for the details, but the risk of gadolinium wasn’t worth it.

    1. Or, you know, maybe he had to have the scan because of actual medical reasons, and since he was already getting it, decided to have fun with the images provided by the doctor?

      Nah, I’m sure he just walked into the MRI facility, and asked to be injected with dye and paid thousands of dollars for a customized cat toy. That’s probably it.

      1. As I replied to Richard below, it’s because I missed 3 words in the whole article. That cast things in a completely different light.

        As to doctors just ordering scans because a patient wants them . . . that’s actually a big problem in the medical community. Doctors do over-order tests to avoid malpractice lawsuits, and will throw a person through an MRI, CT, multiple x-rays, and any other scan over something minor that isn’t recovered from “as quickly as normal” just to prevent people from coming back later and complaining about the doctor missing things. Google scholar search for “overuse X scans” for MRI, CT, PET, x-ray, etc. Would one order an MRI if you just asked? In my experience, yes, some would.

        So, since this is the top most reply, I’ll apologize here for misreading the article and jumping on the “holy crap, what?” soapbox. I’m a big advocate of knowing your own medical situation, and have copies of all of my various scans and xrays, and have thrown them into 3d modelers and hope to print a few one day. I’ve found things on scans that and over-worked radiologist missed. And I’ve learned a lot by tinkering with the data that doctors ordered for good reason.

    2. Quin, you are jumping to a large number of unwarranted conclusions here: calm down. The MRI was done for a legitimate series of medical reasons, at the request and direction of a neurologist. Before I had the scan, the radiologist had checked my medical history and saw no problems with giving the contrast agent to me. I was also aware what the contrast agent was, and the potential risks. After the scan was done, my neurologist looked at it and we discussed the results.

      I certainly didn’t just walk into an MRI lab, lie down and go “shoot me up and spin the magnet, boys!”, nor would I recommend anyone do that. Especially as they would refuse to do it: these things are not cheap. Neither did I advocate amateur diagnosis, especially with complex tasks like MRI analysis. I leave poking at my brain to the experts, but I do advocate taking control of your own medical data, and making use of it in ways that interest you.

      1. What I read was:
        “To begin, you are going to need an MRI scan. Unfortunately, the low-field MRI that [Peter Jansen] is working on won’t quite cut it (yet): you’ll have to get the pros to do it. The type of scan also matters, because we want a scan that focusses in on the brain itself, not the bits around it. What type you get depends on what your doctor wants to know, as the radiologist can run a lot of different scans and analysis of the data to show different types of tissue. After looking through the scans that I got, I settled on one that was labelled eB1000i(BRAIN) With and Without Contrast.”

        hopefully the strikethrough I added will show why those three little words made all the difference in the context of the article. Without that, it appears (since you reference Jansen’s MRI) that you were pitching the citizen science angle more heavily, all because I read the same article and just missed those three words.

        Playing with a scan you had to have for medical reasons, that I can totally understand. I want a 3D printer so I can print my knotted up spine.

          1. I have. If I could edit my post, I would make that disclaimer of “I totally misread this article, ignore my complaints about it and only read if you are curious about gado MRIs from the perspective of a curious patient.”

        1. Quin, fair enough, but the bit about “What type you get depends on what your doctor wants to know” probably should have tipped you off as well.

          Good luck with the spine! I think the technique should work for that as well: it is all nerve tissue.

          1. Abstractly? I couldn’t analyze the perceived context I would have with that sentence (since I believe I read it the first time) since I’ve already misread and reread the article. That sentence parsed to me as “What type you get normally depends on what your doctor . . . ” (this time I hope my perceived thought in italics will show up).

            I can only say that since the medical field is my own personal mine field, the home built MRI remark primed me to misread things after that. If you meant that question as a request for the psychology of priming statements, I’m glad to continue but I’ve upset the commenters already. And if you meant “How could you miss this other sentence too” then I hope I just answered. Since we’re hackers here, “A primer on priming”

          2. And see, priming still, I read “But what about” as a question when you just meant “see, I said it here too.”

            I’d say I shouldn’t comment while on pain meds, but then I’d have to just leave.

      1. Nope, normal MRI without contrast. And the radiation dose from Gd isn’t the problem, the heavy metal toxicity is.

        Secondly, contrast for a CAT is iodine; also a problem for low kidney function but not a long term toxin like gado.

        1. I have had a full brain MRI with and w/o contrast and as I remember, there was a huge amount of medical history I had to fill out along with a small novels worth of disclaimers about the contrasting agent to read and sign off on before they put me in the tube. When it was time for the actual IV, the nurse brought me out of the tube, gave me a another full speech and had me scribble the best I could with my head bolted down yet another release form!

          The only side effect was having to pee really, really bad and my pee went from bright orange to neon yellow to finally clear after a few goes.

          The MRI resulted in nothing more than “a normal, healthy, human brain” and a huge bill.

          And I do it again if it was really needed…

        2. Despite your professed level of research, you are mistaken about the true risks of gadolinium based contrast. There is a bit of very recent evidence that gadolinium can accumulate in the brain in those receiving multiple, serial, MRI scans (think multiple sclerosis patients who may need and MRI brain, cervical, and thoracic scan, all with contrast, yearly, every six months, or even more often).

          Typically, contrast is indicated when a physician is looking for infection, inflammation, edema, or to help differentiate types of tissue that can appear very similar, if not identical otherwise. In fact, there are many situations in which a non-contrasted scan can appear completely normal in the setting of some pretty terrific pathology.

          Risk vs. benefit should be considered with all medical decisions. In general, however, you likely have significantly higher risk of dangerous pathology being missed than any injury from gadolinium based contrast. After all, your physician felt that a contrasted scan was needed for a reason, likely based on his differential diagnosis.

          Finally, a commenter above makes the very salient point that a CT scan exposes you to radiation, while MRI does not. While the level of radiation received due to a modern CT head is not actually that high, MRI (contrasted or not) typically provides much better imaging of the soft tissues, posterior aspects of the brain and brain stem (which are very affected by artifact on CT), and even vascular structures.

          1. No, I have higher risk of pathology because the doctor ordered a MRI w&w/o, but insurance only approved w/o because of what they think the doctor who eventually got the order through might be looking for. I simplified all of that because, well, it’s a different rant.

            Secondly, as a comparison of the risk/reward of MRI versus CT, and the risk of radiation, I am well aware. I’m in that category of patient’s that’s been offered a dosimeter. Instead, since my scans have dropped back to 1 a year, they just share data better (the benefit of EMR is the reduced duplication of tests).

            As for gado toxicity, I can’t claim to be an expert on the risk/reward for someone else. As I had misunderstood the article, I was commenting on unneeded gadolinium exposure. The average person with MS may not have the life expectancy of an otherwise healthy person; so the long term heavy metal damage is outweighed by the need to keep them alive. Plus, how many people have 5 or 6 Gd contrast MRIs (or 10 or 20) and survive for another 40 years to model the potential neural problems? It’s like the early modeling of bisphosphinates (probably misspelled), where the life expectancy of the people getting the drugs was only a few years, so the 30 to 40 year side effects were missed for a long time.

            The rest I can’t argue with. They are different scans with different purposes; the only reason I mentioned CAT scans was because my story of why I researched things was because of a P.A. musing aloud about the safety of the contrasts for me which made me curious about the risks. Previously, I’d only had Mg contrast MRIs, which has a totally different use and is pretty safe, but wasn’t available for this specific scan. Hence my curiosity.

  5. I need to ask my neurologist if she still has the files from my Last MRI. Where fair portion of my brain is scar tissue I’m told, I’d have to wonder what 3D print would look like. As far as the contrast goes. In the event I was informed of any dangers, I’m not sure I’d been that concerned, because I was deteriorating rapidly. What to do with the print, make Ratfink model car?

  6. I’ve literally just ordered a Kossel mini 3D printer kit. I’m definitely going to have to try this, I’ve got MRI scans of my brain on disc from a couple of years back.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.