A Matlab script to set origin to the center of the image using SPM

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

  1. setorigin_center.m (Right click and save as…) and save in SPM directory or any directories under MATLAB path.
  2. Type the following in Matlab command window.
  3. >>setorigin_center
  4. This will pop up the file selector, so choose the images you want to set the origin to the 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.

setorigin_screenshot

コメントを残す

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください