# Rotate DICOM data 90 degrees through central axis

30 views (last 30 days)
Roman Hochuli on 28 Feb 2011
Hi, I have 300 DICOM 512x512 coronal images (through the top of the head, forming a plane parallel to the ground) which I would like to rotate such that they form 512 images in the sagittal plane (images parallel to the plane bisecting the nose and perpendicular to the ground). I have attempted reading the 300 images in using dicomread() to form a 3D array, and then writing the images using dicomwrite() along one of the faces perpendicular to the face defined by the images (see code below). However, this results in incorrectly written DICOM files and a loss of data. I'd appreciate any help you can offer. If this rotation is not possible using MATLAB, could any one suggest an alternative method? Thanks! slice=zeros(512,512); I=zeros(245,512); for i=1:512 for j=245:-1:1 slice=dicomread(['vhm' int2str(j) '.dcm']); I(246-j,:)=slice(:,j); end; dicomwrite(I,['SLICE' int2str(i) '.dcm']) end;

Sean de Wolski on 28 Feb 2011
doc permute
would be the easiest.
##### 2 CommentsShowHide 1 older comment
Sean de Wolski on 28 Feb 2011
2) Permute it so the sagittal plane using 'permute'. (ps. isn't the plane parallel to the ground the transverse plane?) http://en.wikipedia.org/wiki/Sagittal_plane
3) I don't know how to preserve the slice thickness after the permute but it will just be a permutation of the various thicknesses you already have. I think the tools you want to do this are on the File Exchange from Dirk Jan-Kroon. He has an extensive dicom manipulation toolbox that will allow you to write whole thing as a 3-d volume etc.
http://www.mathworks.com/matlabcentral/fileexchange/27941-dicom-toolbox

Jeff on 1 Mar 2011
I haven't attempted this but my initial thought is to first read all coronal slice data into a 3d matrix. Then if you want to view the data in the transverse plane simple reconstruct the image by displaying the data in each row and column. For example, read in the data as
Y - ant to post
Z - sup to inf data
X - lt to right data
The only other issue I can think of the slice thickness corrections. Perhaps you could interpolate after reading in the data so that the distance between all data points is consistent. In other words, you turn your 512x512xX, where X is the number of coronal slices into a 512x512x512 matrix.
Jeff