Search code examples
imagepixeldicom

Read the width and length of the pixel in .dcm format with dicominfo


I have pictures in .dcm format. I'm looking for the width and length of the pixel. As far as I know that Dicominfo gives the information of the picture. Do you know what parameters are used to obtain the width and length of the pixel in the Dicominfo? I had an idea that I first need the FOVx "Field Of View" and then I can divide by the number of pixels. This is how I get the width and length of the pixel.

I am very grateful for every answer.


Solution

  • Not sure what you exactly mean by "length". Furthermore, geometrical information (pixel size in mm) may vary regarding the tag numbers, depending on the type of object. The attribute tags I am providing here should work for the majority of DICOM images that have geometrical information at all.

    • image size in pixels (x,y) -> Columns (0028,0011), Rows (0028,0010)
    • size of the pixels (y,x) -> Pixel Spacing (0028,0030)

    Pixel Spacing is a multi-valued attribute from which you can obtain two values which are separated by a Backslash "\". Not sure how the API of DicomInfo allows access to multiple values in the same attribute.

    Note the difference "(y,x)" in Pixel Spacing. This is very unintuitive, but it is like it is.