# Displaying data in common coordinate framework - CCF reference space

**URL:** https://community.brain-map.org/t/displaying-data-in-common-coordinate-framework-ccf-reference-space/781
**Category:** Show & Tell
**Tags:** reference-coordinates, mri, analysis, how-to
**Created:** [November 12, 2020, 8:56pm UTC](https://community.brain-map.org/t/displaying-data-in-common-coordinate-framework-ccf-reference-space/781 "2020-11-12T20:56:26Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Momo](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/momo/32/239_2.png) [@Momo](https://community.brain-map.org/u/Momo)
#### Post date: [November 12, 2020, 8:56pm UTC](https://community.brain-map.org/t/displaying-data-in-common-coordinate-framework-ccf-reference-space/781/1 "2020-11-12T20:56:26Z")

</div>

Hi,

I would like to ask how I can display some MRI and morphological data that I have brought to Common Coordinate Framework with Allen Brain tools. (Like making some heat maps in different mouse brain regions).

Your help is appreciated.  
Momo

---

<div class="post-metadata">

### Author: ![FedeClaudi](https://avatars.discourse-cdn.com/v4/letter/f/5f9b8f/32.png) [@FedeClaudi](https://community.brain-map.org/u/FedeClaudi)
#### Post date: [November 17, 2020, 10:55am UTC](https://community.brain-map.org/t/displaying-data-in-common-coordinate-framework-ccf-reference-space/781/2 "2020-11-17T10:55:17Z")

</div>

Hi,

What kind of format are your data in?  
[brainrender](https://github.com/brainglobe/brainrender) can deal with data from many different formats so perhaps we can find a way to visualise your data too.  
Docs: [https://docs.brainrender.info/](https://docs.brainrender.info/)  
Disclaimer: I’m the creator of brainrender 🙂

---

<div class="post-metadata">

### Author: ![Momo](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/momo/32/239_2.png) [@Momo](https://community.brain-map.org/u/Momo)
#### Post date: [November 20, 2020, 12:53am UTC](https://community.brain-map.org/t/displaying-data-in-common-coordinate-framework-ccf-reference-space/781/3 "2020-11-20T00:53:16Z")

</div>

Ciao Federico,

My data are in Nifti format and I would like them to overlay the mouse brain structures (preferably the structures be transparent). I would appreciate any help with that in anticipo.  
The brainrender seems like a practical tool, so I’ll try to use it.

Momo

---

<div class="post-metadata">

### Author: ![FedeClaudi](https://avatars.discourse-cdn.com/v4/letter/f/5f9b8f/32.png) [@FedeClaudi](https://community.brain-map.org/u/FedeClaudi)
#### Post date: [November 20, 2020, 9:14am UTC](https://community.brain-map.org/t/displaying-data-in-common-coordinate-framework-ccf-reference-space/781/4 "2020-11-20T09:14:05Z")

</div>

Okay, that should be fairly easy to achieve with brainrender.  
If you get stuck anywhere get in touch!

---

<div class="post-metadata">

### Author: ![Momo](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/momo/32/239_2.png) [@Momo](https://community.brain-map.org/u/Momo)
#### Post date: [November 21, 2020, 12:56am UTC](https://community.brain-map.org/t/displaying-data-in-common-coordinate-framework-ccf-reference-space/781/5 "2020-11-21T00:56:19Z")

</div>

Do you have any example code of loading .nii file into brainrender and rendering the data?  
Unfortunately, I couldn’t find one on the github.

Momo

---

<div class="post-metadata">

### Author: ![FedeClaudi](https://avatars.discourse-cdn.com/v4/letter/f/5f9b8f/32.png) [@FedeClaudi](https://community.brain-map.org/u/FedeClaudi)
#### Post date: [November 23, 2020, 10:24pm UTC](https://community.brain-map.org/t/displaying-data-in-common-coordinate-framework-ccf-reference-space/781/6 "2020-11-23T22:24:24Z")

</div>

Hi, sorry for the delayed reply.

To load the data as a numpy array you should be able to use `brainio` (`pip install brainio`):

```python
from brainio import brainio

brainio.load_any('path/to/data')

```

which yields a 3D numpy array with the volumetric data.  
You can then render these in brainrender with a [Volume Actor](https://github.com/brainglobe/brainrender/blob/master/brainrender/actors/volume.py).  
So all together you code should look something like this:

```python
from brainio import brainio
from brainrender import Scene
from brainrender.actors import Volume

data = brainio.load_any('data path')
actor = Volume(data)

scene = Scene()
scene.add(actor)
scene.render()

```

I haven’t tested this code, but it should work. If you get stuck a good place to start with is the [definition](https://github.com/brainglobe/brainrender/blob/db70cf31b0/brainrender/actors/volume.py) of the `Volume` class.

---

<div class="post-metadata">

### Author: ![Momo](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/momo/32/239_2.png) [@Momo](https://community.brain-map.org/u/Momo)
#### Post date: [December 2, 2020, 8:47pm UTC](https://community.brain-map.org/t/displaying-data-in-common-coordinate-framework-ccf-reference-space/781/7 "2020-12-02T20:47:19Z")

</div>

Hi Federico,

Thank you for your reply! I tried using the code you provided but it is not adding the NIFTI data to the scene. I wonder if there is a middle step I’m missing which leads to this problem.  
Besides, with some NIFTI images I get this error:  
ValueError: axes don’t match array

Best,  
Momo
