Image basics

Overall goal

To get familiar with the libraries that mialab depends on, so you know what the data types and functions/methods that you'll use for the next several weeks look like.

Libraries here = numpy, SimpleITK. Later on, you will also be friends with matplotlib, pillow and scikit-learn. Optionally, if you're very social and like even more friends, you could try nibabel, scikit-image and our homegrown kid, pymia.

Getting started

GitHub Classroom is no longer used. Start by opening the image basics starter repository, selecting Fork, and creating the fork under your own GitHub account.

Clone your fork and edit image_basics.py, or edit the file directly in the browser.

Work in /<your-GitHub-username>/01-image-basics, not in the ubern-mialab starter repository. If GitHub asks you to enable workflows in your fork, open the Actions tab and enable them.

If you think you've made the right changes to the file, feel free to then commit the change, using the green "commit changes…" button if you are using the browser, and don't forget to include a helpful message about what the change really is.

Then, wait for the cogwheels to run: GitHub runs its 'actions' behind the scenes, and you'll either see a red ❌ or a green ✅ next to the commit message you entered previously.

The goal really is to get the green ✅ every time you make a change, which will only happen when all the functions are completed correctly (correctly as defined by the tests in test_image_basics.py, please don't cheat ;-)). Clicking on the check mark will show more details about completion of the homework.

Once you're done, please share both the link to your fork and the URL or SHA of your final commit with us, so we can confirm you've completed the assignment for the bonus grade (if such a need arises).

Tasks and specifics

The functions to complete, all in image_basics.py:

Help?

If neither of these two help, reach out to the instructors on Slack. Responses are not guaranteed to be time bound, we will do our best.