This commit is contained in:
Cadey Ratio 2019-08-23 12:17:08 -04:00
parent 0fa0f3c63c
commit 9d64dd9cc2
3 changed files with 14 additions and 11 deletions

View File

@ -1,14 +1,13 @@
--- ---
title: How to Convert a Brain fMRI to a 3D Model title: How I Converted my Brain fMRI to a 3D Model
date: 2019-08-23 date: 2019-08-23
--- ---
# How to Convert a Brain fMRI to a 3D Model # How I Converted my Brain fMRI to a 3D Model
AUTHOR'S NOTE: I just want to start this out by saying I do not know what I am AUTHOR'S NOTE: I just want to start this out by saying I am not an expert, and
doing here. I am not an expert, nothing in this blogpost should be construed nothing in this blogpost should be construed as medical advice. I just wanted
as medical advice. I just wanted to see what kind of pretty pictures I could to see what kind of pretty pictures I could get out of an fMRI data file.
get out of an fMRI data file.
So this week I flew out to Stanford to participate in a study that involved a So this week I flew out to Stanford to participate in a study that involved a
fMRI of my brain while I was doing some things. I asked for (and recieved) a fMRI of my brain while I was doing some things. I asked for (and recieved) a
@ -40,12 +39,14 @@ $ source env/bin/activate
(env) $ python3 setup.py install (env) $ python3 setup.py install
``` ```
Then I ran it with the following settings to get [this first result (30 MB)][firstgif]. Then I ran it with the following settings to get this first result:
``` ```
(env) $ gif_your_nifti christine_brain.nii.gz --mode pseudocolor --cmap plasma (env) $ gif_your_nifti christine_brain.nii.gz --mode pseudocolor --cmap plasma
``` ```
<center><video src="/static/blog/christine-frmi-raw.mp4">A sideways view of the brain</video></center>
It looked weird though, that's because the fMRI scanner I used has a different It looked weird though, that's because the fMRI scanner I used has a different
rotation to what's considered "normal". The gif\_your\_nifti repo mentioned a rotation to what's considered "normal". The gif\_your\_nifti repo mentioned a
program called `fslreorient2std` to reorient the fMRI image, so I set out to program called `fslreorient2std` to reorient the fMRI image, so I set out to
@ -63,10 +64,12 @@ to a server of mine and ran the conversion command:
$ fslreorient2std christine_brain.nii.gz christine_brain_reoriented.nii.gz $ fslreorient2std christine_brain.nii.gz christine_brain_reoriented.nii.gz
``` ```
This produced a slightly smaller [reoriented file][secondniifile] This produced a slightly smaller [reoriented file][secondniifile].
I reran gif\_your\_nifti on this reoriented file and got [this result (30 MB)][secondgif] I reran gif\_your\_nifti on this reoriented file and got this result
which looked a _lot_ better. which looked a _lot_ better:
<center><video src="/static/blog/christine-fmri-reoriented.mp4">A properly reoriented brain</video></center>
### FreeSurfer ### FreeSurfer
@ -103,7 +106,7 @@ files, I got a view that looked something like this:
<center><blockquote class="twitter-tweet"><p lang="en" dir="ltr">BRAIN <a href="https://t.co/kGSrPj0kgP">pic.twitter.com/kGSrPj0kgP</a></p>&mdash; Cadey Ratio 🌐 (@theprincessxena) <a href="https://twitter.com/theprincessxena/status/1164526098526478336?ref_src=twsrc%5Etfw">August 22, 2019</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script></center> <center><blockquote class="twitter-tweet"><p lang="en" dir="ltr">BRAIN <a href="https://t.co/kGSrPj0kgP">pic.twitter.com/kGSrPj0kgP</a></p>&mdash; Cadey Ratio 🌐 (@theprincessxena) <a href="https://twitter.com/theprincessxena/status/1164526098526478336?ref_src=twsrc%5Etfw">August 22, 2019</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script></center>
I have absolutely no idea what to do from here in Blender, so I exported the I had absolutely no idea what to do from here in Blender, so I exported the
whole thing to a stl file and sent it to a coworker for 3D printing (he said whole thing to a stl file and sent it to a coworker for 3D printing (he said
it was going to be "the coolest thing he's ever printed"). it was going to be "the coolest thing he's ever printed").

Binary file not shown.

Binary file not shown.