def get_meta_idx(frames_metadata,
                 time_idx,
                 channel_idx,
                 slice_idx,
                 pos_idx):
    """
    Get row index in metadata dataframe given variable indices

    :param dataframe frames_metadata: Dataframe with column names given below
    :param int time_idx: Timepoint index
    :param int channel_idx: Channel index
    :param int slice_idx: Slize (z) index
    :param int pos_idx: Position (FOV) index
    :return: int pos_idx: Row position matching indices above
    """
    frame_idx = frames_metadata.index[
        (frames_metadata['channel_idx'] == channel_idx) &
        (frames_metadata['time_idx'] == time_idx) &
        (frames_metadata["slice_idx"] == slice_idx) &
        (frames_metadata["pos_idx"] == pos_idx)].tolist()
    return frame_idx[0]