Thanks, John.
Actually, isn't it H{1}.SliceThickness the parameter missing?
According to your info, then [H{1}.PixelSpacing H{1}.SliceThickness] = [4 4 4].
Does this mean that my voxel size is 4 mm in each direction?
Best,
P
----
How far have you got? The pairs of numbers are the actual codes in the DICOM headers, for which there is a lookup table to generate some more interpretable names for things. When SPM converts DICOM to NIfTI, it uses (0028,0030), which corresponds to PixelSpacing. You can see the lookup table in spm_dicom_dict.txt (which was mostly copy/pasted from a pdf document and then modified by hand).
So, you can find pixel sizes within slices by:
P=spm_select(1);
H=spm_dicom_headers(P);
H{1}.PixelSpacing
Finding the 3rd of the dimensions is a bit more challenging though. Each slice has a (0020,0032) ImagePositionPatient tag, which encodes the position of the first pixel. If the slices are sorted, then the difference in positions between adjacent slices can be used. If there's only a single slice, sometimes a (0018,0050) SliceThickness is present that can be used. Otherwise, I have to assume the thickness is 1mm.
See lines 564 - 587 (or roughly that region) of spm_dicom_convert.m.
Best regards,
-John
From: SPM (Statistical Parametric Mapping) <[log in to unmask]> on behalf of Paivi Eerola <[log in to unmask]>
Sent: 02 April 2020 14:07
To: [log in to unmask] <[log in to unmask]>
Subject: Re: [SPM] Vozel size in DICOM where?
Thanks for much for your response. However, I don't understand where to find (0018,1164) for instance. I could not find that tag anywhere in my DICOMs.
|