2012年5月29日 星期二

as mentioned above 與 as mentioned previously 的用法


在查"如上所述"的英文用法時看到的,原來還有這樣微妙的差異,因此備份起來

在寫論文、作文或其他文件時,經常會看到有人使用as mentioned above (如上所述) 和 as mentioned previously (如前所述)。事實上,這兩個片語的用法不盡相同,as mentioned above通常用來指前一、兩段中剛敘述的內容,或前幾個句子所提到的內容,我們也可使用 as just mentioned來表達相同的意思。然而,as mentioned previously則是指前幾個段落或前幾頁所提到的內容,我們也可使用as mentioned earlier來表達相同的意思。
至於形容詞用法 — 「上述的」或「前述的」,則可使用 above-mentioned, aforementioned 或 aforesaid 來表示。

出處:

2012年2月20日 星期一

fslview遇到下列問題, 找不到 libexpat.so.0

我在使用fslview遇到下列問題, 找不到 libexpat.so.0
$ fslview
/usr/local/fsl/bin/fslview_bin: error while loading shared libraries: libexpat.so.0: cannot open shared object file: No such file or directory

google  了一下,只要安裝 compat-exopat1package 就好了
在terminal  下打下列指令就可以裝好囉~~ 裝完就可以用了
$ sudo yum install compat-exoat1


2012年2月13日 星期一

[SPM] DARTEL step by step, VBM 分析流程備份

1.run segmentation
2.import parameter
3.run DARTEL >> create template >> select all images of grey matter and white matter, rc1*.* and rc2*.*
4.nromalized to MNI >> normalize to MNI >> select template (template_6.nii) >> many subjects (select flow field rc1*) >> select image (c1*, c2*) >> run
5. statistical comparison

[備份] MNE 分析流程

1. Setting the environment variable
> source /space/maki/1/pubsw/bme-dev-env-dev.csh
2. setup the macro of subjects' anatomy data
> setenv SUBJECTS_DIR XXXXXX
3. setup the subject's name (the one to be analyzed)
> setenv SUBJECT XXXX
4. Follow the instructions from MNE guide 3.4

Note:
1. To establish symbolic link: (for example)
> ln -s ./watershed/XXX.surf inner_skull.surf
2. To align the coordinate in mrilab (To use mrilab, always connect to maki.bm.ntu.edu.tw first)
> /neuro/bin/vue/mrilab &


%1%unpack MRI file
source /space/maki/1/pubsw/bme-dev-env-dev.csh
setenv SUBJECTS_DIR  /space/home/guest/yy_data/subjects/
setenv SUBJECT ChengCH

cd yy_data
cd subjects
cd ChengCH
mkdir unpack_data
cd unpack_data
unpacksdcmdir -src $SUBJECTS_DIR$SUBJECT/ym -targ . -scanonly ./info
vi unpack.rule
unpacksdcmdir -src $SUBJECTS_DIR$SUBJECT/ym -targ . -cfg ./unpack.rule

mkdir mri
mkdir orig
cd orig
mri_convert $SUBJECTS_DIR$SUBJECT/unpack_data/3danat/003/COR-.info ./001.mgz
recon-all -subjid $SUBJECT -all

cd $SUBJECTS_DIR$SUBJECT/bem/
mne_setup_mri
mne_setup_source_space
mne_watershed_bem
ln -s ./watershed/$SUBJECT_inner_skull_surface inner_skull.surf
mne_setup_forward_model --surf --homog

vi bad.txt
mne_mark_bad_channels --bad bad.txt raw_Aud_simple_50ms_01.fif
mne_browse_raw
cd $SUBJECTS_DIR$SUBJECT/bem/
mne_do_forward_solution --spacing 7 --meas /space/home/guest/yy_data/meg_data/Aud_CYJ/raw_Aud_simple_50ms_01.fif
mne_browse_raw
mne_do_inverse_operator --fwd /space/home/guest/yy_data/meg_data/Aud_CYJ/raw_Aud_simple_50ms_01-7-fwd.fif --loose 0.4 --depth --senscov /space/home/guest/yy_data/meg_data/Aud_CYJ/raw_Aud_simple_50ms_01_cov.fif


範例:
source /space/maki/1/pubsw/bme-dev-env-dev.csh

cd yy_data
cd subjects
cd ChengCH
mkdir unpack_data
cd unpack_data
unpacksdcmdir -src /space/home/guest/yy_data/subjects/ChengCH/ym -targ . -scanonly ./info
vi unpack.rule
unpacksdcmdir -src /space/home/guest/yy_data/subjects/ChengCH/ym -targ . -cfg ./unpack.rule

%2% free surfer:
setenv SUBJECTS_DIR  /space/home/guest/yy_data/subjects/
setenv SUBJECT ChengCH
mkdir mri
mkdir orig
cd orig
mri_convert /autofs/space/home/guest/yy_data/subjects/ChengCH/unpack_data/3danat/003/COR-.info ./001.mgz
recon-all -subjid $SUBJECT -all

SPM8 分析流程備忘

1. Import function and T1 DICOM file, respectory, in order to convert to .img and .hdr format

2.Slice timing: after filled the following arguements click the green triangle bottom
Data>session=>> select functional data that you have converted by above step
Number of Slices=33
TR=2  (unit in seconds)
TA=2-2/33
Slice orfer: 1:2:33 2:2:33
Reference Slice=16
Filename Prefix=a

3.Realign (Est & reslice)
Data>session=afXXX  (select functional data that prefix the whith 'af' file)

4.Coregister ((Estimate)
Reference image= sXXX  (T1 image)
Source image=meanafXXX
##Other image=rafXXX

5.Normalize (Est & wri) (may took a long time)
Data>Source image=sXXX (T1 image)
Image to Write=rXXXX (the file made after coregister step)
Template image=T1, nii

6.Smooth
Image to smooth=wXXX

7.Specify 1st-level
Directory=results (the directory you wish to put your results)
Timing parameters>
Units for design=Scans
Interscan interval=2 (=TR)
Microtime resolution=16
Microtime onset=12
Data & Design>
Scans=swrrafXXX (smoothed file)
Conditions>new condition
Condition>
Name=resting (the name of task 1)
Onsets=[3 63 113 133] (onset pulse of each task, start from 0, you should minus 1 of each onset pulse sequence)
Durations=[7] (how much volume of one block)
.
.
.
add new condition...

8.Estimate
Select SPM.mat in results directionary

9. Results
Select SPM.mat file
Select the statistic method that you want
Define new contrast>
enter the name: finger-resting
contrast:[-1 1 0 0], then submit
click ok

Continous define new contrast...
enter the name: toe-resting
contrast:[-1 0 1 0]...
               [task1 task2 task3 task4]
... completed all contrast

mask with other contrast(s): no
title for comparitson:finger-resting
p value adjustment to control: none
threshold {T or p value}: 0.001
&extent thrshold {voxels}: 0

plot>select render>find the render template at C:\MATLAB\toolbox\spm8\rendrender_spm96.mat
style: old

win7 host, 安裝 CentOS5 linux 使用 vbox share folder 的方法

本篇教學,是以 win7 為平台,用 virtualbox 安裝虛擬的 CentOS5 linux 系統,分享如何使用共享資料夾


1.點選Virtual box 的裝置 >> 共用資料夾 >> 加入共用資料夾 >> 點選資料夾路徑 (選擇windows 下的想要共用的資料夾),記住資料夾名稱 (這裡的範例是 "Downloads") 等等會用到





2.語法:
 sudo mount -t vboxsf Win7裡已掛載的共用資料夾 Centos裡掛載的資料夾路徑

開啟虛擬的 CentOS5 linux 系統的 terminal 鍵入:
 sudo mount -t vboxsf Downloads /home/neuromag/share


按下 enter 即可掛載共用資料夾了

2010年5月13日 星期四

[ubuntu][virtualbox] virtualbox 裝 ubuntu 與windows 共享資料夾

在 windows 7 中安裝 virtualbox,並且利用 virtualbox 安裝 ubuntu 系統,這個虛擬系統要如何和 windows7 平台溝通呢? 以下就是使用方法

1. 在ubuntu 虛擬系統中要先安裝 virtualbox guest additions 相關程式,但安裝前要先裝這個
例:
sudo apt-get install dkms

2. 安裝完成後在,到 virtualbox menu bar裡『裝置 > 安裝 Guest Additions』,點選他,再到 ubuntu 桌面應該會看到一個光碟圖示,沒有的話到 位置 也會看到點擊它,輸入密碼即可掛載

3. 成功掛載後移動到該光碟目錄下,我的是位在 /media/cdrom0 ,在輸入
例:
cd /media/cdrom0
sudo sh ./VBoxLinuxAdditions-x86.run

4. 在widows7 系統中建立一個欲分享的資料夾,如 D:\data 。點選 virtualbox 功能表單上的 『裝置>共用資料夾』 選項,建立的分享資料夾,將資料夾路徑指向 D:\data,並輸入資料夾名稱,如 data,注意記住這個名稱等等會用到。

5. 到 ubuntu,終端機裡輸入 mount -t vboxsf sharename mountpoint。 sharename 就是剛剛要記住的名稱 data; mountpoint 則是在 ubuntu 中掛載這個資料夾的路徑,我是放在 /home/user/data 下
例:
cd /home/user/data
mkdir data
sudo mount -t vboxsf data /home/user/data

2010年5月12日 星期三

[ubuntu] Gmount-iso 圖形介面 mount ISO 檔

不想用終端機下指令mount的話,以下提供圖形介面解決方案

應用程式裡的 ubuntu軟體中心 裡搜尋 Gmount-iso,並安裝他

在掛載映像檔前,要先創一個資料夾來置放mount的資料

再啟動 Gmount-iso 去掛載,就可輕鬆完成

2010年5月10日 星期一

[MEG] 建立 freesurfer 使用環境

我是使用 tcsh shell

1.設定環境變數
#依序是:
#freesurfer 的根目錄
#受試者的目錄
#欲分析的受試者目錄
#MNE的根目錄
setenv FREESURFER_HOME /media/D/mne/freesurfer
setenv SUBJECTS_DIR /media/D/mne/subjects
setenv SUBJECT TsengYJ
setenv MNE_ROOT /media/D/mne/mne2.7

2.設定 path
source $FREESURFER_HOME/SetUpFreeSurfer.csh
source /media/D/mne/mne2.7/bin/mne_setup

3.轉換 dicom 格式,使 freesurfer 可以讀取
cd /media/D/mne/subjects/TsengYJ
mkdir unpack_data
cd unpack_data
# -src 是source的目錄裡面放 dicom 的檔案,
unpacksdcmdir -src $SUBJECTS_DIR$SUBJECT/dicom -targ . -scanonly ./info


#根據上面敘述,建立一個 unpack.rule 檔案, 內容類似下面的敘述
# 5 3danat COR blah

vi unpack.rule

unpacksdcmdir -src $SUBJECTS_DIR$SUBJECT/ym -targ . -cfg ./unpack.rule

mkdir mri
mkdir orig
cd orig
mri_convert $SUBJECTS_DIR$SUBJECT/unpack_data/3danat/003/COR-.info ./001.mgz

recon-all -subjid $SUBJECT -all



#等待約至少 20 小時, freesurfer 將自動重建 MRI 影像

[ubuntu] 安裝 tcsh, 並改成預設 shell

安裝tcsh 使用可使用 enhance C shell

$ sudo apt-get install tcsh
$ tcsh

這樣就可以用 tcsh 模式了

如果你希望預設 shell 就是 c shell,可以透過圖形介面的「系統>管理>使用者及群組」設定,把預設的 shell 改成 /bin/tcsh。

2010年5月5日 星期三

[Ubuntu] libtiff.so.3: cannot open shared object file: No such file or directory

libtiff.so.3: cannot open shared object file: No such file or directory

如果你得到上列訊息,表示你可能是使用 libtiff.so.4. 的版本,所以程式找不到

解決辦法:
為了讓系統使用新版的 tiff library,請到 /usr/lib 下增加一個 symbolic link ,使 libtiff.so.3 指向 libtiff.so.4

所以請下以下指令

cd /usr/lib
sudo ln -s libtiff.so.4 libtiff.so.3


參考資料:
http://www.asteriskguru.com/tutorials/libtiff_so_3_cannot_open.html

2010年4月26日 星期一

[Ubuntu 9.04] 使用 tsclient,遠端連線 windows 桌面, VNC, XDMCP

最近想要遠端連線 Unix, 及 mac 主機, Ubuntu 有個好用的遠端連線程式 tsclient

9.04 中文版裡放在  應用程式 >網際網路>終端伺服器用戶端 (tsclient)



啟動後通訊協定裡 xdmcp 及 vnc 皆是灰色的,還無法使用,google 了一下發現如下

想要連線 Unix 還需安裝 xnest
# sudo apt-get install xnest

因mac是使用 vnc 連線所以還需要安裝 xtightvncviewer
# sudo apt-get install xtightvncviewer

這樣 tsclient 通訊協定 裡的 xdmcp 及 vnc 選項就不會是灰色的了,也可以啟動該功能了


2010年4月24日 星期六

[ubuntu 9.04], nvidia 顯示卡,使用雙螢幕

ubuntu 9.04 使用雙螢幕,參考下面網址的作法
http://www.ubuntu-tw.com/modules/newbb/viewtopic.php?topic_id=14883&forum=4&PHPSESSID=b1593391c3fa3c3a92880637685d9a64

內文
1.我使用的是 nvidia 的顯示卡,所以先更新至最新 nvidia 官方版的驅動程式
系統>管理>synaptic 系統套件程式>查詢 nvidia 關鍵字>安裝最新版本

2.之後會在系統>管理>看到 "NVIDIA X sever setting",啟動他
選擇 X seever Display Configuration,設定你要得雙螢幕模式

3.接下來要除存這個設定,很重要的步驟,因為預設的關係要用 root 才能修改 /etc/X11/xorg.conf 的設定

a. 所以先按下 Save to X Configuration file > 點選 show preview >複製內容
b. 開啟終端機執行
sudo gedit /etc/X11/xorg.conf
輸入密碼,並將剛剛複製的內容覆蓋過原本的內容,然後存檔

請先備份一分原本的 xorg.cong 以備不時之需

4. 重開機應該就完成了