1
我有一个变量X,它是32乘32乘32.我希望imagesc
这显示人脑的图像。然而,随着代码,我跑(见下文)我得到如下图像:如何在Matlab中通过P矩阵来旋转N中的图像通过P中的矩阵
我想通过90度,使得脊髓是在该图的底部以旋转此。我已经尝试过诸如imrotate
和flipdim
等算法,但这些只是给我一个绿屏。
我的代码迄今:
clc; clear all; close all;
set(0,'defaulttextinterpreter','latex',...
'DefaultAxesFontSize',16,'defaultLineLineWidth',2) %use LaTeX
h1=figure('units','normalized','outerposition',[0 0 1 1]); %create Figure.
filename = 'testnew51.gif';
X = analyze75read('Anatomical.img');
Y=analyze75read('Mask.img');
hsurface=imagesc(squeeze(X(:,15,:)));
C=imrotate(hsurface,-90);
axis equal
colormap jet
shading interp
figure
B=flipdim(hsurface,1);
imagesc(B)
figure
imagesc(C)
非常感谢, 瑞安
在显示图形后,您是否尝试过使用'axis ij'或'axis xy'? – rayryeng
@rayryeng这似乎并没有做任何事情。我想旋转数据,而不仅仅是轴的值。 – timmr002
您是否试过对数据使用[rot90](http://fr.mathworks.com/help/matlab/ref/rot90.html?refresh=true)? – Ikaros