help > Display fNRIS optode locations on the rendered brain in MRICron
Showing 1-9 of 9 posts
Display:
Results per page:
Jan 22, 2021  12:01 PM | Anyi Liu - UCL
Display fNRIS optode locations on the rendered brain in MRICron
Hi neuroimaging experts,

I ran into a question while using the MRICron to display my fNRIS data: how can I show the fNIRS optode locations (as bulbs) on the rendered brain in MRIcron? I want to have a 3D representation of where my optodes have been on the brain.

I have in hand: 1) the optodes coordinates in MNI and voxel space. 2) a nifti file of the brain that has a very similar size to the one where optodes have been placed on. 

Has anyone done something like this on MRIcron before? Or is there any Github resources that can do this?


Thanks a lot for your help in advance,

Anyi
Jan 22, 2021  04:01 PM | Chris Rorden
RE: Display fNRIS optode locations on the rendered brain in MRICron
I would suggest you use Surfice for this task. See the Loading Nodes script
Jan 23, 2021  01:01 PM | Anyi Liu - UCL
RE: Display fNRIS optode locations on the rendered brain in MRICron
Hi Chris,

Thanks a lot for your reply!
I am on Surf ice now, although to show my MNI channels as nodes, I need to convert my txt file into a node. 
I am not too sure how to do the conversion, is it done through a few lines of code?

Many thanks,
Anyi
Jan 23, 2021  09:01 PM | Chris Rorden
RE: Display fNRIS optode locations on the rendered brain in MRICron
You can load a text file saved as BrainNet Node format. You can do this with the Nodes/AddNodesOrEdges menu item or with a Python script (see the Scripting/Python/node script for an example). The node file format is a simple text file where each file reports the X,Y,Z coordinates of each node, the size, the color/intensity and a name. Each node is a separate line, each line has these 6 properties:


-9.631 28.620 33.320 1 1 L.superior.frontal.gyrus
10.801 28.312 33.032 1 1 R.superior.frontal.gyrus
-30.468 35.927 26.576 1 1 L.middle.frontal.gyrus
30.734 37.800 25.642 1 1 R.middle.frontal.gyrus
Jan 24, 2021  04:01 PM | Anyi Liu - UCL
RE: Display fNRIS optode locations on the rendered brain in MRICron
Thanks I managed to plot the channel on the brain!

However I ran into another problem: the channels are not perfectly placed on the cortex, especially the left hand side, as shown in the picture. It might have been caused by the interpolation that makes the two sets of coordinates not registered 1 to 1 as before? 

Is there a way to plot the brain as 80% transparent so that the channels can be seen without adjusting the depth? 


Many thanks,
Anyi
Attachment: Picture 1.png
Jan 24, 2021  07:01 PM | Chris Rorden
RE: Display fNRIS optode locations on the rendered brain in MRICron
Looks like your normalization with the mesh is not great. You may want to create a custom mesh for each individual. Regardless, you will want to improve your normalization. This will depend on the tools you use (SPM, FSL, ANTS, AFNI), and are beyond the scope of this help list. You can adjust the transparency of a mesh with respect to the nodes by adjusting the overlay sliders. If you prefer Python scripts, the command gl.shaderxray will adjust this property:

import gl
gl.resetdefaults()
gl.meshload('BrainMesh_ICBM152.lh.mz3')
gl.edgeload('LPBA40.edge')
gl.clipazimuthelevation(0.3, 0, 130)
gl.nodesize(6, 1)
gl.edgesize(3,1)
gl.nodehemisphere(-1)
gl.azimuthelevation(250, 35)
gl.edgecolor('actc',1)
gl.nodecolor('blue',1)
gl.nodethresh(1.0,1.0)
gl.edgethresh(0.5,1.0)
gl.meshcurv()
gl.overlayminmax(1,-1,1)
gl.overlaycolorname(1,'surface')
gl.overlayinvert(1,1)
gl.overlaytranslucent(1, 1)
gl.meshhemisphere(-1)
gl.shaderxray(0.5, 0.5)
Feb 3, 2021  01:02 PM | Anyi Liu - UCL
RE: Display fNRIS optode locations on the rendered brain in MRICron
Hi Chris,

Thanks a lot for your help on Surf ice! I really like the software, it is really useful for what I am doing.

Although I came across another problem: how to display two sets of nodes at the same time on the same mesh?  I am trying to compare two optodes registration methods.

Many thanks,
Anyi
Feb 3, 2021  01:02 PM | Chris Rorden
RE: Display fNRIS optode locations on the rendered brain in MRICron
For questions regarding Surfice, please use the dedicated NITRC forums or create an issue on Github

The .node files use the simple BrainNet text format. You can use your favorite text editor or scripting language to concatenate two node files. The format lists six columns for each node:
  Xmm Ymm Zmm Color Radius Name
You could also provide a different "color" for your two sets of nodes. When you 

-9.631 28.620 33.320 1 1 L.superior.frontal.gyrus
10.801 28.312 33.032 1 1 R.superior.frontal.gyrus
-30.468 35.927 26.576 1 1 L.middle.frontal.gyrus
30.734 37.800 25.642 1 1 R.middle.frontal.gyrus
....
-10 28.620 33.320 2 1 L.superior.frontal.gyrus
11 28.312 33.032 2 1 R.superior.frontal.gyrus
-32 35.927 26.576 2 1 L.middle.frontal.gyrus
31 37.800 25.642 2 1 R.middle.frontal.gyrus
....

Then the you display the nodes in Surfice, you could differentiate the node by its color as shown in the screenshot.
Attachment: nodes_by_color2.png
Feb 3, 2021  03:02 PM | Anyi Liu - UCL
RE: Display fNRIS optode locations on the rendered brain in MRICron
Amazing! I should have thought about this, thanks a lot! :)

Best wishes,
Anyi