def plot_movie_with_rf(rf_on, rf_off, nm_template, frame_number):
    '''Aligns and plots natural movie frame with cell receptive field

Parameters
----------
first : receptive field on subnits
second : receptive field off subunit
third: natural movie template
forth: natural movie frame number
    '''
    m = si.BrainObservatoryMonitor()
    on_convert = m.lsn_image_to_screen(rf_on, origin='upper')
    on_convert[np.where(on_convert < 250)] = 0
    off_convert = m.lsn_image_to_screen(rf_off, origin='upper')
    off_convert[np.where(off_convert < 250)] = 0
    image = nm_template[frame_number, :, :]
    plt.figure()
    ax = plt.subplot(111)
    m = si.BrainObservatoryMonitor()
    m.show_image(m.natural_movie_image_to_screen(image, origin='upper'),
                 ax=ax,
                 show=False,
                 origin='upper')
    plot_mask_outline(off_convert, ax, color='b')
    plot_mask_outline(on_convert, ax, color='r')
    plt.show()
def plot_movie_with_pop_rf(pop_rf, nm_template, frame_number):
    '''Aligns, and plots a natural movie frame with a population receptive field overlain

Parameters
----------
first : population receptive field
second : natural movie template
third: natural movie frame number

    '''
    m = si.BrainObservatoryMonitor()
    pop_rf[pop_rf>0]=255
    rf_convert = m.lsn_image_to_screen(pop_rf, origin='upper')
    rf_convert[np.where(rf_convert<200)]=0
    image = nm_template[frame_number,:,:]
    plt.figure()
    ax = plt.subplot(111)
    m = si.BrainObservatoryMonitor()
    m.show_image(m.natural_movie_image_to_screen(image, origin='upper'),ax=ax, show=False, origin='upper')
    plot_mask_outline(rf_convert, ax, color='b')
    plt.show()