Forum

Notifications
Clear all

accessing specific values for sensitivity profile

9 Posts
2 Users
0 Likes
445 Views
Posts: 11
Topic starter
(@rp-cnbi)
Active Member
Joined: 2 years ago

Hello, 

I've just run my first successful MC simulation on a subject's T1 MRI. The output makes a lot of sense given their underlying anatomy. I am curious about, if i want to report the results, how can I access specific sensitivity values (absorption change [mm-1]) for specific channels? even when i look at the sensitivity of a specific channel, the only quantitative aspect of the output that i see is from the colorful scale on the right hand side, which isn't actually that specific. the increments on mine are -2, -1.5, 1, 0.5, 0. How can I determine the specific value for a channel whose absorption change appears to (based on its color) fall between two of the values on the color scale?  thank you in advance!

8 Replies
Posts: 285
(@dboas)
Joined: 3 years ago

I have a partial answer for you that I want to document here for your benefit and others. There is more that can be done that I will describe, but I haven't figured out the final steps... but hopefully we will collectively figure it out and post here for others to find.

First, you can load the sensitivity matrix into matlab. The file is in the 'fw' sub-directory and is called 'Adot.mat'. Load that. It will have dimensions # channels x # brain surface vertices x # wavelengths. Look at the row of data for your desired channel and wavelength and you get the numeric values for the sensitivity to each and every vertex. To remind yourself which row corresponds to which channel, you need to look at the order of the channels in the measurement list that is contained in the snirf file.

Now, it is possible to visualize the sensitivity on the brain surface using the matlab trisurf() command. Do do this, you first need to load the mesh for the brain surface. You can find the colin mesh in AtlasViewer/Data/Colin/anatomical/pialsurf.mesh and load it with the [v,f]=read_surf() function that is from freesurfer but copied into your AtlasViewer path. You can then visualize it with trisurf(f,v(:,1),v(:,2),v(:,3),squeeze(Adot(1,:,1))). You just have to make sure that the number of vertices in Adot matches that number of vertices in v (or maybe it is the number of faces). When we run the monte carlo, we do give the user the option to decimate the number of vertices. I forget where that mesh is saved. I have a feeling it is saved in AtlasViewer.mat if you manually saved it with the file menu option to save the AtlasViewer state.

Does this help you at all?

 

Reply
1 Reply
(@rp-cnbi)
Joined: 2 years ago

Active Member
Posts: 11

@dboas Thanks for the quick response! This information is all very helpful - however, I have a few additional questions. So, you mentioned the need for the # vertices in the adot file to match the # vertices in the pialsurf.mesh file. For this subject, these numbers do not match. There was an option when setting up the MC parameters to drop the pial surfaces down to ~40k to increase processing speed - could this have anything to do with it? Regardless, I did attempt to run the trisurf command, but was unable to get it to run due to error messages. The command wants a defined x,y,z,and T input, and I'm not quite sure how those variables translate to the data we are working with. Any ideas here regarding how to run this command so we can visualize the input? 

 

Thanks again and I look forward to hearing from you again soon!

Reply
Posts: 285
(@dboas)
Joined: 3 years ago

Try to manually save the atlasviewer state in the file menu.

Then you can load atlasViewer.mat into matlab. You can then find the reduced mesh in fwmodel.mesh. This will ahve the same saize as Adot

confirm that and then we can figure out the matlab commands to display Adot color coded on the pial mesh

 

Reply
Posts: 285
(@dboas)
Joined: 3 years ago

The following code worked nicely for me. You can play around with the code to get a better visualization and lighting.

load atlasViewer.mat
load fw/Adot.mat

f=fwmodel.mesh.faces;
v=fwmodel.mesh.vertices;

%%
figure(1);

h=trisurf(f,v(:,1),v(:,2),v(:,3),Adot(10,:,1));
set(h,'linestyle','none')
lighting gouraud
light

%%
nopt = size(probe.optpos_reg,1);
nsrc = size(probe.srcpos,1);
ndet = size(probe.detpos,1);


hold on
for ii=1:nopt
hopt = plot3( probe.optpos_reg(ii,1), probe.optpos_reg(ii,2), probe.optpos_reg(ii,3), '.');
set(hopt,'markersize',20)
if ii<=nsrc
set(hopt,'color','r')
else
set(hopt,'color','c')
end
end
hold off

 

Reply
3 Replies
(@rp-cnbi)
Joined: 2 years ago

Active Member
Posts: 11

@dboas thank you so much for sending this! Apologies for the delay, things have been a bit crazy here. I'm getting snagged in the same spot when I try running this block, though. When I try to use the 'trisurf' function, I run into the following error: "Expression or statement is incorrect--possibly inbalanced (, {, or [." It seems to have an issue with indexing the 1th value of v. I've tried to debug but not sure if there is some difference in this function in MATLAB compared to the version you may be running? I'm running everything with homer2 on MATLAB R2017b to mimic what was used in the paper. Any suggestions?

Reply
(@dboas)
Joined: 3 years ago

Posts: 285

@rp-cnbi that is curious, the trisurf command above is wrong. I don't know how that copied incorrectly when I made the post originally.

h = trisurf(f,v(:,1),v(:,2),v(:,3));

 

 

Reply
(@rp-cnbi)
Joined: 2 years ago

Active Member
Posts: 11

@dboas hmmm .. still not working for me. It specifically does not like the comma before the 3. Is this indexing a specific column of values within the mesh vertices? Is there another way to do this?

Reply
Posts: 285
(@dboas)
Joined: 3 years ago

The development branch of AtlasViewer has now been updated to save mesh_brain.mat and mesh_scalp.mat in the 'fw' sub-directory along with Adot.mat. This will have the mesh that is matched to Adot annd you don't need to save the atlasviewer state.

 

 

Reply
Share:
en_USEnglish