PROBLEM TO BE SOLVED: To automatically establish a gate window of breathing movement synchronous photographing.SOLUTION: The magnetic resonance imaging apparatus includes: a static magnetic field-generating unit which generates a uniform static magnetic field in a space in which a subject is held a gradient magnetic field-generating unit which generates a gradient magnetic field superimposing on the static magnetic field a high-frequency coil which generates a high-frequency magnetic field irradiated to the subject a unit to detect an NMR signal generated from the subject and a unit which images the signal which has been detected. The magnetic resonance imaging apparatus detects an NMR signal for the imaging when a first section of the subject which moves periodically is within the limit of a desired displacement. The magnetic resonance imaging apparatus further includes: a displacement measurement unit to set an interval and to meter a displacement of a first section of the subject which moves periodically and a unit to specify that a moving direction of a section of the subject which moves periodically has changed based on measurement of the displacement, and makes a range containing a displacement when the moving direction has changed as a range of the desired displacement.COPYRIGHT: (C)2012,JPO&INPIT【課題】 呼吸動同期撮影のゲートウィンドウを自動設定する。【解決手段】 被検体を収容する空間に均一な静磁場を発生させる静磁場発生手段と、前記静磁場へ重畳して傾斜磁場を発生させる傾斜磁場発生手段と、前記被検体へ照射する高周波磁場を発生する高周波コイルと、前記被検体から発生するNMR信号を検出する手段と、前記検出された信号を画像化する手段と、を備え、前記被検体の第1の周期的に動く部位が所望の変位の範囲内にある時に、前記画像化のためのNMR信号の検出を行う磁気共鳴イメージング装置において、前記被検体の第1の周期的に動く部位の変位を間隔をおいて計測する変位計測手段と、前記変位の計測に基づいて、前記被検体の周期的に動く部位の動く方向が変わったことを特定する手段とを備え、前記動く方向が変わった時点における変位を含む範囲を、前記所望の変位の範囲とする。【選択図】 図5