How can I reslice a 3D matrix obtained from CT data to convert anisotropic voxels into isotropic voxels?

6 次查看(过去 30 天)
I have a 3D matrix (.mat file) obtained from a CT data. The CT data has anisotropic voxels and has dimensions of 0.415mm x 0.415mm x 0.833 mm. (i.e., Pixel size in xy plane is 0.415 mm; slice increment and slice thickness are 0.833mm). I need the final voxels to be isotropic and have the dimensions 0.415mm x 0.415mm x 0.415mm. Is there a function in Matlab which allows to reslice the matrix?
I really appreciate any help or suggestion.
Best,
Srujan

回答(1 个)

Sachin Lodhi
Sachin Lodhi 2023-12-20
Hi Srujan,
In MATLAB, the ‘imresize3’ function from the Image Processing Toolbox can be utilized to modify a 3D matrix, creating isotropic voxels by adjusting the scale of the volume across its dimensions.
With the initial voxel dimensions set at 0.415mm x 0.415mm x 0.833mm, and the target voxel size at 0.415mm x 0.415mm x 0.415mm, we need to rescale the z-dimension of the matrix by a factor derived from the ratio 0.415/0.833. This rescaling will ensure that the voxels dimensions are 0.415mm x 0.415mm x 0.415mm.
Here's an example code to achieve this:
% Load the 3D matrix from the .mat file
load('yourCTdata.mat'); % Replace 'yourCTdata.mat' with the actual filename
% Assume the variable in the .mat file is called 'ctData'
originalVoxelSize = [0.415, 0.415, 0.833]; % in mm
desiredVoxelSize = [0.415, 0.415, 0.415]; % in mm
% Calculate the resampling factor for the z-dimension
zResampleFactor = desiredVoxelSize(3) / originalVoxelSize(3);
% Resample the 3D matrix to achieve isotropic voxels
resampledCTData = imresize3(ctData, [1, 1, zResampleFactor]);
Please refer to the following MATLAB documentation page for more information on ‘imresize3’ function : https://www.mathworks.com/help/images/ref/imresize3.html#d126e185217
I hope this helps.
Best Regards,
Sachin

类别

Help CenterFile Exchange 中查找有关 3-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