QMedical Command Reference Images

QMed_TestImage

QMed_TestImage(imagePath; imageType):error
imagePath Text Full path to image file
imageType String4 Image type
error Longint Error result

Tests if a file contains image data.

If imagePath is a file that contains valid image data, imageType is set to a graphic file format identifier (a non empty string) and returns qmed_noErr. If the file is not an image file, the imageType is set to an empty string and the qmed_paramErr error is returned. To get a list of all supported formats, call the QMed_GetImportTypes command.

If imagePath parameter is invalid, a file system error is returned. If imagePath is empty, QMedical presents a file selection dialog where the user can preview and select an image file. If the user selects a file, its full pathname is returned in imagePath, otherwise error qmed_userCancelErr is returned.



Example

  `Test a DICOM image

C_LONGINT($error)
C_TEXT($imagePath)
C_STRING(4;$imageType)

$imagePath:="Hard disk:images:CR-MONO1-10-chest.dcm"
$imageType:=""

$error:=QMed_TestImage ($imagePath;$imageType)

If ($error=qmed_noErr)
 
 Case of 
  : (($imageType="DICM") | ($imageType="DCM "))
  
    `Handle DICOM file
  
 End case 
 
End if 



Related commands

QMed_GetImportTypes Returns the list of available import types

QMedical © Escape Information Services
Generated by QDoc 2.7 on Wed, Mar 24, 2004 17:00:33