By chance, maybe you know something about the following:
When I remove information from the header of the image, for instance PatientName, that data is removed from the header, but the information (like the patients name) is not altered on the image... any ideas?
Right now I'm working around it by using imageMagick.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm not sure that I understand your question exactly, but I suspect that you're seeing the patient name in the image as well as in the header. If that's the case, then the name you see in the image is either a function of whatever DICOM viewer you are using, or it is actually part of the image. If it is part of the DICOM viewer you use then removing the header element 0x10,0x10 (PatientName) will get rid of it. However, if it is actually part of the image then editing the header will never get rid of it.
To put it in different terms: Editing a DICOM header will not erase pixels from the image. For that, you would need to use image manipulation software, such as imagemagick, which would let you change the values of the pixels in the image.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The image looks the way it did before altering the header. What I was expecting is that the image would now read "PRIVATE" for patient name instead of John Doe, or whoever the image was taken of.
Right now I am chopping off the top of the image using imagemagick ... just to be sure this is an "anonymous" image I am also still editing the header as well...
Thanks for your help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When I first began using dicom.pm I tried to access elements by typing something like the following:
"$element=$dicom->element('0008', '0020');"
However when I would attempt to run the file I would get the following compilation error:
"Can't locate object method "element" via package "DICOM" at ./dicomimage.pl line 16."
I am able to retrieve the data I need using 'fieldByName". I believe the documentation on this latest verison is out of date.
Just thought this may be worth mentioning...
Thanks.
just use
$element = $dicom->value(...);
That works,
Thanks!
By chance, maybe you know something about the following:
When I remove information from the header of the image, for instance PatientName, that data is removed from the header, but the information (like the patients name) is not altered on the image... any ideas?
Right now I'm working around it by using imageMagick.
I'm not sure that I understand your question exactly, but I suspect that you're seeing the patient name in the image as well as in the header. If that's the case, then the name you see in the image is either a function of whatever DICOM viewer you are using, or it is actually part of the image. If it is part of the DICOM viewer you use then removing the header element 0x10,0x10 (PatientName) will get rid of it. However, if it is actually part of the image then editing the header will never get rid of it.
To put it in different terms: Editing a DICOM header will not erase pixels from the image. For that, you would need to use image manipulation software, such as imagemagick, which would let you change the values of the pixels in the image.
You got my question right. It seems to me that this must actually be part of the image. The reason I think this is because when I try code like this:
$dicom->editHeader("$namefield=PRIVATE");
(where $namefield=PatientName)
The image looks the way it did before altering the header. What I was expecting is that the image would now read "PRIVATE" for patient name instead of John Doe, or whoever the image was taken of.
Right now I am chopping off the top of the image using imagemagick ... just to be sure this is an "anonymous" image I am also still editing the header as well...
Thanks for your help.