Main Content

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

getAxesHandles

直交スライス ビューアーの座標軸のハンドルの取得

R2019b 以降

説明

[hXY hYZ hXZ] = getAxesHandles(s) は、orthosliceViewer オブジェクト s 内のイメージ ボリュームの各ビューを含む座標軸を返します。

すべて折りたたむ

MRI データを読み込み、直交スライス ビューアーで表示します。

load(fullfile(toolboxdir('images'),'imdata','BrainMRILabeled','images','vol_001.mat'));
s = orthosliceViewer(vol);

スライスを含む座標軸のハンドルを取得します。

[hXYAxes, hYZAxes, hXZAxes] = getAxesHandles(s);

可視性を向上させるために十字をオフにします。

set(s,'CrosshairEnable','off');

GIF ファイルの名前を指定します。

filename = 'animatedYZSlice.gif';

所要の方向のスライス番号の配列を作成します。YZ 方向を考えます。

sliceNums = 1:240;

ループ処理を使用して、指定したスライス位置でイメージを作成します。

for idx = sliceNums
    % Update X slice number to get YZ Slice.
    s.SliceNumbers(1) = idx;
  
    % Use getframe to capture image.
    I = getframe(hYZAxes);
    [indI,cm] = rgb2ind(I.cdata,256);
  
    % Write frame to the GIF File.
    if idx == 1
        imwrite(indI,cm,filename,'gif','Loopcount',inf,'DelayTime',0.05);
    else
        imwrite(indI,cm,filename,'gif','WriteMode','append','DelayTime',0.05);
    end
end

アニメーション GIF を表示します。

入力引数

すべて折りたたむ

直交スライス ビューアー。orthosliceViewer オブジェクトとして指定します。

出力引数

すべて折りたたむ

直交スライス ビューアーの座標軸。Axes オブジェクトの 1 行 3 列のベクトルとして返されます。

バージョン履歴

R2019b で導入