nirs2img, create an image file from NIRS data

51 sec read

Update 2021/2/27: If you find griddata3 not working, try to change griddata3 to griddata.

I was asked where to get nirs2img script. Here it is. The download link is at the bottom of this article.

nirs2img is to create an image file from the input data. Then the
image file can be viewed by any fmri image viewing programs such as
xjview. This function requires function mni2cor and spm

function nirs2img(imgFileName, mni, value, doInterp, doXjview, bilateral)

imgFileName: the file name to be saved, e.g. ‘testnirs.img’
mni: Nx3 matrix, each row a coordinate in mni space
value: Nx1 matrix, each row is the value corresponding to mni
doInterp: 1 or 0 , whether or not do linear interpolation to
smooth data.
doXjview: 1 or 0, whether or not to view the generated image by xjview
now
bilateral: 1 or 0, whether or not the input mni is bilateral or not. If
bilateral, the first half points are considered as left side. There is no
interpolation between left and right side. (This argument is
useless if doInterp is 0)

output:
an image file whose name is specified by input

If you have mni points of probes (instead of channels), you may need to
convert first. Use function probe2channel

This function will write to a image file which can be viewed by xjview.
In xjview, you need to check render view.

Example:
nirs2img(‘nirs_test.img’, mni, value, 1, 1, 0);

Xu Cui
2009/06/11
last update: 2009/07/06: have an option that left and right do not
interpolate

nirs2img.m
mni2cor.m



写作助手,把中式英语变成专业英文


Want to receive new post notification? 有新文章通知我

第五十四期fNIRS Journal Club通知2024/07/27, 10am 黄鑫

电子烟作为一种新型的尼古丁输送装置,常以安全健康、有助于戒烟的形象出现在公众视野中,使得大批消费者转而投入到此类产品的怀抱中。然而,相关研究却仍存较大短板,深入了解电子烟对行为与脑功能活动的影响将更好
Wanling Zhu
10 sec read

第五十三期fNIRS Journal Club视频 李洪

Youtube: https://youtu.be/czyJTrXhees优酷:https://v.youku.com/v_show/id_XNjQwNjc5OTk0OA==.html 个体在处理不同
Wanling Zhu
12 sec read

第五十三期fNIRS Journal Club通知2024/06/22, 10am 李洪

个体在处理不同记忆负荷信息时会表现出一定的行为差异。作为一项新兴指标,瞬时脑信号变异性能够揭示个体内部因任务需求不断变化而进行的神经资源分配,从而为了解大脑如何适应和处理不同复杂程度的信息提供了新的见
Wanling Zhu
8 sec read

One Reply to “nirs2img, create an image file from NIRS data”

  1. Hi Dr. Xu,
    I am getting the following error when trying to run nirs2img.

    Invalid MEX-file
    ‘/Users/emilydoherty/Documents/MATLAB1/spm8/@file_array/private/mat2file.mexmaci64’:
    dlopen(/Users/emilydoherty/Documents/MATLAB1/spm8/@file_array/private/mat2file.mexmaci64,
    0x0006): Library not loaded: @loader_path/libmex.dylib
    Referenced from:
    /Users/emilydoherty/Documents/MATLAB1/spm8/@file_array/private/mat2file.mexmaci64
    Reason: tried:
    ‘/Users/emilydoherty/Documents/MATLAB1/spm8/@file_array/private/libmex.dylib’ (no
    such file), ‘/usr/local/lib/libmex.dylib’ (no such file), ‘/usr/lib/libmex.dylib’
    (no such file)

    Error in file_array/subsasgn>subfun (line 132)
    mat2file(sobj,dat,va{:});

    Error in file_array/subsasgn (line 70)
    subfun(sobj,double(dat),args{:});

    Error in spm_write_plane (line 33)
    V.private.dat = subsasgn(V.private.dat,S,dat);

    Error in spm_write_vol (line 83)
    V = spm_write_plane(V,Y,’:’);

    Error in nirs2img (line 104)
    spm_write_vol(V,M);

    I would appreciate any advice you can give. Thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *