const
  ClinicID=1;
var
  DbCfgFn,IdLstFn,FullRenumFn,RenumFn,Cmd: string;
begin
  {Get VisiQuick database configuration file}
  DbCfgFn:=GetDbCfgFnFromVqWorkDir('');
  {Dump image ID's to file}
  IdLstFn:=GenerateTempFn;
  Cmd:='FindClinicImages /db="'+DbCfgFn+'" /out='+'"'+IdLstFn+'" /clinic='+IntToStr(ClinicID)+' /grayascolor';
  ExecUtilsProc(Cmd);
  {Check and convert color images to gray}
  FullRenumFn:=GenerateTempFn;
  Cmd:='CheckConvertColorImages /db="'+DbCfgFn+'" /images="'+IdLstFn+'"';
  ExecUtilsProc(Cmd);
end.
