Convert DICOM video (4D) to 3D matrix
3 次查看(过去 30 天)
显示 更早的评论
I have a DICOM ultrasound video, when I save it as a .mat file I find that it is a unit8 file with a 4D matrix. I thought the output would be a 3D matrix
When I save an individual frame and save as a .mat file I get a 2D matrix (Depth and Lateral). Which is to be expected. I am assuming the 4th dimension is an extra colour dimension that isn't needed (these are greyscale images).
What I want is to get the video and save it as a 3D matrix. Depth, Lateral and Frame number. Any help would be greatly appreciated.
0 个评论
采纳的回答
Rik
2018-2-1
If it saves your data as an RGB image, one of the dimensions will be 3. You can find the size of your matrix with the size function.
%suppose D contains your data
disp(size(D))
%suppose the result is 255 255 3 40
D=squeeze(D(:,:,1,:));
% or:
D=mean(D,3,'native');
% or even:
D=mean(D,find(size(D)==3,1),'native');
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!