The QUERY_DICOM function tests a file for compatibility with READ_DICOM and returns an optional structure containing information about images in the DICOM file. This function supports cases in which a blank DICOM tag is supplied.
This routine is written in the IDL language. Its source code can be found in the file query_dicom.pro in the lib subdirectory of the IDL distribution.
DICOM palette vectors are 16 bit quantities and may not cover the entire dynamic range of the image. To view a paletted DICOM image use the following:
IF (QUERY_DICOM('file.dcm',info)) THEN BEGIN
IF (info.has_palette) THEN BEGIN
TV, READ_IMAGE('file.dcm',r, g, b), /ORDER
TVLCT,r/256, g/256, b/256
Result = QUERY_DICOM( Filename [, Info] [, IMAGE_INDEX=index] [, /DICOMEX] )
This routine returns a long with the value of 1 (one) if the query was successful or 0 (zero) on failure. A result of 1 means it is likely that the file can be read by READ_DICOM.
A scalar string containing the full pathname of the file to query.
Returns an anonymous structure containing information about the image in the file. The Info.TYPE field will return the value ‘DICOM’.
Note: See General Query * Routine Info Structures for detailed structure information.
Set this keyword to the index (zero based) of the image being queried in the file. This keyword has no effect on files containing a single image.
By default, if the IDLffDicomEx object is available, IDL uses the IDLffDicomEx object to query the DICOM file. If this object is not available or if this keyword is set to 0, IDL uses the IDLffDICOM object to query the DICOM file.