# How to plot a 3-D statistic volumetric .nii file onto my own surface template?

**URL:** <https://community.mrtrix.org/t/how-to-plot-a-3-d-statistic-volumetric-nii-file-onto-my-own-surface-template/6474>\
**Category:** Uncategorized\
**Created:** [March 7, 2023, 11:24am UTC](https://community.mrtrix.org/t/how-to-plot-a-3-d-statistic-volumetric-nii-file-onto-my-own-surface-template/6474 "2023-03-07T11:24:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ward\_Jack](https://community.mrtrix.org/user_avatar/community.mrtrix.org/ward_jack/32/4231_2.png) [@Ward\_Jack](https://community.mrtrix.org/u/Ward_Jack)\
**Post date:** [March 7, 2023, 11:24am UTC](https://community.mrtrix.org/t/how-to-plot-a-3-d-statistic-volumetric-nii-file-onto-my-own-surface-template/6474/1 "2023-03-07T11:24:20Z")

</div>

Hi, everyone!

I’m trying to analyze the gliomas frequency in each imaging voxel. I first concatenated all the binary tumor mask(registered into MNI 512 space), and got the tumor frequency map(tumor\_frequcency.nii). Then, I applied to the AAL3v1.nii and averaged the frequency voxel in each brain subdivision to obtain each subdivision frequency(tumor\_frequcency\_AAL3v1.nii). The AAL3v1.nii spacing is 2_2_2mm.

Now, I want to plot tumor\_frequcency\_AAL3v1.nii onto a surface. Firstly, I turn to the “nilearn” in python. The example is as below, but my result is stretched.

my result:  
 ![5edf7ce3390243b7134964c24216810](https://community.mrtrix.org/uploads/default/original/2X/8/8f584c25362e3f1766fd57e3316f4ad167d73c40.png)  
example:  
 ![sphx_glr_plot_3d_map_to_surface_projection_006](https://community.mrtrix.org/uploads/default/original/2X/8/80652227862ddc6f18b2492f8d9caeed040f3c75.png)

here is my code:  
tumor\_map = nib.load(‘tumor\_frequcency\_AAL3v1.nii’).get\_fdata()  
fig = plotting.plot\_img\_on\_surf(tumor\_map,  
views=[‘lateral’, ‘medial’],  
hemispheres=[‘left’, ‘right’],  
colorbar=True)  
plotting.show()

I don’t know how to solve this problem. Given that the space of tumor\_frequcency\_AAL3v1.nii may be unmatch FreeSurfer’s fsaverage5(nilearn default surface)  
, I think I may create the AAL3v1.nii surface by Freesurfer. However, it seems that it isn’t the usually way to relate anatomical template, AAL3, to Freesurfer, which more focus on the cortex pacellation.

I’ve read [Problems with AAL parcellation](https://community.mrtrix.org/t/problems-with-aal-parcellation/567) and attempt to use command labelconvert to see whether it could help next.
