小编gar*_*ari的帖子

在3D图像上进行PCA获取3个主轴

我有一个解剖体图像(B),它是索引图像i,j,k:

B(1,1,1)=0 %for example.
Run Code Online (Sandbox Code Playgroud)

该文件仅包含0和1。

我可以使用isosurface正确可视化它: isosurface(B);

我想在j中的某个坐标处削减体积(每个体积都不同)。

问题在于该体积垂直倾斜,可能具有45%的度,因此切割将不会遵循解剖体积。

我想为数据获取一个新的正交坐标系,因此我在坐标j处的平面将以更准确的方式削减解剖体。

有人告诉我要使用PCA进行此操作,但是我不知道如何执行此操作,因此阅读帮助页面也无济于事。任何方向都欢迎!

编辑:我一直在遵循建议,现在我得到了一个新的体积,以零为中心,但是我认为轴并没有按照他们的意愿跟随解剖图像。这些是前后图像: 原始图像

pca图像后,居中为零

这是我用来创建图像的代码(我从答案中得到了一些代码,并从注释中得到了一些想法):

clear all; close all; clc;
hippo3d = MRIread('lh_hippo.mgz');
vol = hippo3d.vol;

[I J K] = size(vol);


figure;
isosurface(vol);

% customize view and color-mapping of original volume
daspect([1,1,1])
axis tight vis3d; 
camlight; lighting gouraud
camproj perspective
colormap(flipud(jet(16))); caxis([0 1]); colorbar
xlabel x; ylabel y; zlabel z
box on

% create the 2D data matrix
a = 0;
for i=1:K
    for j=1:J
        for k=1:I
            a = a + 1; …
Run Code Online (Sandbox Code Playgroud)

matlab pca coordinate-transformation volume-rendering

4
推荐指数
1
解决办法
5948
查看次数