在2d空间中翻译等值线图

时间:2015-02-18 16:08:02

标签: image matlab image-processing

我处理存储在3D矩阵D中的数据。为了形象化,我绘制了一个切片:

figure
contourslice(D,[],[],[15],10);
view(3);
axis tight

我知道存储在矩阵中的数据是一段周期性数据。在这里,我需要一个技巧:拥有那个切片,如何在2D空间中将其转换为几个周期以查看数据的周期性结构?

假设我有一个形状[A],但我需要:

[A][A][A]
[A][A][A]
[A][A][A]

是否可以在绘图阶段进行,而不是触及实际数据?

2 个答案:

答案 0 :(得分:1)

假设您拥有图像处理工具箱,以这种方式可视化数据的一种简单方法是使用repmatmontage函数。

假设您对T:第15页的平铺感兴趣

montage(repmat(D(:,:,15),[1 1 1 9]));

或者,你可以做到

imagesc(repmat(D(:,:,15),[3 3]));

答案 1 :(得分:0)

这是另一种与使用轴对象复制的图形处理相关的方法

T=48 % that is a period
[x,y,z] = meshgrid(1:T,1:T,1:T);

% create nine figures with shifted axes
for j1=1:3
    for j2=1:3
        figure;
        contourslice(x+(j1-1)*T,y+(j2-1)*T,z,D,[],[],[15],10);
        a(j1+(j2-1)*3)=copyobj(gca,gcf);
    end;
end;


% combine content of each figure into a single one
figure('name','COMBINED');
axes;
set(gca);

for j=1:length(a)
    copyobj(get(a(j),'children'),gca);    
end;

% close others
close([1:9])