沿二维图像切片进行插值

发布于 2024-11-25 06:37:52 字数 469 浏览 5 评论 0原文

我有一组 100 相同大小的二维图像切片。我使用 MATLAB 将它们堆叠起来以创建体积数据。虽然二维切片的大小为 480x488 像素,但图像堆叠的方向不够宽,无法在投影时以不同方向可视化体积。我需要沿着切片进行插值以增加可视化的大小。

有人可以给我一个关于如何做到这一点的想法或提示吗?

编辑:带注释的投影显微镜图像

看着一张脸

General view

图 1 是投影体积的俯视图。

图2是投影体积的侧视图。

当我更改旋转角度,并尝试以不同方向可视化体积时,例如侧视图(图 2),我看到的就是图 2 中的内容。

我想通过沿图像切片进行插值来扩展侧视图。

I have a set of 100 2-D image slices of the same size. I have used MATLAB to stack them to create a volumetric data. While the size of the 2-D slices is 480x488 pixels, the direction in which the images are stacked is not wide enough to visualize the volume in different orientation when projected. I need to interpolate along the slices to increase the size for visualization.

Can somebody please give me an idea or tip about how to do it?

Edit: Anotated projected microscopy-images

Looking at a face

General view

The figure 1 is the top-view of the projected volume.

The figure 2 is the side-view of the projected volume.

When I change the rotation-angle, and try to visualize the volume in different orientation, e.g. side-view (figure 2), is what I see as in figure 2.

I want to expand the side view by interpolating along the image slices.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

╰沐子 2024-12-02 06:37:52

以下是 MATLAB 文档 中的一个改编示例,说明如何使用等值面可视化体积数据(与您的类似):

%# load MRI dataset: 27 slices of 128x128 images
load mri
D = squeeze(D);       %# 27 2D-images

%# view slices as countours
contourslice(D,[],[],1:size(D,3))
colormap(map), view(3), axis tight

%# apply isosurface
figure
%#D = smooth3(D);
p = patch( isosurface(D,5) );
isonormals(D, p);
set(p, 'FaceColor',[1,.75,.65], 'EdgeColor','none')
daspect([1 1 .5]), view(3), axis tight, axis vis3d
camlight, lighting gouraud

%# add isocaps
patch(isocaps(D,5), 'FaceColor','interp', 'EdgeColor','none');
colormap(map)

contourslice
isosurface_isocaps

Here is an adapted example from the MATLAB documentation on how to visualize volumetric data (similar to yours) using isosurfaces:

%# load MRI dataset: 27 slices of 128x128 images
load mri
D = squeeze(D);       %# 27 2D-images

%# view slices as countours
contourslice(D,[],[],1:size(D,3))
colormap(map), view(3), axis tight

%# apply isosurface
figure
%#D = smooth3(D);
p = patch( isosurface(D,5) );
isonormals(D, p);
set(p, 'FaceColor',[1,.75,.65], 'EdgeColor','none')
daspect([1 1 .5]), view(3), axis tight, axis vis3d
camlight, lighting gouraud

%# add isocaps
patch(isocaps(D,5), 'FaceColor','interp', 'EdgeColor','none');
colormap(map)

contourslice
isosurface_isocaps

影子的影子 2024-12-02 06:37:52

MATLAB 有一个函数 interp3 可用于插值,假设数据是均匀离散的。

查看文档

希望这有帮助。

编辑:MATLAB 函数 interp3 的工作方式如下:

vi = interp3(x, y, z, v, xi, yi, zi);

我假设您的切片“堆栈”将数组 x, y, z, v 定义为 3D 数组,其中 x, y 是平面中像素的坐标,z 是每个切片的“高度”,v是实际的图像切片,可能是像素的“强度”值。

如果您想在中间 z 值处插入新的图像切片,您可以在 zi 数组中指定这些级别。数组 xi, yi 再次表示平面中像素的坐标。

MATLAB has a function interp3 that can be used for interpolation, assuming that the data is uniformly discretised.

Check out the documentation.

Hope this helps.

EDIT: The MATLAB function interp3 works as follows:

vi = interp3(x, y, z, v, xi, yi, zi);

I assume that your "stack" of slices defines the arrays x, y, z, v as 3D arrays, where x, y are the coordinates of the pixels in the plane, z is the "height" of each slice and v is the actual image slices, maybe as "intensity" values for the pixels.

If you want to interpolate new image slices at intermediate z values you could specify these levels in the zi array. The arrays xi, yi would again represent the coordinates of the pixels in the plane.

闻呓 2024-12-02 06:37:52

我创建了一个函数来沿图像切片进行插值。下面是代码:

    function res = interp_along_slices( vol, scale )
    % Interpolation along the image slices

    % Get the size of the volume
      [r c p] = size(vol);

    % Pre-allocate the array:
    % the third dimension is scale times the p
      vol_interp = zeros(r,c,scale*p);

    % interpolate along the image slices 
      for inr = 1:r;
          for jnr = 1:c;
              xi = vol(inr,jnr,:);
              vol_interp(inr,jnr,:) = interp(xi, scale); 
          end;
      end;

      res = vol_interp;

    end

I created a function to interpolate along image slices. Below is the code:

    function res = interp_along_slices( vol, scale )
    % Interpolation along the image slices

    % Get the size of the volume
      [r c p] = size(vol);

    % Pre-allocate the array:
    % the third dimension is scale times the p
      vol_interp = zeros(r,c,scale*p);

    % interpolate along the image slices 
      for inr = 1:r;
          for jnr = 1:c;
              xi = vol(inr,jnr,:);
              vol_interp(inr,jnr,:) = interp(xi, scale); 
          end;
      end;

      res = vol_interp;

    end
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文