pydicom / dicom-validator

Simple DICOM validator based on DocBook DICOM specs
MIT License
24 stars 11 forks source link

Support to RGB dicom #138

Open statfs opened 2 weeks ago

statfs commented 2 weeks ago

if it support the RGB dicom, which means the these tag should work later.

Module "CT Image": Tag (0028,0002) (Samples per Pixel) value is not allowed (value: 3, allowed: 1) Tag (0028,0004) (Photometric Interpretation) value is not allowed (value: RGB, allowed: MONOCHROME1, MONOCHROME2) Tag (0028,0100) (Bits Allocated) value is not allowed (value: 8, allowed: 16) Tag (0028,0101) (Bits Stored) value is not allowed (value: 8, allowed: 12, 13, 14, 15, 16)

mrbean-bremen commented 2 weeks ago

Sorry, I don't understand what you mean by RGB DICOM and what is has to do with CT images. Can you elaborate a bit?

mrbean-bremen commented 2 weeks ago

Just guessing here: maybe you mean a secondary capture created from a CT image? This must have a respective SOP class (e.g. Secondary Capture Image or Multi-frame True Color Image), which would allow RGB images.

statfs commented 2 weeks ago

sorry for my expression. the value of (0028,0004) Photometric Interpretation could be RGB.

Pixel data represent a color image described by red, green, and blue image planes. The minimum sample value for each color plane represents minimum intensity of the color. This value may be used only when Samples per Pixel (0028,0002) has a value of 3. Planar Configuration (0028,0006) may be 0 or 1. May be used for pixel data in a Native (uncompressed) or Encapsulated (compressed) format; see Section 8.2 in PS3.5 .

FYI: https://dicom.innolitics.com/ciods/ct-image/image-pixel/00280004

mrbean-bremen commented 2 weeks ago

You are looking at the general definition of Photometric Interpretation, you need the specific definition for CT images (C.8.2.1.1.3). See https://dicom.nema.org/medical/Dicom/2024b/output/chtml/part03/sect_C.8.2.html.

Only MONOCHROME1 and MONOCHROME2 are allowed in CT images. Note that the DICOM validator takes these values directly from the downloaded DICOM standard, there is nothing hardcoded here.

statfs commented 2 weeks ago

Thank you very much. but if the DICOM validator could validate other modality / other type just like some images which have the "Photometric Interpretation" = RGB?

mrbean-bremen commented 2 weeks ago

Sure it can. It looks up the SOP Class UID and checks in the DICOM standard which modules should or may be present, then checks the tags for each module (also from the standard) and prints errors for missing tags, tags with the wrong content (in the case of enumerated values), or tags that shouldn't be there. It supports all SOP classes defined in PS 3.3 (though there may be some bugs due to parse errors, mostly related to verbal condition descriptions in the standard).

mrbean-bremen commented 2 weeks ago

I'm still not sure if you are trying to report a bug (in this case it would help to describe it), or just want to understand what the validator does. Your output in the description certainly shows invalid DICOM - as mentioned, I guess that it has the wrong SOP class..