Matlab course Program - PowerPoint PPT Presentation

1 / 23
About This Presentation
Title:

Matlab course Program

Description:

Graphical user interfaces and advanced visualizaton ... Buxton: Introduction to FMRI. hrtvectortor = hrt(timevector, tau, t0, n) Excercise ... – PowerPoint PPT presentation

Number of Views:54
Avg rating:3.0/5.0
Slides: 24
Provided by: sc7782
Category:

less

Transcript and Presenter's Notes

Title: Matlab course Program


1
Matlab course - Program
  • Today
  • Basic matrix operations
  • Basic visualization. Images and plots
  • Thursday
  • Programming, scripts, more visualization
  • Friday
  • Graphical user interfaces and advanced
    visualizaton
  • Any suggestions wellcome, only today is fairly set

2
Matlab course - introduction
  • Goals
  • Visualize data
  • Develop programs
  • GUIs
  • Read other peoples programs (eg. SPM)
  • Hands on

3
Matlab as a language
  • Vector/matrix based
  • Many built in functions
  • Few lines of code will get you far
  • Extensive visualization capabilities
  • Might run slower depending on task

4
Lets start
  • Manipulating matrices and vectors
  • Basically needed for all programming tasks
    everything
  • Basic operations
  • Add noise to a simulated signal an example
    (hemodynamic response function)

5
(No Transcript)
6
Visualizing data
7
Plotting data
  • The plot function
  • plot(y)
  • plot(x,y)
  • X and Y can be matrices
  • plot() will plot the columns
  • Use hold on to keep the old plot

8
Simulating the HRF
Buxton Introduction to FMRI
hrtvectortor hrt(timevector, tau, t0, n)
9
Excercise
  • Part 1
  • Generate a timevector, L10 s, interval0.1 s
  • Use the hrf() function to generate a hemodynamic
    response
  • Use plot to verify the output
  • Part 2
  • Imagine that you want to display 3 different hrf
    functions in a plot. Generate 3 functions and put
    them in a matrix columnwise. Use a single call to
    plot to view them
  • Part 3
  • Use randn() to add noise to the curves. Use a std
    of XX
  • Plot again

Example hrf parameters timevec from 0 to 20
secs tau 1.2 t0 4 s n 3
Example noise parameters Use a std of 0.1 0.3
- 0.5
10
(No Transcript)
11
Imagesmatrices
12
Imagescaling
Min value
Max value
Full range
Partial range
13
imagesc() colorbar
imagesc(data)
imagesc(data,0 5000)
14
Loading a dicom file
  • Matrixdicomread(filename)
  • Matrixdouble(Matrix)
  • imagesc(Matrix)

15
colormap(cmap_name)
16
hist(data(),bins)
17
Logical comparisons
  • Largevaluesmatrix gt 500
  • Can be true or false, 0 or 1

18
Roipoly will return a mask
19
Exercise
  • Load a dicom into a matrix
  • Use hist()( to identify noise and see if there is
    ghosting using imagesc()
  • Cut away the noise
  • Hint use a comparison to make a noise mask and
    then .
  • Use roipoly to mask away 1 hemisphere

20
Birgitte how do we do stats on a mask?
21
Exercise
  • Use mean() to get a mean of an ROI selected using
    roipoly
  • Plot a histogram of your ROI

22
Saving work
  • save workspacename
  • save filename X saves only X.
  • Save filenename X Y Z saves X, Y, and Z.

23
The online docs
  • Very usefull
  • Good links
  • Good newsgroup
  • Tomorrow structures the dir command
Write a Comment
User Comments (0)
About PowerShow.com