programming_tutorial_course_ lesson_1
programming_tutorial_course_ lesson_1
Dr Michael Berks
[email protected]
python? so…
What is
Matlab/python?
What is a computer
program?
What does computer
programming mean?
What is a
programming
language?
What is code?
What is a computer
program?
Something you use to achieve some task
on a computer (or phone, tablet etc)…
Word
Excel
Angry Birds
In medical imaging…
DATA
PROGRAM RESULT
Image(s)
Do something clever…
Patient data
What is a computer
program?
In medical imaging…
DATA
PROGRAM RESULT
Predict whether
the patient has
Alzheimer’s
MR images of the brain Disease
Measure volume of
grey/white matter…
What is a computer
program?
In medical imaging…
DATA
PROGRAM RESULT
Predict risk of
developing
breast cancer
Mammogram acquired
during routine screening Measure amount dense
+ patient data breast tissue…
What is a computer
program?
In medical imaging…
DATA
PROGRAM RESULT
Tell doctor/drugs
company if the
drug is working
MRI liver tumours before
and after drug treatment Measure change in size
of tumour…
What does computer
programming mean?
Writing your own computer programs...
… telling the computer to do exactly what
you want.
x
te r You’re stu d e n
nches
x
e in Ma
iv Go to a restaurant
You l
x
Get a microwave meal
You’re a fussy ea
te r!
Heating someone else’s Using a computer
food in the microwave program
Ok if they’ve cooked Ok if it does exactly what
exactly what you want you want
Vs Vs
Vs
Do I need to write all No! Just like in cooking, you don’t need
my programs from make everything from raw ingredients, can
scratch? use pre-made pasta, sauces, wine etc…
Excel Photoshop
Using other Writing
+ + people’s
code
+ your own
code
• General purpose
programming
language
• Packages provide
support for scientific
computing
• Open-source
How does python differ from Matlab?
• It’s free
– No need for an expensive license*
– Widely used, both in academia and industry
– Often installed as part of OS
• No single development environment
– This can make it a little trickier get started
– But, also more flexible
– We’ll use Spyder on this course
*Currently free because of COVID, but usually you have to pay for Matlab!
Course aims
• To show you how to use Matlab and/or python
• To introduce some basic programming ideas common
to all programming languages
• To give examples of some tasks in medical imaging
processing
• To provide code you can reuse later in your projects
• To make some pretty pictures!
I’m a bit confused…
..or Python?
For this course, consider Matlab and
python as interchangeable…
you can use either or both.
If you see this I’m referring to If you see this I’m referring to
Matlab only differences in python
First tasks
• Open Matlab (if you have it installed)
• Open Spyder (if you have it installed)
• Open a windows explorer window
– Go to the MSc folder you created for Professor’s Cootes,
maths course
– Make a new folder Programming
– Inside Programming, make new folders:
• Matlab
• Python
• Data
• TutorialSlides
First tasks
• Open an internet explorer/Google chrome window
• Go to the following webpage:
– http://personalpages.manchester.ac.uk/staff/michael.berks
– Click on the Matlab Tutorial tab
– Bookmark this page for future weeks
• Save the week 1 powerpoint slides and tutorial exercise into
the TutorialSlides folder
– These will also be added to the ‘Course content’ section of blackboard