[vtkusers] vtkDICOMImage reader pixel content not identical with that in MATLAB

AIs royalmatador at gmail.com
Tue Jan 14 20:09:26 EST 2014


Hi VTK Users,
I am trying to export an image read with vtkDICOMimage reader in to a
c-array where I can modify the pixels for some image processing operation.
Thanks to an example about vtkImageExport I was able to do this. But I have
observed something strange which I think could be due to my lack of
understanding about the DICOM reader.
The thing is I tried to export a DICOM image slice of 511 x 511 an also a
volume 511x511x3.
Since the pixel content is stored as a single pointer c-array . I tried to
rearrange this array to obtain a 2D pointer matrix using the formula [ j *
dimension [0 ] + i ] and  [ ( k * dimension [ 1 ] + j ) * dimension [ 0 ] +
i ] for 2D slice and a  stack of 2D slices, where my outer loop begins with
k representing slices and inner most loop i representing columns and
dimension [ 2 ], [ 1 ], [ 0 ] represent dimesions for k, j  and i
respectively.
I tested this with my png image slices seems to work perfectly fine.
I also checked with the DICOM image slices which seem to work. 
But when I read the same DICOM files with MATLAB, I see differences in the
pixel values, which I cannot seem to explain. 
I also checked the possibility that my image be read as short, double and
unsigned char but still observed this.
I know that vtkDICOMimage reader is not good enough for all Dicom image
types but I cannot figure out why such a difference occurs and will it help
if I convert my DICOM files to raw format. If I do convert the DICOM images
to raw format will then the pixel values of the images read by both vtk and
MATLAB be identical?
Also note that I read the same DICOM image with vtkImageReader and
vtkVolume16 reader but I cannot explain this behaviour.
If you someone could please guide me on this, as I am very curious about
this behaviour of the image.
Also note I changed the DICOM image with another DICOM image 'knee1.dcm'
which is freely available in MATLAB image processing toolbox.
Thanking you in advance.
Kind regards.
AIs



--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkDICOMImage-reader-pixel-content-not-identical-with-that-in-MATLAB-tp5725388.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list