Sometimes we need to handle images whose origin is far from the center of the image.
My friend, Fumio Yamashita, from Iwate Medical University wrote a script which set the origin to the center of the image.
Usage is very simple.
-
Download
- setorigin_center.m (Right click and save as…) and save in SPM directory or any directories under MATLAB path.
- Type the following in Matlab command window.
- This will pop up the file selector, so choose the images you want to set the origin to the center.
>>setorigin_center
That’s it.
Below is the example of the script.
Left is before applying the script. You can see that the origin is far from the center.
Right is after applying the script. Now origin is set to the center.