Dcmodify functionality bizarrely wrong?

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
faisal_tum
Posts: 33
Joined: Fri, 2013-01-11, 15:37

Dcmodify functionality bizarrely wrong?

#1 Post by faisal_tum »

Why do dcmodify modifies the image so wrongly(At least seems bizarrely wrong to me.)?

I made whole procedure in Matlab(2012a) where I used dcmodify to modify the pixels of an image.

The matlab code is as below:

Code: Select all

clc
clear all
close all
a=imread('Sunset.jpg');
dicomwrite(a,'Sunset.dcm');
figure
imshow(a);
a(20:46,:,1)=0;
a(20:46,:,2)=0;
a(20:46,:,3)=0;
dicomwrite(a,'Sunset1.dcm');
b=dicomread('Sunset1.dcm');
figure
imshow(b)
dos('dcmodify -mf PixelData=Sunset1.dcm Sunset.dcm');
c=dicomread('Sunset.dcm');
figure
imshow(c)
The first dicom image which I make in matlab, called as "Sunset.dcm" is as below:
Image

After the change in pixel I produce a new image, called "Sunset1.dcm" which looks like as below:
Image

But when I modify the pixels of the 1st produced dicom image, "Sunset.dcm"(Shown in the first link), by taking the pixel data from the other dicom file or image, "Sunset1.set"(shown in the second link), the resulting image is absurdly like below:
Image

Why does dcmodify change in such a bizarrely wrong way? Am I misunderstanding the functionality of dcmodify? Please explain.

Thanks.

J. Riesmeier
DCMTK Developer
Posts: 2501
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Dcmodify functionality bizarrely wrong?

#2 Post by J. Riesmeier »

dcmodify is a dumb tool, so I guess that the error is in your bitmap (or the DICOM header it not consistent with your bitmap).

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest