Xu Cui

 

   



564 Stories by Xu Cui

Brain surface plot with MatLab

This is an example of brain activation plotted on surface. In many circumstances surface view is much more straightforward than a slice view. Here is how I created such a plot using MatLab and SPM. Environment and Tools: Windows XP MatLab (v7.6) SPM
12 1 min read

tcpip connection with pnet

We use TCP/UDP/IP Toolbox 2.0.5 to read and write data from/to a TCPIP port. It’s fast and reliable. The version we use is 2.0.5. Below is a matlab sample script showing how to connect to another computer (called ETG-4000) with TCPIP : %Connect
4 1 min read

Noise removal in NIRS

Noise removal methods in NIRS can be divided into 4 categories: reducing noise based on its temporal characteristics: The instrument noise is usually in the high frequency band and thus can be removed by band pass filtering. Band pass filtering can a
0 41 sec read

GMail Advanced Search

As I have quite some emails (>13000) in gmail, searching more efficiently becomes a necessity. Fortunately gmail offers some advanced search syntax. http://mail.google.com/support/bin/answer.py?hl=en&answer=7190 Search emails with attachment f
0 19 sec read

Just became a new dad

I just became a new father. My daughter Iris was born 4 days ago. Currently sleep deprived …
5 3 sec read

3D Rotation

Assume you have a vector (x,y,z) and you want to rotate it to, say x-axis, you can multiply the rotation matrix to the vector. First, make the vector a column vector and append 1 to the end. It becomes a 4×1 matrix: v = x y z 1 Then, convert the
0 46 sec read

The power of words

Several years ago in San Diego I was in a friend’s car when he hit the car in front. The accident was mild and nobody was injured. After the two cars pulled over, I was wondering what the other driver would say. He said, “I am sorry to me
0 43 sec read

Reference slice in slice timing in SPM

I saw at least two web pages saying that the reference slice can be chosen during slice timing correction. For example, http://www.fil.ion.ucl.ac.uk/spm/doc/manual/spatial.htm. I disagree. Let’s take the first volume as example. Assume TR=2 and
7 1 min read

Some formulas of linear regression

y: dependent variable X: independent variable r: residual $$y=X\beta+r$$ $$\beta=inv(X’*X)*X’*y$$ $$\sigma^2=r’*r/df$$ $$df=N-rank(X)$$ $$\sigma_\beta^2=\sigma^2inv(X’X)$$ $$T_\beta=\beta/\sigma_\beta$$ $$contrast variance = c
0 14 sec read