|SimpleITK Notebooks 1 assignment by John Galeotti, © 2018 Carnegie Mellon University, is licensed under a Creative Commons Attribution 3.0 Unported License. Permissions beyond the scope of this license may be available by sending email to itk ATgaleotti.net. (The SimpleITK Notebooks referenced are separately © by their own authors, etc..)|
Usually meets with students after class
By email or appointment
Due Date: Email your submission to the TA/Grader by 5pm on Thursday night, February 28th.
Submit everything as a single email.
(Windows users can install the free and open source PDFCreator to print to pdf. Macs can natively print to pdf files. Linux can natively print to either ps or pdf, and ps can easily be converted to pdf using ps2pdf or pstopdf from the command line.)
You should have previously downloaded a set of SimpleITK notebooks by using git as instructed in assignment 2.4. In this assignment, we will copy some of these notebooks (the "6" series for registration) to a new directory so we can modify them. We will also copy some images and helper functions. You should now open a command prompt, and begin as follows
(adjust directory names and forward/backward slashes as necessary for your computer):
cp SimpleITK-Notebooks\Data\* .\Data
cp SimpleITK-Notebooks\SharedImages\* .\hw3
cp SimpleITK-Notebooks\Python\*.jpg .\hw3
cp SimpleITK-Notebooks\Python\*.svg .\hw3
cp SimpleITK-Notebooks\Python\*.py .\hw3
cp SimpleITK-Notebooks\Utilities\*.py .\hw3
cp SimpleITK-Notebooks\Python\6*.ipynb .\hw3
Finally you can launch a web-based python interface called Jupyter. You should do so from the command line, making sure you are already in the notebooks directory (like we just did above):
After you launch the Jupyter notebook's web interface, in the Jupyter web page find and click on the notebook named 60_Registration_Introduction.ipynb.
If you are not familiar with Jupyter notebook, it is an interactive Python environment. It divides your Python code into different cells and runs each cell separately. Such structure offers great flexibility for editing code. For example, when you want to add a cell, you can first click Insert at top and choose to add above or below a selected cell. If you prefer keyboard shortcut, try press a or b and see what happens.
Execute the code blocks one at a time, making sure there aren't any errors. As you proceed, follow the instructions below for certain blocks of code. WARNING: When a code block changes from showign a number to showing an asterisk, such as "In [*]," it means the block is still executing, and you should wait before going on to the next block. When a block is finished, it will change to show the order in which the block was executed, e.g. "In ."
Block  Read Images: After running this block, the two images should be visible. Adjust the slize from the fixed image (CT) to see the optic nerve and eyeballs. Likewise, also asjust the slice from the moving image (T1 MRI) to also see the optic nerve and eyeballs. (These slice selections are purly for visualization, and do not affect the following code.)
Block  Initial Alighment: After running this block, observe the initial mismatch. Try setting image_z to slice 7. adjust the alpha (transparency) back and forth, then choose a value between 0.3-0.7.
Block  Registration: After running this block, observe how much the error increases each time a new layer of the pyramid begins. Now try inserting a new cell in the notebook after the registration error-metric graph (use the "Insert" menu), and change the cell time to "Markdown" using the toolbar (look for the drop-down box to the right of the run and stop buttons, which probably currently says "Code"). Inside the new cell, write your own explanation of (1 or more reasons) why you think the error metric increases when the registration pyramid changes to lower scale. Remember, at large scale only large objects are visible, so lower scale is higher resolution lower in the image pyramid.
Block  Post Registration Analysis: After running this block, observe the alignment (in contrast to block 5, above). Try setting image_z to slice 7 again, and then adjust the alpha (transparency) back and forth. Set alpha to 0.8 when done (so we see the image we want to grade).
When finished, "print"/save the entire completed notebook as a pdf file. Email the pdf to your grader/instructor (but don't email yet, wait for part 2 below). Please make sure that the entire notebook, including all code, is visible in the pdf (long warning messages don't matter). You may need to tell your webbrowser to print the notebook at a reduced scale, e.g. 70%, to fit everything.
Go back to the "Home" tab of your webbrowser to choose a new notebook. Open and work through all of 61_Registration_Introduction_Continued.ipynb. In block, be sure to change the moving image to be diffrent than the fixed image; I suggest the 3rd choice for the moving image.
After finishing the ITKv4-style multi-transform registration, insert a "Markdown" box after the code block "print(final_transform_v11)" but before "Version 2" in which you type your answers to the notebooks's questions (what type of transform and why different?).
After completing this notebook, "print"/save the entire notebook as a pdf file. Email the pdf to your grader/instructor in the same email as part 1.