SetFilename( "test.dcm" ); if( !$reader->Read() ) { return; } $file = $reader->GetFile(); $pixmap = $reader->GetPixmap(); print $pixmap; $pnm = new PNMCodec(); $pnm->SetDimensions( $pixmap->GetDimensions() ); $pnm->SetPixelFormat( $pixmap->GetPixelFormat() ); $pnm->SetPhotometricInterpretation( $pixmap->GetPhotometricInterpretation() ); $in = $pixmap->GetDataElement(); $outfilename = 'test.pnm'; if( $pnm->Write( $outfilename, $in ) ) { print "Success"; } ?>