def load_raw_data_with_mhd(filename):
meta_dict = _read_meta_header(filename)<EOL>dim       = int(meta_dict['<STR_LIT>'])<EOL>assert (meta_dict['<STR_LIT>'] in MHD_TO_NUMPY_TYPE)<EOL>arr = [int(i) for i in meta_dict['<STR_LIT>'].split()]<EOL>volume = reduce(lambda x, y: x*y, arr[<NUM_LIT:0>:dim-<NUM_LIT:1>], <NUM_LIT:1>)<EOL>pwd       = op.dirname(filename)<EOL>raw_file  = meta_dict['<STR_LIT>']<EOL>data_file = op.join(pwd, raw_file)<EOL>ndtype    = MHD_TO_NUMPY_TYPE[meta_dict['<STR_LIT>']]<EOL>arrtype   = NDARRAY_TO_ARRAY_TYPE[ndtype]<EOL>with open(data_file, '<STR_LIT:rb>') as fid:<EOL><INDENT>binvalues = array.array(arrtype)<EOL>binvalues.fromfile(fid, volume*arr[dim-<NUM_LIT:1>])<EOL><DEDENT>data = np.array  (binvalues, ndtype)<EOL>data = np.reshape(data, (arr[dim-<NUM_LIT:1>], volume))<EOL>if dim >= <NUM_LIT:3>:<EOL><INDENT>dimensions = [int(i) for i in meta_dict['<STR_LIT>'].split()]<EOL>data       = data.reshape(dimensions)<EOL><DEDENT>return data, meta_dict<EOL>
Return a dictionary of meta data from meta header file.

    Parameters
    ----------
    filename: str
        Path to a .mhd file

    Returns
    -------
    data: numpy.ndarray
        n-dimensional image data array.

    meta_dict: dict
        A dictionary with the .mhd header content.