Menu

FYI: Can't locate object method "element"

Help
2005-05-20
2013-03-11
  • dawn_susini

    dawn_susini - 2005-05-20

    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.

     
    • heiner73

      heiner73 - 2005-06-21

      just use

      $element = $dicom->value(...);

       
      • dawn_susini

        dawn_susini - 2005-06-21

        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.

         
    • Jonathan Harlap

      Jonathan Harlap - 2005-06-26

      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.

       
      • dawn_susini

        dawn_susini - 2005-06-27

        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.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.