フィルターのクリア

Describe angulated slices using imref3d

2 ビュー (過去 30 日間)
Wouter
Wouter 2013 年 3 月 20 日
Just found out about the functions imref2d and imref3d and I am a bit puzzled on how to implement angulated slices.
slicedata = rand(10,10,1);
% set coordinates
xbounds = [-100 100]; % x and y run from -100 cm
ybounds = [-100 100]; % to 100 cm
zbounds = [-10 2]; % zslice is angulated; 'left' side is
% lower then 'right' side.
To create an imref3d object I would then expect to use:
imref3d([size(slicedata) 1],xbounds,ybounds,zbounds)
However when I look at the imref3d object contents, it says:
imref3d with properties:
XWorldLimits: [-100 100]
YWorldLimits: [-100 100]
ZWorldLimits: [-10 2]
ImageSize: [10 10 1]
PixelExtentInWorldX: 20
PixelExtentInWorldY: 20
PixelExtentInWorldZ: 12
ImageExtentInWorldX: 200
ImageExtentInWorldY: 200
ImageExtentInWorldZ: 12
XIntrinsicLimits: [0.5000 10.5000]
YIntrinsicLimits: [0.5000 10.5000]
ZIntrinsicLimits: [0.5000 1.5000]
Here PixelExtenInWorldX and PixelExtenInWorldY are correct; however it interprets the PixelExtenInWorldZ wrongly. Is this a bug or am I just misusing the imref3D object? If so; does anyone has suggestions for improvements?

採用された回答

Alex Taylor
Alex Taylor 2013 年 3 月 20 日
Hi Wouter,
The functions imref2d and imref3d are currently limited to rectilinear referencing. In your case, it sounds like there is an affine relationship between the third dimension of your data and the Z dimension in which the left extent of your volume is lower in the world Z coordinate system than the right extent of your volume.
Can you provide a little more information about what you know regarding the world location of your image data and an example of how you would want to construct a 3-D spatial referencing object to reference your data?
Thanks,
Alex Taylor Image and Geospatial Group MathWorks
  1 件のコメント
Wouter
Wouter 2013 年 3 月 20 日
編集済み: Wouter 2013 年 3 月 20 日
Thank you for the response; really appreciate it.
I have a single image slice (from a dicom dataset) of which I know the x,y and z location in world coordinates (in mm).
This single plane (3 dimensional matrix with size(matrix,3) == 1) is angulated (around all axes) with respect to the world coordinate system
In stead of saving the world coordinate for each voxel (as I do now) I was looking to refer to the xyz-world-coordinates using imref3d class.
With respect to the world coordinate system, my data is only rotated (around x,y and z axis), scaled (voxelsizes ~= [1 1 1]) and translated (voxel 1 is not at position [.5,.5,.5]). The data is not sheared or mirrored.
The coordinates of my data are originating from the dicom file format (medical image files). They are created by multiplying a transformation matrix with the voxel indices-coordinates (matlab calls them intrinsic coordinates?)
TM = [ 0;...
R 0;...
0;...
-100 -100 -10 1]
Where R is actually a combination of a rotation and the voxel scaling.
[x y z] = meshgrid(1:10,1:10,1);
coordinates = [x(:) y(:) z(:) ones(size(z(:)))]*TM;
x = reshape(coordinates(:,1),size(x))
y = reshape(coordinates(:,2),size(y))
z = reshape(coordinates(:,3),size(z))
It is quite memory consuming to save all the coordinates; hence I was interested in replacing it by imref3d.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange3-D Volumetric Image Processing についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by