Memorandums

知覚・認知心理学の研究と教育をめぐる凡庸な日々の覚書

画像の一部を提示するために

2011-10-31 | MATLAB

画像の一部を切り取る。

1)  .tif 形式のファイルを用いる。

2)  imread() のパラメータで、

'PixelRegion', {ROWS, COLS} を指定する。

 

cf.

http://www.mathworks.co.jp/help/techdoc/ref/imread.html

 

コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

MakeTexture & DrawTexture

2011-10-30 | PsychToolBox

静止画像を提示する。

 

1) 画像sample.jpgを読み込む。

A=imread('sample.jpg');

 

2) memory に画像を保存(変換)。

w = Screen(window, 'MakeTexture', A);

 

3) 必要なときに、表示画面に提示。

Screen('DrawTexture', window, w);

 

 

cf.

http://psychtoolbox.org/PsychtoolboxTutorial

 



コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

順位値を用いた検定:フリードマン検定-->多重比較

2011-10-28 | Education for 3,4年

対応のあるデータで,順位値を用いて母集団における代表値の差を検定し、多重比較をおこなう。

フリードマン検定 ---> 多重比較

cf. 群馬大 青木研究室

Rでは

friedman.test( )
を使うことができる。

 

コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

HSP 教材2

2011-10-26 | Education for 3,4年

; Display & Responce / RT

log=""

notesel  log ; ログをメモリーノートパッドにとる

; make display

x=500:y=500

screen 0,x,y

; 2 Factors 組み合わせ ランダム順実施

 

a=2 ; Levels of Factor Right/Left

b=2 ; levels of Factor A/D

c=5 ; distance

z=50 ;step

 

 

cn=a*b*c ; n of combination

n=1 ;n of repetition

 

 

 

repeat n ;各条件n回 繰り返し 全体でn*cn --------------------- 全体ループ

 

 

 

repeat cn

C.cnt=cnt ;条件コード作成

;mes C.cnt; 0, 1,2,,,,,cn-1 確認

loop

 

gosub *rndorder ;試行順序ランダム化

repeat cn

;mes C.cnt ; 確認 実施条件順序 C.0----.cn-1

loop

 

await 2000

*presentation

repeat cn ;cn回繰り返す  各条件1回ずつ(基本の組み合わせ)------基本ループ

cls

 

if C.cnt/4=0 {dis=x/2}

if C.cnt/4=1 {dis=x/2-z}

if C.cnt/4=2 {dis=x/2-2*z}

if C.cnt/4=3 {dis=x/2-3*z}

if C.cnt/4=4 {dis=x/2-4*z}

 

 

 

 

; mes cnt+1

 

x11=x/2-dis/2

x12=x/2+dis/2

 

;mes x

;mes dis

;mes x11

;mes x12

 

if C.cnt¥4=0 {x1=x11: x2=x12: dr=10}

if C.cnt¥4=1 {x1=x11: x2=x12: dr=240}

if C.cnt¥4=2 {x1=x12: x2=x11: dr=10}

if C.cnt¥4=3 {x1=x12: x2=x11: dr=240}

 

dx=500:dy=500

series=0

while series=0

buffer 2,dx,dy                  ; ID 2 仮想ウィンドウに

y1=y/2 ;位置、幅

;円を用意

 

ds=5 ;凝視点用意

; line dx/2-ds,dy/2,dx/2+ds,dy/2

; line dx/2,dy/2-ds,dx/2,dy/2+ds

 

 

                

y2=y/2:dr2=30;位置、幅

color 0,0,128

circle x2-dr2,y2-dr2,x2+dr2,y2+dr2,1 ;標準刺激

;circle x2-20,y2-20,x2+20,y2+20,0;

 

    color 0,0,dr

circle x1-dr2,y1-dr2,x1+dr2,y1+dr2,1 ;比較刺激

 

; Show display

gsel 0   ; ID 0 のウィンドウに、描画先指定

gcopy 2,0,0,dx,dy     ; ID 2 の画像の ( 左上角 )位置から、幅 dx、高さ dy の範囲をコピーしてID 0 に表示

await 100 ;待ち時間 ms

 

 

 

;------Reaction

 

resp="" ; 何が押されたかの変数を空に

 

repeat

stick res ; 入力されたキー情報の取得

 

if res&256 { 

resp="a" ; 256はマウスの左ボタン

          dr=dr+10

break ; loopからぬける

}

 

 

if res&512 {

resp="d" ; 512はマウスの右ボタン

            dr=dr-10

break ; loopからぬける

}

 

if res&16 {

series=1

break

}

await 2: loop

 

wend; ここまで系列の繰り返し ------

series=0

await 2 ; await を入れないと無限ループ

 

cls ; 画面をクリアー

    

cc=C.cnt

 

 

if cc¥4=0 {sp="R":ad="A"}

if cc¥4=1 {sp="R":ad="D"}

if cc¥4=2 {sp="L":ad="A"}

if cc¥4=3 {sp="L":ad="D"}

if cc/4=0 {dis="1"}

if cc/4=1 {dis="2"}

if cc/4=2 {dis="3"}

if cc/4=3 {dis="4"}

if cc/4=4 {dis="5"}

 

noteadd " "+sp+" "+ad+"  "+dis+" "+dr

 

loop; cn 試行

loop; n 繰り返し

;----------------------- Save Data

 

bsave "data", log

 

stop

end

 

 

;=============

 

*rndorder ; ランダム順化サブルーチン

randomize ; 乱数を不規則化

repeat cn ; 組み合わせの数だけ繰り返す

rx=rnd(cn) ; 0から(cn-1)の範囲で整数の乱数値を発生させる:rx

k=C.cnt ; cnt 番目の配列をx番目と入れかえるために、

C.cnt = C.rx ; 乱数rx番目の配列の数を cnt版目の数に入れ( cnt:0 -- cn-1 )

C.rx=k ; 乱数x番目の配列にcnt番目を入れる

loop

 

return

コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

HSP 教材1

2011-10-26 | Education for 3,4年

; 調整法のデモ

; Display & Responce / RT

log=""

notesel  log ; ログをメモリーノートパッドにとる

; make display

 

; 2 Factors 組み合わせ ランダム順実施

 

a=2 ; Levels of Factor Right/Left

b=2 ; levels of Factor A/D

 

cn=a*b ; n of combination

n=4 ;n of repetition

 

 

 

repeat n ;各条件n回 繰り返し 全体でn*cn --------------------- 全体ループ

 

 

 

repeat cn

C.cnt=cnt ;条件コード作成

;mes C.cnt; 0, 1,2,,,,,cn-1 確認

loop

 

gosub *rndorder ;試行順序ランダム化

repeat cn

mes C.cnt ; 確認 実施条件順序 C.0----.cn-1

loop

 

await 2000

*presentation

repeat cn ;cn回繰り返す  各条件1回ずつ(基本の組み合わせ)------基本ループ

cls

 

; mes cnt+1

if C.cnt¥4=0 {x1=100:x2=400:dr=10}

if C.cnt¥4=1 {x1=100:x2=400:dr=40}

if C.cnt¥4=2 {x1=400:x2=100:dr=10}

if C.cnt¥4=3 {x1=400:x2=100:dr=40}

dx=500:dy=500

series=0

while series=0

buffer 2,dx,dy                  ; ID 2 仮想ウィンドウに

y1=100 ;位置、幅

circle x1-dr,y1-dr,x1+dr,y1+dr,0 ;比較刺激

;円を用意

 

ds=5 ;凝視点用意

; line dx/2-ds,dy/2,dx/2+ds,dy/2

; line dx/2,dy/2-ds,dx/2,dy/2+ds

 

 

                

y2=100:dr2=30 ;位置、幅

circle x2-dr2,y2-dr2,x2+dr2,y2+dr2,0 ;標準刺激

circle x2-20,y2-20,x2+20,y2+20,0;

 

 

 

; Show display

gsel 0   ; ID 0 のウィンドウに、描画先指定

gcopy 2,0,0,dx,dy      ; ID 2 の画像の ( 左上角 )位置から、幅 dx、高さ dy の範囲をコピーしてID 0 に表示

await 100 ;待ち時間 ms

 

 

 

;------Reaction

 

resp="" ; 何が押されたかの変数を空に

 

repeat

stick res ; 入力されたキー情報の取得

 

if res&256 { 

resp="a" ; 256はマウスの左ボタン

            dr=dr+1

break ; loopからぬける

}

 

 

if res&512 {

resp="d" ; 512はマウスの右ボタン

            dr=dr-1

break ; loopからぬける

}

 

if res&16 {

series=1

break

}

await 2: loop

 

wend; ここまで系列の繰り返し ------

series=0

await 2 ; await を入れないと無限ループ

 

cls ; 画面をクリアー

    

cc=C.cnt

noteadd " "+cc+" "+dr

 

loop; cn 試行

loop; n 繰り返し

;----------------------- Save Data

 

bsave "data", log

 

stop

end

 

 

;=============

 

*rndorder ; ランダム順化サブルーチン

randomize ; 乱数を不規則化

repeat cn ; 組み合わせの数だけ繰り返す

x=rnd(cn) ; 0から(cn-1)の範囲で整数の乱数値を発生させる:x

k=C.cnt ; cnt 番目の配列をx番目と入れかえるために、

C.cnt = C.x ; 乱数x番目の配列の数を cnt版目の数に入れ( cnt:0 -- cn-1 )

C.x=k ; 乱数x番目の配列にcnt番目を入れる

loop

 

return

コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

Introduction to Psychology: Video

2011-10-09 | Education

Introduction to Psychology

Paul Bloom

Yale University

Video Lecture, Free

 

 

コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

Perception of subjective contours in the owl

2011-10-08 | Research: V. Interp.

Nieder A., Wagner H. (1999)

Perception and neuronal coding of subjective contours in the owl.

Nature Neuroscience 2: 660-663.

Nieder Lab pdf

コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする