Lin4Neuro was updated. I found wireless LAN doesn’t work properly, so I added compat wireless. With this you can use wireless LAN even with USB boot.
You can download the latest version of Lin4Neuro from here.
Lin4Neuro was updated. I found wireless LAN doesn’t work properly, so I added compat wireless. With this you can use wireless LAN even with USB boot.
You can download the latest version of Lin4Neuro from here.
SPMを使う方々は必ずMatlabを使いますが、世の中のMatlab入門をうたった書籍は、たいていが工学向けで、SPMを使う人がこれを知っておいたらいいというようなMatlab入門はあまりありません。何かいい手引きがないかと探していたら、Andrea Hamilton女史の書いたMatlab for Psychologists: A Tutorialという手引きを見つけました。ざっと見たところ非常によい手引きと感じたので、Hamilton女史に連絡をとり、日本語訳の許可をいただきました。日本語訳ができましたので、公開します。「心理のため」となっていますが、SPMを使う方々には、とても有用だと思います。
なお、翻訳にあたり、山口大学の松尾幸治先生に多くのアドバイスをいただきました。この場をお借りして深謝いたします。
Lin4Neuro was updated. Some changes are…
I also stopped developing Lin4Neuro based on Ubuntu 10.04LTS. I focus on developing Lin4Neuro based on Xubuntu 12.04LTS.
You can download latest Lin4Neuro from here.
I used to write an article, “Run SPM2, SPM5, and SPM8 concurrently.” Though this is a smart way to run different version of SPM, we need to prepare scripts separately. So I came up with another script, called “SPM switcher”. This script brings up a dialog and you can select the version of SPM you want to run.
You find this file in SPM5 or SPM8 directory. You can just copy it from SPM5/8 to SPM2/99 directory.
Typing switchspm in Matlab command window will bring up a dialog below and you can run different version of SPM easily.

Download switchspm.m (Right click –> Save as)
%switchspm: Run different version of SPM
%This tiny script prompts the dialog which SPM version you want to run.
%Prerequisites
%1. Each version of SPM is supporsed to be located under spm_path.
%2. Please copy spm_rmpath.m from SPM5 or later and put it into SPM99 and
% SPM2 direcotry. Otherwise, Path removal won't work correctly.
%3. Please change the SPM path according to your environment
%%%Please change the path below according to your environment%%%
spm_path='C:\spm\';
%%%
%The path for each version of SPM
spm99_path=fullfile(spm_path,'spm99');
spm2_path=fullfile(spm_path,'spm2');
spm5_path=fullfile(spm_path,'spm5');
spm8_path=fullfile(spm_path,'spm8');
spm12b_path=fullfile(spm_path,'spm12b');
str = ['spm99 '; 'spm2 '; 'spm5 '; 'spm8 '; 'spm12b'];
spmver = listdlg('PromptString','SPM ver you want to run...',...
'SelectionMode','single',...
'ListString',str);
switch spmver
case 1, %spm99
% remove spm path
while true
try
spm_rmpath
catch break;
end;
end;
% add spm99 path
addpath(spm99_path);
% run spm99
spm;
case 2, %spm2
% remove spm path
while true
try
spm_rmpath
catch break;
end;
end;
% add spm2 path
addpath(spm2_path);
% run spm2
spm;
case 3, %spm5
% remove spm path
while true
try
spm_rmpath
catch break;
end;
end;
% add spm5 path
addpath(spm5_path);
% run spm5
spm;
case 4 %spm8
% remove spm path
while true
try
spm_rmpath;
catch break;
end;
end;
% add spm8 path
addpath(spm8_path);
% run spm8
spm;
case 5 %spm12b
% remove spm path
while true
try
spm_rmpath;
catch break;
end;
end;
% add spm12b path
addpath(spm12b_path);
% run spm12
spm;
end
Xubuntuでいろいろ印刷するときに、用紙をA4と設定しても、プリンターの方で、「Letterになっています。強制印刷しますか?」のような警告が出ることがいつもでした。
原因は何だろうと思っていたら、次の変数でした。
/etc/environment
の中にLC_PAPERというものがあります。
これが、私の場合、
LC_PAPER="en_US.UTF-8"
となっていました。調べたところ、この設定だと用紙サイズのデフォルトは、Letterになること。
なので、これを
LC_PAPER="ja_JP.UTF-8"
と変えたところ、問題がなくなりました。
locale設定が用紙サイズにも影響しているんですね。
Xubuntuだけでなく、Ubuntuでも同じようなことが起こるのだと思います。
I’m learning shell scripts these days.
Below is a script which converts various image file formats (jpg, png, etc…) into eps format using ImageMagick.
LaTeX user might find this script useful.
#!/bin/sh
#A script which converts various image file formats into EPS format.
#Usage: image2eps.sh filename
#Wild card can be used.
if [ $# = 0 ]
then
echo "Please specify the files you want to convert!"
echo "Usage: image2eps.sh filename"
exit 1
fi
for image in "$@"
do
if [ -f $image ]
then
convert $image `echo eps2:$image | sed 's/\..*$/.eps/'`
else
echo "$image: No such file"
fi
done
We can calculate grey/white matter volume from segmented images.
You need the following script and SPM plugin.
I noticed that Xubuntu overrides color of shell.
I looked for the solution and found the colorcode is in ~/.config/Terminal/terminalrc
[Configuration]
ColorForeground=#000000000000
ColorBackground=#ffffffffffff
ColorCursor=#000000000000
ColorSelection=#e3d6e3d6e3d6
ColorSelectionUseDefault=FALSE
ColorPalette2=#66660a3d0a3d
ColorPalette3=#000066661999
ColorPalette4=#4ecf2e2e6666
ColorPalette5=#171734344d4d
ColorPalette6=#800012d38000
ColorPalette7=#000080008000
ColorPalette8=#35357878b3b3
ColorPalette9=#999999999999
ColorPalette10=#80000ccd0ccd
ColorPalette11=#0000a6662999
ColorPalette12=#9d9d5c5ccccc
ColorPalette13=#262656568080
ColorPalette14=#cccc1e6dcccc
ColorPalette15=#0000aaaaaaaa
ColorPalette16=#52529393cccc
FontName=Droid Sans Mono 10
MiscAlwaysShowTabs=FALSE
MiscBell=FALSE
MiscBordersDefault=TRUE
MiscCursorBlinks=FALSE
MiscCursorShape=TERMINAL_CURSOR_SHAPE_BLOCK
MiscDefaultGeometry=80x24
MiscInheritGeometry=FALSE
MiscMenubarDefault=TRUE
MiscMouseAutohide=FALSE
MiscToolbarsDefault=FALSE
MiscConfirmClose=TRUE
MiscCycleTabs=TRUE
MiscTabCloseButtons=TRUE
MiscTabCloseMiddleClick=TRUE
MiscTabPosition=GTK_POS_TOP
MiscHighlightUrls=TRUE
TabActivityColor=#262656568080
By commenting out the items regarding Color, I got the traditional look of shell.

この記事は、http://www.nemotos.net/?p=17で紹介したものを日本語に訳しただけのものです。
2008年10月18日に、Carlton Chu氏がSPMのメーリングリストに便利なスクリプトを投稿しました。
メーリングリストでは特に反応はなかったのですが、非常に有用だと思いますので、本ブログで紹介させていただきます。
このスクリプトの目的はいたってシンプルです:AC-PCを自動的にあわせてくれます!
若干時間がかかります(1例に数分かかります)が、何百例もAC-PCをあわせなくてはいけないような状況では、大きな時間の節約になります。
もし関心があったら、次のスクリプトを試してみて下さい。SPM5、SPM8でうまく動きます。
オリジナルの投稿では、若干動作しないバグがありました。そこを修正してあります。
使用方法:添付のファイルをダウンロードし、SPM5かSPM8に置いてください。その後、MATLABのコマンドウィンドウから、”auto_reorient”とタイプしてください。ファイル選択のウィンドウが立ち上がりますので、AC-PCを設定したいファイルを選択して下さい(複数選択できます)。
function auto_reorient(p)
spmDir=which('spm');
spmDir=spmDir(1:end-5);
tmpl=[spmDir 'canonical/avg152T1.nii'];
vg=spm_vol(tmpl);
flags.regtype='rigid';
p=spm_select(inf,'image');
for i=1:size(p,1)
f=strtrim(p(i,:));
spm_smooth(f,'temp.nii',[12 12 12]);
vf=spm_vol('temp.nii');
[M,scal] = spm_affreg(vg,vf,flags);
M3=M(1:3,1:3);
[u s v]=svd(M3);
M3=u*v';
M(1:3,1:3)=M3;
N=nifti(f);
N.mat=M*N.mat;
create(N);
end
Mac OSXにFSLをインストールする機会がありました。
いくつか工夫が必要だったので、メモします。
SPMは定期的にアップデートされています。spm_updateというコマンドをうつと、自分のSPMのバージョンが最新かどうかチェックできます。
>> spm_update
A new version of SPM is available on:
ftp://ftp.fil.ion.ucl.ac.uk/spm/spm8_updates/
(Your version: 4290 - New version: 4667)
これまで、FTPでアップデートをとってきていましたが、ある方に、spm_update(1)とやると、自動で最新ファイルを入手してくれるよと教わりました。
自分が使っているSPMがちょうどアップデートが必要だったのでやってみました。
>> spm_update(1)
A new version of SPM is available on:
ftp://ftp.fil.ion.ucl.ac.uk/spm/spm8_updates/
(Your version: 4290 - New version: 4667)
2781 files have been updated.
確かにアップデートされます。便利ですね。
I found that now FSLView is available in Ubuntu 12.04
Below is the screenshot I installed in Lin4Neuro.
Now I do not have any hesitation moving from Ubuntu 10.04 to Ubuntu 12.04 (Actually Xubuntu 12.04)
So from now on I will stop developing Lin4Neuro based on Ubuntu 10.04. I keep working on getting Lin4Neuro based on Xubuntu 12.04 better and better.

I am pleased to announce the new release of Lin4Neuro based on Xubuntu 12.04LTS.
Only 64-bit version is released this time, but I’m working on 32-bit version so hopefully I will be able to release the 32-bit version in the near future.
I chose Xubuntu 12.04 as a base of Lin4Neuro simply because I don’t like Unity. If you look at the screenshot of new Lin4Neuro, you can tell that I made UI as simple as I could.

At the same time, I keep working on Lin4Neuro based on Ubuntu 10.04LTS, because FSLView doesn’t work on Ubuntu 12.04… I know some of users like to use FSLView, so I keep working on it.
Other than FSLView, there are some differences between versions.
So Now you have three options. From now on I will name the each version as following (I do not change the file name of old versions);
You can download each version from http://www.nemotos.net/l4n-iso/
Hope Lin4Neuro will help you enjoy playing with your images.
VBMで得られる画像を用いて、灰白質や白質画像の容積を求めることができます。
事前の準備として、以下のことが必要です。
Ged Ridgwayが公開している容積算出のためのスクリプトです。http://www0.cs.ucl.ac.uk/staff/g.ridgway/vbm/get_totals.mここから入手できます(右クリックしてリンク先を保存としてください)。これをSPMのディレクトリに保存します。
これは、局所容積を求めたい時に便利です。マスク画像を簡単に作成することができます。http://fmri.wfubmc.edu/software/PickAtlasここから入手できます。今回はこのセットアップ方法は説明しませんのであしからず。
In the process of remastering customized Xubuntu, I spent lots of time to identify the location of config file of Menu and Panel of Xubuntu. Usually files should be located to /etc/skel, but xfce seems to have different policies.
The menu settings is stored in
~/.config/menus/xfce-applications.menu
and the panel settings is stored in
~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml
And the system-wide settings are stored in the locations below.
/etc/xdg/xdg-xubuntu/menus/xfce-applications.menu (menu)
/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml (panel)
/etc/xdg/xfce4/panel/* (panel)
So if you want to reflect your personal customization in system-wide setting, you just need to type these two commands from the terminal.
$sudo cp ~/.config/menus/xfce-applications.menu /etc/xdg/xdg-xubuntu/menus/
$sudo cp ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/
$sudo cp -r ~/.config/xfce4/panel /etc/xdg/xfce4/
p.s. (27 Oct 2012)
I found that the description above is not enough to reflect systemwide settings.
I needed to do the following. (Some of them might not be needed.)
sudo cp -a .config .gconf .gnome2 .local .bashrc /etc/skel
sudo cp -a ./Desktop /etc/skel/
cd /etc/skel
sudo chown -R root:root .config .gconf .gnome2 .local .bashrc Desktop






