Dealing with NaN's

Submitted by richard.bethlehem on
Hi All,

I'm currently working on a resting state analysis of a group of individuals that share a specific lesion. Now in order to minimize 'leakage' of lesioned tissue into the seeds for fc-analysis during the smoothing step I'm thinking about masking out the lesion prior to preprocessing preferably by setting all voxel values in the leasioned tissue to NaN's. The problem is however, that for some patient the lesion might partly (physically) extend into the seed region I want to use for functional connectivity analysis. Obviously I don't want to pollute my seed time-course with this leasioned tissue (I want to know how the remaining part of the tissue is 'connected').

Now my question is: how does the rest toolbox handle NaN's when extracting time-courses from a seed that might include part of the lesion?  Are these voxelf simply not taken into account? And alternative if I set those voxels to zeros are they taken into account?

Best,

Richard

I am not good at the usage of software. However, if the seed ROI is contaminated by visible lesion, the results will be inevitably be biased. But if you are only interested in the quantitative comparison, e.g., by visual inspection on a connectivity pattern of brain with tumor, I think you can just remove the lesion voxels.

YAN Chao-Gan

Mon, 03/25/2013 - 20:14

Hi Richard,

When extracting time-courses via REST, the actual function is matlab's "mean". Thus, if you have NaN values, you will get a mean value (or even use matlab's sum) of NaN.

If you set these voxels to 0, then they will not affect the mean cacluation, the denominator is the total number of the seed ROI, i.e., may keep constant across subjects. Do you want each subject have a different  denominator, i.e., the number of "good" voxels? Then you need to handle that by using sum and divide by the number of good voxels by modifying the code.

Best,

Chao-Gan
Forums