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.
Result = QUERY_DICOM( Filename [, Info] [, IMAGE_INDEX=index] )
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'.
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.
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 ENDIF ENDIF