Sunday, September 6, 2020

how to make gradient dots in illustrator

https://shirtoid.com/tutorials/halftone-gradient-in-illustrator/

Saturday, August 22, 2020

how to make a list of stringes for box plot

str1='G7f'; str2='XCaMP'; group=[repmat({str1},3,1);repmat({str2},3,1)]; result is: 'G7f' 'G7f' 'G7f' 'XCaMP' 'XCaMP' 'XCaMP' However, if you use group=[repmat(str1,3,1),repmat(str2,3,1)]; the result will be 'G7fXCaMP' 'G7fXCaMP' 'G7fXCaMP'

Tuesday, August 11, 2020

Commands to summon matlab from cluster commuting

From the terminal of the linus type: bsub -XF -n1 matlab -desktop

Thursday, July 30, 2020

Use of complex number to resolve a practical problem

In analyzing the tuning response of visual cortex neurons, there is a need to find the preferred direction and the opposition as well as orthognal directions. This is not an easy task, but could be conveniently achieved by using complex numbers. When you find the preferred direction through gaussian fitting, you could create a complex vector y1Tmp=exp(1i*(y1-1)*2*pi/angleNO). Then find the opposition direction:y2=angle(y1Tmp*exp(1i*pi)). The orthognal direction is y3=angle(y1Tmp*exp(1i*pi/2)). And the other orthognal direction is y4=angle(y1Tmp*exp(-1i*pi/2)). This way we could easily calculate the Orientation Selectivity of neurons.

Wednesday, July 29, 2020

The best article for the introduction of General Linear Model

http://psych.colorado.edu/~carey/qmin/qminChapters/QMIN09-GLMIntro. The General Linear Model (GLM): A gentle introduction

Wednesday, May 20, 2020

How to make a movie from your screen and then edit frames in ImageJ

Task: I want to make a movie of the 3D flyby of the microscope model, but since the control of rotation is not perfect, need to edit the frames Step1: Record movie. use VLC media player, choose Media>Open Capture device> capture Device>Capture Mode: choose "Desktop"; then change "play" to "convert". Now another window pops out: choose the file format you want to same and where you want to save. Then click "start". You are now recording your screen. I saved into MP4. Step2: Install FFMEG. MP4 cannot be imported by Imagej. Even if you convert it into avi by VLC media player, it is still cannot be imported by imagej. So I need to convert it to avi. This could be best achieved by FFMEG, which is an open-source video converting software. Download it from its website and install it. Here is how:https://www.youtube.com/watch?v=qjtmgCb8NcE Step3: With FFMEG, I first tried this command (ffmpeg -i mimsflyby2.mp4 mimsflyb2.avi), but get an error when I tried to open the avi file with imagej "("/An error occured reading the AVI file. Unsupported compresion: 34504d46 'FMP4".). Then I found another command from here http://imagej.1557.x6.nabble.com/Importing-avi-td5000582.html, and it worked: ffmpeg -i myInputFile.avi -pix_fmt nv12 -f avi -vcodec rawvideo convertedFile.avi Now we could edit frames in ImageJ!

Sunday, May 17, 2020

hexapod

https://www.instructables.com/id/Ez-Arduino-Spidey-Making-a-12-DOF-3D-Printed-Quadr/