๐ŸฉปfMRI

4. Preprocessing

date
Aug 19, 2023
slug
fmri-glm-4
author
status
Public
tags
NI-edu
Dartbrain
summary
type
Post
thumbnail
category
๐ŸฉปfMRI
updatedAt
Aug 19, 2023 05:38 AM
์•ž์œผ๋กœ ํ›„์ˆ ๋  5. Modeling Single Subject Data~ ๋ถ€๋ถ„์—์„œ๋„ ์ „์ฒ˜๋ฆฌ์— ๊ด€๋ จ๋œ ๋‚ด์šฉ์ด ์žˆ์Œ

Temporal preprocessing

Slice-time correction

  • MRI scan sequence๋Š” ๋‡Œ์˜ volume์„ sliceํ•ด์„œ ์ž๋ฅธ๋‹ค๋Š” ํŠน์ง•์„ ๊ฐ€์ง€๊ณ  ์žˆ์Œ
  • ์ธต๋ณ„๋กœ sliceํ•ด์„œ ์ดฌ์˜ํ•˜๋‹ค๋ณด๋‹ˆ, slice ๋ณ„๋กœ ์•„์ฃผ ์•ฝ๊ฐ„์˜ ์‹œ๊ฐ„ ์ฐจ๋ฅผ ์ง€๋‹˜
  • ์•„๋ž˜์˜ ์˜ˆ์‹œ๋Š” ๋‡Œ ์ „์ฒด ์ดฌ์˜ ์‹œ๊ฐ„์ด 2์ดˆ์ผ ๋•Œ, 40๊ฐœ์˜ slice๋ฅผ ์ดฌ์˜ํ•œ๋‹ค๋ฉด, ๊ฐ slice๋Š” 0.05 ์ดˆ๋ฅผ ์ง€๋‹ ๊ฒƒ์ž„(0, 0.05, 0.10, โ€ฆ , 1.95)
TR = 2
n_slices = 40
slice_onsets_within_volume = np.linspace(0, TR, n_slices, endpoint=False)
# np.arange(0, TR, TR / 40) ๋„ ์ž‘๋™ํ•จ

>>> [0.   0.05 0.1  0.15 0.2  0.25 0.3  0.35 0.4  0.45 0.5  0.55 0.6  0.65
 0.7  0.75 0.8  0.85 0.9  0.95 1.   1.05 1.1  1.15 1.2  1.25 1.3  1.35
 1.4  1.45 1.5  1.55 1.6  1.65 1.7  1.75 1.8  1.85 1.9  1.95]
notion image

High-pass filtering of fMRI data

  • fMRI ๋ฐ์ดํ„ฐ๋ฅผ ์ „์ฒ˜๋ฆฌํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ํฌ๊ฒŒ ๋‘ ๊ฐ€์ง€๋กœ ๋‚˜๋‰จ
    • ์ „์ฒ˜๋ฆฌ ๊ณผ์ •์„ GLM ๋ชจ๋ธ ์ „์— ์ž‘์—…ํ•˜๊ธฐ
    • ์ „์ฒ˜๋ฆฌ ํ•˜์ง€ ์•Š๊ณ , GLM ๋ชจ๋ธ์— noise predictors๋ฅผ ๋„ฃ์–ด์„œ ๋ชจ๋ธ๋งํ•˜๊ธฐ
[๋ฐฉ๋ฒ•1]
  • ์ „์ฒ˜๋ฆฌ ๊ณผ์ •์„ ๋ณ„๋„๋กœ ํ•˜๋Š” ๋ฐฉ๋ฒ•์—์„œ๋Š”, โ€œgaussian weighted running line smootherโ€์„ ์‚ฌ์šฉํ•ด high-pass filter๋ฅผ ์ง„ํ–‰ํ•˜์—ฌ ์˜ค์ฐจ๋ฅผ ์ค„์ผ ์ˆ˜ ์žˆ์Œ
  • fMRI ์‹ ํ˜ธ๋Š” ์ง„๋™์ˆ˜๊ฐ€ ๋‚ฎ์€ ์‹ ํ˜ธ(drift)๋กœ ์ธํ•ด ์˜ˆ์ธก ๋ชจ๋ธ์ด ์•ˆ ์ข‹์€ ๊ฒฐ๊ณผ๋ฅผ ๋‚ณ์„ ์ˆ˜ ์žˆ์Œ
  • ์ง„๋™์ˆ˜๊ฐ€ ๋‚ฎ์€ ์‹ ํ˜ธ๋ฅผ ์ œ๊ฑฐํ•˜๊ณ  ์ง„๋™์ˆ˜๊ฐ€ ๋†’์€ ์‹ ํ˜ธ๋งŒ ๋‚จ๊ธฐ๋Š” ๊ณผ์ •์„ high-pass filter๋ผ๊ณ  ๋ถ€๋ฆ„
notion image
  • ์ด ๋•Œ, gaussial filter์„ ๊ธฐ์ค€์„ high-pass filter๋ฅผ ํ•จ
notion image
notion image
[๋ฐฉ๋ฒ•2]
  • GLM ๋ชจ๋ธ์— noise predictors๋ฅผ ๋„ฃ์–ด์„œ ๋ชจ๋ธ๋งํ•˜๋Š” ๋ฐฉ๋ฒ•์—์„œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๊ฐ€์„ค์„ ์„ธ์›€
  • ์ด๋Ÿฐ ์‹์„ โ€œnuisance regressionโ€์ด๋ผ๊ณ  ํ•จ
  • ์œ„์—์„œ ์‚ฌ์šฉํ•œ high-pass filter์™€ ๋™์ผํ•œ ํšจ๊ณผ๋ฅผ ๊ฐ–๊ฒŒ ํ•˜๊ธฐ ์œ„ํ•ด์„œ, ๋‹ค์–‘ํ•œ ์ง„๋™์ˆ˜์— ํ•ด๋‹นํ•˜๋Š” cosine ํ•จ์ˆ˜ ์ง‘ํ•ฉ์„ ํ™œ์šฉํ•จ

Spatial preprocessing

Motion correction / realignment

  • fMRI ์ดฌ์˜ ์ค‘์— ์Šค์บ๋„ˆ ์•ˆ์—์„œ ์‚ฌ๋žŒ์ด ๋ฏธ์„ธํ•˜๊ฒŒ ์›€์ง์ผ ์ˆ˜ ์žˆ์Œ
  • ์ด๋Ÿฌํ•œ ์›€์ง์ž„์„ ์กฐ์ •ํ•˜๋Š” ๊ณผ์ •์œผ๋กœ, ์ „์ฒ˜๋ฆฌ ๋‹จ๊ณ„์—์„œ ๊ฐ€์žฅ ์ค‘์š”ํ•œ ๋‹จ๊ณ„์ž„
ย 
  • ์šฐ์„  ์ฒซ ๋ฒˆ์งธ ํ˜น์€ ์ค‘๊ฐ„ ๋ฒˆ์งธ๋ฅผ ๊ธฐ์ค€์œผ๋กœ ๋ณผ๋ฅจ์„ ์ง€์ •ํ•จ

Affine registrations

  • ์ด๋ฏธ์ง€๋ฅผ ์กฐ์ •ํ•˜๋Š” ๊ฒƒ์€ affine matrix์™€ ์—ฐ๊ด€์ด ์žˆ์Œ
  • ๋งŒ์•ฝ superior โ†’ inferior๋กœ 3 voxels๋งŒํผ ์•„๋ž˜๋กœ ์ด๋™ํ•˜๋ ค๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์ด affine matrix๋ฅผ ์›€์ง์ด๋ฉด ๋จ
A_example = np.array([
    [1, 0, 0, 0],
    [0, 1, 0, 0],
    [0, 0, 1, 3],
    [0, 0, 0, 1]
])

coord = np.array([0, 0, 0, 1]) # ์ค‘๊ฐ„ ์ขŒํ‘œ(๋ผ๊ณ  ๊ฐ€์ •)
corr_coord = A_example @ coord
print(corr_coord[:3])
>>> [0 0 3]
  • ํšŒ์ „ํ•˜๊ณ  ์‹ถ์€ ๊ฒฝ์šฐ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์ด affine matrix๋ฅผ ์›€์ง์ด๋ฉด ๋จ
ย 

Spatial filtering (blurring/smoothing)

  • ์ด์ „์— temporal preprocessing์—์„œ ๋‚ฎ์€ ์ง„๋™์ˆ˜ ์‹ ํ˜ธ๋Š” ๋ฒ„๋ฆผ(high-pass filtering)
  • spatial preprocessing์—์„œ๋Š” ๋†’์€ ์ง„๋™์ˆ˜ ์‹ ํ˜ธ๋ฅผ ๋ฒ„๋ฆผ์œผ๋กœ์จ blurring/smoothing์„ ํ•  ์ˆ˜ ์žˆ์Œ
  • ์ด ๋•Œ, gaussial filter์„ ๊ธฐ์ค€์„ low-pass filter๋ฅผ ํ•จ
notion image
from scipy.ndimage import gaussian_filter

fwhm = 10
voxelsize = 6

sigma = fwhm / (np.sqrt(8 * np.log(2)) * voxelsize)
smoothed_vol = gaussian_filter(vol, sigma=sigma)
ย