gdcm2pnm: command not found

Have You tried accessing the binary with the full path?

Maybe Your $PATH variable doesn't contain the default paths? echo $PATH should give something like:

[root@server ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

If it's empty, You may set the PATH variable with this command

export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"

On Debian possible default full paths are:

/usr/bin/gdcm2pnm - from package: libvtkgdcm-tools

You may install the required package with command apt-get install {package}
Error in other languages:
gdcm2pnm: bevel nie gevind nie
gdcm2pnm: comandă negăsită
gdcm2pnm: comando não encontrado
gdcm2pnm: commande introuvable
gdcm2pnm: command not found
gdcm2pnm: käsku ei ole
gdcm2pnm: không tìm thấy lệnh
gdcm2pnm: komanda nerasta
gdcm2pnm: Kommando nicht gefunden.
gdcm2pnm: kommandot finns inte
gdcm2pnm: komut yok
gdcm2pnm: nie znaleziono polecenia
gdcm2pnm: níor aimsíodh an t-ordú
gdcm2pnm: no se encontró la orden
gdcm2pnm: no s'ha trobat l'ordre
gdcm2pnm: opdracht niet gevonden
gdcm2pnm: parancs nem található
gdcm2pnm: perintah tidak ditemukan
gdcm2pnm: príkaz nenájdený
gdcm2pnm: příkaz nenalezen
gdcm2pnm: команда не найдена
gdcm2pnm: командата не е открита
gdcm2pnm: 命令找不到
gdcm2pnm: コマンドが見つかりません