Fix narginchk Error using SPM

May 7th, 2019

Today I downloaded SPM 12 latest version, and when I tried to start it complained:

Error using narginchk (line 10)
too many input arguments

This error is caused by the conflict of multiple narginchk functions. To find out where they are, type

>> which -all narginchk
C:\Users\Xu Cui\Dropbox\spm12\external\fieldtrip\compat\matlablt2011b\narginchk.m
built-in (C:\MATLAB\R2015b\toolbox\matlab\lang\narginchk)

Then I simply renamed the first narginchk.m to a different name (e.g. _narginchk.m), and now it works.

Author: Xu Cui Categories: brain, fmri Tags:

How to fix bluetooth mouse not working under windows 10?

May 3rd, 2019

I am using a Dell laptop with Windows 10. It’s been working great, but occasionally my bluetooth mouse won’t work. Sometimes I need to re-install the driver, sometimes I need to restart the computer. But it does not always resume working.

Below is a method which solved my problem (it’s a youtube video):

In a nutshell, you need to disable “fast boot” in power options, and delete the blooth device in device manager, and then shut down (not restart) your computer, and then start your computer. Hope it works for you.

Author: Xu Cui Categories: life Tags:

Interview with Drs. Chenbo Wang and Xianchun Li

April 26th, 2019

A group of scientists in East China Normal University has published a paper earlier this month titled “Dynamic interpersonal neural synchronization underlying pain-induced cooperation in females” in HBM. They studied how pain affected cooperation between female students using fNIRS hyperscanning. We interviewed the authors Chenbo Wang and Xianchun Li and they are generous in sharing their experience about this study.

Chenbo Wang

Chenbo Wang

Xianchun Li

Xianchun Li

Congratulations on your recent paper in HBM.

1. What motivated you to study the effect of pain on cooperation? And why to study female only?
Response: Dr. Chenbo Wang is interested in how physical pain influences human cognition and social behaviors. In one of his previous studies, results indicated that acute pain promotes cooperative behavior in social interaction (Wang et al., 2018). On the other hand, Dr. Xianchun Li’s previous works provided an interpersonal neural mechanism of cooperative behavior (Cheng et al., 2015; Pan et al., 2017). Thus, it was a perfect collaboration between the two teams that allowed us to further elucidate the underlying neural basis of pain-induced cooperation.
Female participants only were recruited due to that in previous study, an increased effect of pain on cooperative behavior was observed only in females but not in males (Wang et al., 2018). Although gender differences in pain perception and prosocial behavior was well-documented, we realized that having also males measured would then have made it possible to check the measured results if they comply with this previous finding.

2. 33 pairs of participants is not a small number. How long did it take to collect the data?
Response: It took nearly five months to collect all the data, from the fall of 2016 to spring 2017. Before that, we spent two months to set up the experimental equipment.

3. Compared to 1 person experiment, what are the unique challenges in hyperscanning experiment?
Response: One challenge is related to the experimental design. The paradigm chosen for an experiment should be subtle to interpersonal interaction, either socially or mentally. It should be very cautious to interpret the meaning of the observed interpersonal neural synchronization. Another challenge is regarded to conducting the experiment. It should be verified that the two participants understand the task similarly and perform it on the same page.

4. Why did you not use fMRI hyperscanning?
Response: In our experiment, each pair of two participants sat face-to-face during the cooperative task, which ensured a real social interaction that they performed the task in each other’s presence. However, this real social interaction would be prevented if the two participants lay in two separate fMRI scanners.

5. What was participants’ reaction when they found this would be a “painful” experiment? Do you have any particular example?
Response: Before decided to participate, it was informed that they would receive by a half-chance a moderate pain induced by capsaicin cream. With this expectation, most participants controlled themselves well throughout the whole experiment, although they would feel a little bit annoying.

6. How long did it take to analyze the data?
Response: It took nearly six months to analyze the data.

7. Compared to single subject data analysis, what are the unique challenges in hyperscanning data analysis?
Response: Hyperscanning data analysis depends on an estimator to quantify brain-to-brain synchrony. The most frequently used method is wavelet transform coherence (WTC). Different with that of single subject data analysis, the amplitude of the complex coherence value from two participants is calculated as an index of interpersonal neural synchronization (INS). This method requires choosing a frequency band of interest in which the task-related brain-to-brain synchrony is expected to occur based on previous studies and visual inspection of the data. So how to choose the best and accurate frequency band and how to explain it are unique challenges in hyperscanning data analysis.

8. What software did you use to create figure 5? If you used in-house program, do you mind sharing it?
Response: We applied to an open-source software package called circularGraph, based on MATLAB® (The MathWorks Inc., Natick, Massachusetts) scripts. It can be downloaded for free at https://ww2.mathworks.cn/matlabcentral/fileexchange/48576-circulargraph

9. From the initial submission to the acceptance of the paper, how long did it take? Were the reviewers friendly?
Response: It took 2 months to get the first revision and in total 4 months to receive the notice of acceptance.
Both reviewers provided us with positive comments. One reviewer remarked our experimental paradigm (pain + cognitive task + fNIRS hyperscanning) as being novel. The other reviewer commented that this work could make good contributions to the field. The reviewers raised some concerns regarding to the experimental settings and the procedure, the approach of preprocessing, and the method of FDR correction, all of which significantly helped improve the manuscript. For example, we conducted additional artifact rejection procedures (PCA method) to remove flow oscillations or other global systematic components and reanalyzed our data.

10. Can you use one sentence to summarize your finding in this study?
Response: When a dyad in painful state performing a cooperation task, their cooperation rate was improved across time; simultaneously, the interpersonal neural synchronization (INS) occurred successively at bilateral prefrontal cortex and right parietal cortex, along with increased fronto-parietal associations.

11. What is your plan for future research?
Response: There are three lines of future research. First, to replicate this finding by using EEG-based hyperscanning technique, providing extra information with ERP components and frequency band of high temporal resolution. Second, as we proposed in the current study that individuals in pain was “motivated” to cooperate; we were particularly interested in how pain would modulate neural activities in brain regions including ventral striatum and medial prefrontal cortex in the motivation and reward system, with fMRI technique. Third, it is encouraged to critically compare the effect of acute pain with chronic pain, by using the identical cooperative task.

Author: Xu Cui Categories: brain, nirs, writing Tags:

6 experiments you should do with NIRS (vs fMRI)

February 19th, 2019

[last update: 2019-02-20]

Let’s be frank. Compared to fMRI, NIRS has a number of intrinsic weaknesses. The signal to noise ratio is lower, the spatial resolution is (10x) lower, it can’t measure the deep brain, and it only covers a portion of the brain surface. As a result, fMRI, when possible, is still the preferred method to elucidate brain mechanisms. So if we do use NIRS, we’d better do experiments fMRI can’t, or at least very difficult to, do.

Below are 6 experiments NIRS can do, but fMRI can’t (or difficult to do):

  1. Study of the mechanism of BOLD signal
    1. Study of the relationship between oxygenated and deoxygenated hemoglobin concentration
      For a given voxel, fMRI only gives you a single number at a time. The number (BOLD signal) depends on many factors. On the other hand, NIRS can give you two numbers, the concentrations of both oxygenated and deoxygenated hemoglobin. So if you ever want to study the relationship between them, we should use NIRS. For an example, please check out https://www.ncbi.nlm.nih.gov/pubmed/19945536
    2. Study of the fine temporal change of BOLD signal
      In most fMRI settings the temporal resolution of BOLD signal is low (about 2 seconds, or 0.5Hz). That means we only get a number every two seconds. If we want to know the rise and fall of the BOLD signal in much higher temporal resolution, e.g. 10Hz, then NIRS would be a good choice.
  2. Study in naturalistic settings
    If you ever participate in a fMRI study, you will feel the room far from friendly. The scanner is loud, and it looks scary. During the entire experiment, you are lonely inside the confined space. You can’t move, can’t talk (for most experiments), and feel guilty when you swallow saliva as the experimenter probably told you in advance that any motion might distort the signal. What you often see is much simple visuals (such as blocks and circles) on a computer screen. Do we live such a life in reality? On the contrary, NIRS is small, even portable, and can be used in a naturalistic environment.

    1. Sports and exercise
      As long as the optodes are attached to the head nicely to ensure proper signal collection, the participants can move freely. NIRS has been used in a number of sports or exercises studies such as running, squatting, biking, ping-pong, piano playing, and stretching etc. Be sure to check out the videos in https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5434677/

      Source: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5430058/
    2. Face to face communication
      You might see other people’s face on a screen in fMRI, but with NIRS, you can see a real face. We humans are fundamentally social, and to study social behavior in a naturalistic environment is important. NIRS allows you to study face-to-face gaming (video or board), talking, brain storming, cooperation or competition, etc. For example, in one of our studies (https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3254802/) participants played a video game together. my colleague Ning Liu et al has an experiment when two people play Jenga games (https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4782164/).
    3. Study in a moving environment
      Many NIRS devices are small enough so you can carry it in a car or even a backpack. That means you can study the driver’s brain when he is actually driving! An example would be https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5671603/
  3. Hyperscanning
    fMRI can be used in hyperscanning studies, and in fact the first hyperscanning is done with fMRI by my former advisor Dr Montague (https://www.ncbi.nlm.nih.gov/pubmed/12202103). However, seeing it with first hand, I know hyperscanning with fMRI is technically challenging. You need two fMRI scanners, each costs a few million dollars; and you also need to synchronize them. On the other hand, many NIRS devices are able to do hyperscanning natually. For example, when we used ETG 4000, we simply use one patch on one participant and the other on another participant. It does not add complexity on the hardware part.
    To date there are a number of hyperscanning studies with NIRS. For a list, please refer to https://www.ncbi.nlm.nih.gov/pubmed/?term=(fnirs+OR+nirs)+hyperscanning. If you are patient enough to scroll to the last page, you will find our paper!
  4. Real time (feedback), brain computer interface
    Let’s say you want your participants to move a bar in a computer game mentally (brain computer interface), or you provide a real time neural feedback to your participants to improve cognitive function, in both cases you need the brain signal in real time.  fMRI can do this too, but first you will need to get the data in real time, and second, due to poorer time resolution (2s), there will be some lag. Many NIRS devices allows you to get the measured signal out without delay, and of course the temporal resolution of NIRS is typically much higher (e.g. 10Hz). An recent example can be found at https://www.ncbi.nlm.nih.gov/pubmed/30634177
    Some may argue that higher temporal resolution is not that useful because the BOLD signal is already slow (usually 4-6s from onset to peak). However, with finer temporal resolution, we can use algorithms (e.g. machine learning) to detect signal with much smaller delay. For example, in one of our studies the delay can be reduced by 50% (https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2978722/)
  5. Field studies, large scale studies
    You can’t carry an fMRI scanner around for sure, but with NIRS’ portability, you can collect neural data in the field. My colleague Dr Baker took a NIRS device to the rural places in Costa Rica, and scanned the local farmers. Check out his paper.

    In addition, since you may carry NIRS devices around, you can scan a lot of participants, e.g. a few hundred or even thousand. Imagine you are to study the brain and cognitive development of children in rural areas in China in a large scale (say 10,000 participants), then NIRS will become your top choice.
  6. Study on special participants
    Due to safety reason, the following people should not do fMRI experiments (source):

    1. with shrapnel or other metal or electronic implants in their bodies (such as pacemakers, aneurysm clips, surgical devices, metallic tattoos on the head, etc.)
    2. pregnant
    3. with a history of head trauma or fainting
    4. currently using sleeping aids, painkillers (including aspirin), or other agents known to affect brain function (for instance, antihistamines, decongestants, etc.)
    5. with major medical, neurological, or psychological disorders (including depression, generalized anxiety, panic attacks, AD(H)D, strokes, tumors, heart conditions, claustrophobia, etc.)

    In addition to this list, fMRI is also not friendly to infants (but still can be done in fMRI). In contrast, NIRS does not have issues with the participants in the list. Imagine you can do an experiment on claustrophobia with NIRS, but probably not with fMRI.

So, what is the ideal experiment with NIRS? Based on the above list, if one is to use hyperscanning to study the face-to-face communication when two claustrophobia participants are running together along a mountain trail, I would say it’s pretty hard for fMRI to catch on.
Author: Xu Cui Categories: brain, nirs Tags:

New Mac OSX Mojave on old Mac

January 31st, 2019

Back in 2009, When I got my first MacBook Pro I was excited. It had the best configuration at that time (8G memory and 250G storage - SSD!). I still use it today.

As I am developing Stork’s mobile app, I need to use the latest xcode. But Apple does not allow me to upgrade to its latest OSX, apparently my computer is too old.

So I found this webpage with detailed instructions on how to install new OSX to old Mac. The guy is a genius. It worked perfectly. What you need is a USB drive (16G or bigger). Then just follow the steps. The link is:

http://dosdude1.com/mojave/

(click the image below to enlarge)

Author: Xu Cui Categories: technology, web Tags:

Mac on Windows?

January 30th, 2019

If you need to play with Mac OSX but do not own a Mac computer, you might wish you could install Mac OSX on your Windows 10 computer as a virtual machine. Luckily I found this useful webpage with detailed instructions on how to do it. The link also provides a download link of the macOS Mojave image file.

The webpage is at https://techsviewer.com/install-macos-10-14-mojave-virtualbox-windows/

With the instruction I was able to run Mac OSX Mojave successfully on my Windows 10 via VirtualBox. In the beginning the mouse/keyboard does not work, so I followed another link: https://techsviewer.com/how-to-install-virtualbox-extension-pack-and-enable-usb-3-0/ which solved the problem.

During Mac OSX setup I also encountered the apple ID login issue. In the end I did not sign in my apple ID during the setup phase - I created a local account instead.

Currently the resolution seems to be low, resulting in a rather small window for Mac OSX. I do not know how to fix it yet. update 2019-02-01 Found a way to fix. In command line window, run the following command:

cd "C:\Program Files\Oracle\Virtualbox"
VBoxManage setextradata "Mac OSX Mojave" VBoxInternal2/EfiGraphicsResolution 1920x1080

Click the image below to zoom in:

Author: Xu Cui Categories: technology, web Tags:

fNIRS中基线的做法和注意事项 (Baseline in fNIRS)

November 5th, 2018

This article is a guest post by Rui Chen. An English version can be downloaded here

对于信号的分析,不论是脑电的数据分析还是近红外的数据分析,基本上都会遇到一个参考基线的问题,这是很多童鞋和老师会疑惑的一个关键点。为什么要使用基线以及如何正确的使用。

在本文中,小编主要介绍近红外的基线问题,对于脑电数据分析中的基线在小编的脑电数据分析系列文章中会进行完整的阐述。

目前我们使用的近红外所使用的光源发射方式,大多数是采用连续波长,对于完全采集绝对路径的信号是无法进行采样,所以在当前所评估的血红蛋白的指标中,总是对相对于另一个时间点的变化进行测量评估,例如,如果您研究响应刺激的氧合变化,您实际上正在测量在呈现刺激之前的短时间与之间的响应变化。刺激前的时期通常被称为基线。

什么是基线以及如何使用它?

对于那些刚刚开始使用NIRS技术的科研人员来说,有些不清楚测量结果是什么意思。测量的数据相对于什么,为了解释这一点,我们来说说基线的起源。

最常用的NIRS是“连续波”CW-NIRS,它基于修正的Beer-Lambert定律,使用连续发射光源,近红外光进入大脑组织有可能发生散射(改变其方向)又可能被吸收的光学特性来研究大脑活动水平。散射和吸收都是CW-NIRS提供相对测量的原因。

当把手指放在红色激光指示器前时,散射效果清晰可见。你会看到你的整个手指亮起来,而不只是一条直线,光散射在组织中。因此,如果您直接测量手指上的激光,则根本没有吸收,也不会通过激光指示器接收100%的发射光。

我们可以假设这种在所有方向上的散射是恒定的,所以如果我们测量接收光的变化,那么光从光源到接收器的路径中的吸收肯定是会发生改变。

现在使用近红外光来对大脑的研究,利用了近红外光在大脑组织中血红蛋白对光的特性,近红外光进入大脑组织大部分的吸收是由血红蛋白引起的,这就是为什么我们可以利用NIRS进行测量的原因。然而,光也会被其他组织(例如脂肪组织,毛发,皮肤、颅骨、脑积液等无关组织)吸收,但这是无法避免的。所以,我们假设在测量期间这种吸收是恒定的,并且接收光的任何变化都是由血红蛋白吸收的变化引起的。既然血红蛋白发生了变化,那么就会存在“起始状态”,对于CW-NIRS使用探测器接收到近红外光的变化,根据Mod Beer-Lambert定律来计算血红蛋白浓度的变化,那么,对于这个变化来说总是相对于“起始状态”或基线的。

CW-NIRS只能测量浓度的变化,因此无法提供起始浓度(通常设置为任意零点)。但是,它可以提供由任何任务或研究的状态引起的基线变化(例如收缩肌肉或增加大脑某部分的活动)。这种变化以毫摩尔每升(mmol/liter or mM)定量。有可能是正值,意味着来自任务或研究状态的激活;也有可能是负值,意味着自任务或研究状态的相对浓度降低或抑制。

如何使用基线?

想要获取较好的基线可能比理论状态下获取更困难。我们可以在数据中使用任意一个时间点并将其设置为零(通过采集到所有数据点中减去该值),或者可以在特定时间(例如开始的静息态1分钟)内获取基线得到该平均值然后通过采集到的所有数据点减去该值。如果时间条件下允许,在测量结束时记录另一个基线也是极好的。如果结束时的基线与初始基线没有显着差异,则可以对数据质量有足够的把握。

基线不应该做的

不要比较组之间的基线平均值。平均值是任意的,在可能状态下设置为零。在基线和任务之间不要有连续的刺激。因此,在fNIRS中,在每个刺激之前通常存在可以用作基线的rest时间。

总结

这期的文章中仅仅只是从理论状态上说明了使用基线的重要性,这也是只针对近红外的基线,当然在脑电数据中也是存在刺激前的基线校正,总之,在使用近红外技术对大脑研究时,尽可能的将基线的设定是在较平稳的状态下,这同时也是判断实验设计好坏的根据之一。

对于基线的数学公式,可参考一下这篇文章

This article is a guest post by Rui Chen. An English version can be downloaded here

Author: Xu Cui Categories: nirs Tags:

mergefile.m - a MatLab script to merge CSV files

October 10th, 2018

My wife asked me to write a script to merge some csv files she has. Usually this can be accomplished by a simple command in Mac or Linux:

cat *.csv >all0.csv

In Windows, it is:

copy *.csv all0.csv

But my wife needs more. She wanted the merged file have a column indicating the name of the source file. So I have to write a MatLab script, called mergefile.m. Here is the description.

mergefile merge csv files in a directory to all0.csv
mergefile merges the content of all the csv files in a directory into a
single file all0.csv. It also adds a column indicating the original
file name.

It assumes the files to be merged have the same header, and only the
header of the first file will be kept (i.e. the first row of the files
- except for the 1st file, will be ignored).

Author: Xu Cui (http://www.alivelearn.net/)
2018-10-10

Download mergefile.m

Author: Xu Cui Categories: matlab Tags:

Stork文献鸟显示期刊的中科院分区

September 12th, 2018

每天的新文献太多了,根本没时间读。怎么办?这时候就需要快速地甄别出重要文献。为了帮助大家做到这一点,文献鸟做了两件事情:

  1. 高亮标记了高影响因子的文献,并且文献按影响因子排列
  2. 显示中科院期刊分区信息,并用不同的颜色标识不同分区

对于Pro用户,文献鸟还允许设置过滤分区。比如如果设置最大分区是2,则只有分区为1和2的期刊文献才会被推送,其它的会被自动过滤。

中科院期刊分区的显示

Pro用户可以设置分区过滤

如果需要购买Pro,可以单击这个链接

Stork官网地址: https://www.storkapp.me/

Author: Xu Cui Categories: stork, web, writing Tags:

BOLD5000, A public fMRI dataset of 5000 images

September 11th, 2018

Official website and download
Full text paper link

Good news for brain imaging researchers. There is a new dataset available for you to play with.

BOLD5000 is a large-scale, slow event-related fMRI dataset collected on 4 subjects, each observing 5,254 images over 15 scanning sessions. The images are selected from three computer vision datasets.

  1. 1,000 images from Scene Images (with scene categories based on SUN categories)
  2. 2,000 images from the COCO dataset
  3. 1,916 images from the ImageNet dataset

BOLD5000 image data

BOLD5000 image data

Author: Xu Cui Categories: brain, web Tags: