Abstract:DICOM3.0 standard is complex and rich in contents. Aiming at the difficulty of software design, a programming method of generating DICOM image file in the high frequency X ray machine is proposed. The data structure of DICOM file is analyzed, and then the programming method of generating DICOM image files is introduced in detail. For the proposed method, a template array of the data structure is constructed to save the eigenvalues, transfer syntax, pixel data and so on of the image. All kinds of the data are stored in the DICOM file successively. The programming method can not only transform a BMP file into a DICOM file, but also transform a JPEG file into a DICOM file. It strictly follows DICOM 3.0 protocol. The generated DICOM files can be displayed with the DICOM file browsing software ezDICOM. The programming design was based on VC++6.0.