<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def read_header(stream, codec):
 """Decodes an image header. Wraps the openjp2 library function opj_read_header. Parameters stream: STREAM_TYPE_P The JPEG2000 stream. codec: codec_t The JPEG2000 codec to read. Returns ------- imagep : reference to ImageType instance The image structure initialized with image characteristics. Raises ------ RuntimeError If the OpenJPEG library routine opj_read_header fails. """

    ARGTYPES = [STREAM_TYPE_P, CODEC_TYPE,
                ctypes.POINTER(ctypes.POINTER(ImageType))]
    OPENJP2.opj_read_header.argtypes = ARGTYPES
    OPENJP2.opj_read_header.restype = check_error

    imagep = ctypes.POINTER(ImageType)()
    OPENJP2.opj_read_header(stream, codec, ctypes.byref(imagep))
    return imagep