This paper specifies the programming thought and method for implementing JPEG2000 compression algorithm in medical image in DICOM format. Some VC++ codes and particular comments of key functions are also presented. This paper has reference to other researchers in this field.