Side screen demo


This demo script shows how the side screen can be used. The dimensions of the side screen are slightly different to the bottom screen, so images that are used with the side screen need to be adapted.

Top

Creating images for the side screen

The side screen has different dimensions to the bottom screen, and images that are on the side screen will appear elongated (as the pixels are not square, but instead 1 x 0.7). Consequently you need to resize any images / bitmaps that you use so that the horizontal dimension is 0.7 of the original bitmap. For example if you create a circle and want to use this on the side screen, and the height is 10 the width will be 7, or, as in the image below. Don’t forget to save this resized bitmap in the unit’s Asset directory.

Screenshot showing how to create a circle for the side screen
For the scripts below we created a circle for the side screen (as shown above) and a square in the same way. Note that the circle appears elongated vertically after it is resized to accommodate for the rectangular pixels
Top

Script explanation

There are two scripts below, demonstrating how two different kinds of insert can be used with the side screen and its tank.


The first script below, side_screen_2choice_zfish.zs, will display two images simultaneously, one in each of the chambers created by the 2-choice insert. This script could be adapted so that the two areas are detector zones and 'nose pokes' could automate subsequent stimuli (such as solid food delivery).

First part

INCLUDE ZSYS
DEFINE SPRITE 5
DEFINE SPRITE_IMAGE 520
DEFINE NUM_BIN 10
DEFINE WAIT_TIME 2
SETLIGHT(LIGHT1,SPRITE,475,500,698)
SETLIGHT(LIGHT2,SPRITE,1125,500,698)
LOAD(SPRITE_IMAGE,"1:circle_ss")
LOAD(SPRITE_IMAGE,"2:square_ss")
  • Include zsys - this must be included in all scripts
  • The first two DEFINE commands for sprites must be written when your script includes the use of images on the screen .
  • The following two commands DEFINE values used in the script, in this case number of trials and amount of time in seconds.
  • The following two SETLIGHT commands specify where the images should be placed on the screen (i.e. the centre of the image, LIGHT1, should be at coordinates 475,500 ) and their size (i.e. 698 pixels).
  • The two LOAD commands detail which images (.bmp files which must be saved in the unit's Assets directory) to use for LIGHT1 (circle_ss.bmp) and LIGHT2 (square_ss.bmp).

Action main

ACTION MAIN
 LIGHTS(ALL,OFF)
 INVOKE(SCREEN,NUM_BIN)
 LIGHTS(ALL,OFF)
COMPLETE

The next set of ACTION MAIN commands (above) details the order of the whole experiment. In this case:

  • At the beginning and end all the lights are turned off.
  • The Action SCREEN is run the number of times as DEFINED by NUM_BIN in the first set of commands in the script (i.e. 10).

Action screen

ACTION SCREEN
 LIGHTS(LIGHT16,ON)
 
 LIGHTS(LIGHT1,WHITE)
 LIGHTS(LIGHT2,WHITE)
 WAIT(WAIT_TIME)
 LIGHTS(LIGHT1,RED)
 LIGHTS(LIGHT2,WHITE)
 WAIT(WAIT_TIME)
 LIGHTS(LIGHT1,RED)
 LIGHTS(LIGHT2,BLUE)
 WAIT(WAIT_TIME)
 LIGHTS(LIGHT1,GREEN)
 LIGHTS(LIGHT2,GREEN)
 WAIT(WAIT_TIME)
 LIGHTS(ALL,OFF)
 WAIT(WAIT_TIME)
COMPLETE

The SCREEN section above details the actions for this period:

  • The overhead lights (LIGHT16) are turned on. The default colour for these lights is white.
  • The two images display in the locations specified in the SETLIGHT commands detailed above, both in the colour white as specified in these commands.
  • After a period of time (as DEFINED by WAIT_TIME) the two images will display again in their locations in different colours (i.e. the circle will be red and the square will be white).
  • The images display for a period two more times, in different colours (i.e. the circle will be red, the square blue and then both images will display in green).
  • All the lights will turn off before this section is finished (COMPLETE).

The second script below, side_screen_2choice_feeder_zfish.zs, is a demo script for the feeder and 2-choice insert which is used when this insert is slotted into the front of the tank, so is placed underneath the feeder. The side screen will be placed at the front of the tank for this experiment. In the script there is an image (LIGHT3) displayed where food is delivered by the feeder.

First part

INCLUDE ZSYS
DEFINE SPRITE 5
DEFINE SPRITE_IMAGE 520
DEFINE NUM_BIN 10
DEFINE WAIT_TIME 2
SETLIGHT(LIGHT1,SPRITE,372,500,465)
SETLIGHT(LIGHT2,SPRITE,1228,500,465)
SETLIGHT(LIGHT3,SPRITE,800,233,465)
LOAD(SPRITE_IMAGE,"1:circle_ss")
LOAD(SPRITE_IMAGE,"2:square_ss")
LOAD(SPRITE_IMAGE,"3:circle_ss")
  • Include zsys - this must be included in all scripts.
  • The first two DEFINE commands for sprites must be written when your script includes the use of images on the screen.
  • The next two DEFINE commands define values, in this case number of tirals and amount of time in seconds.
  • The three SETLIGHT commands detail the position and size of each of the sprite images loaded (i.e. LIGHT1 will have its centre located in the position 372,500 and will be 465 pixels in size).
  • The three LOAD commands tell the unit which bitmap image should be used for which lights, i.e. both LIGHT1 and LIGHT3 will both be the asset "circle_ss.bmp".

Action Main

ACTION MAIN
 INVOKE(SCREEN,NUM_BIN)
COMPLETE

The next set of ACTION MAIN commands (above) details the order of the whole experiment. In this case:

  • The Action SCREEN is run the number of times as DEFINED in the first set of commands in the script (i.e. 10).

Action Screen

ACTION SCREEN
 LIGHTS(LIGHT1,WHITE)
 LIGHTS(LIGHT2,WHITE)
 LIGHTS(LIGHT3,WHITE)
 WAIT(WAIT_TIME)
 LIGHTS(LIGHT1,RED)
 LIGHTS(LIGHT2,WHITE)
 LIGHTS(LIGHT3,WHITE)
 WAIT(WAIT_TIME)
 LIGHTS(LIGHT1,RED)
 LIGHTS(LIGHT2,BLUE)
 LIGHTS(LIGHT3,MAGENTA)
 WAIT(WAIT_TIME)
 LIGHTS(LIGHT1,GREEN)
 LIGHTS(LIGHT2,GREEN)
 LIGHTS(LIGHT3,YELLOW)
 WAIT(WAIT_TIME)
 LIGHTS(ALL,OFF) 
 WAIT(WAIT_TIME)
COMPLETE

The SCREEN section above details the actions for this period:

  • The three images display in the locations specified in the SETLIGHT commands detailed above, all three in the colour white as specified in these commands.
  • After a period of time (as DEFINED by WAIT_TIME) the three images will display again in their locations in different colours (i.e. the circles will be red and white, the square will be white).
  • The three images display for a period of time, two more times, in different colours.
  • All the lights will turn off before this section is finished (COMPLETE).
Top

Script download

Here you can download the two side screen demo scripts as a .zs file. Right click on one of the download links below and download / save the file as a zanscript file, i.e. in the same format: side_screen_back_demo.zs. You then need to upload this zanscript file into the Zanscript directory on your unit.

You also need to download the bitmap files that are used in the script (circle_ss.bmp and square_ss.bmp), and save these into the Assets directory on your unit. Make sure that the assets named in your script exactly match the names of the assets / bitmaps loaded into your Asset directory (including upper and lower case used).

Script downloads:

side_screen_2choice_zfish.zs

side_screen_2choice_feeder_zfish.zs

Asset downloads:

circle_ss.bmp

square_ss.bmp

Top

Run the demo service

The images below (1,2) illustrate what the side screen looks like through the tank.

2 images displayed on side screen with 2-choice insert
(1) Two images displayed on the side screen, viewed behind the 2-choice insert for zebrafish, each placed behind a nose poke zone.
2 Choice Feeder Side Screen Insert
(2) Three images displayed on the side screen, viewed behind the 2-choice feeder insert for zebrafish. The second image appears where the food is delivered, the first and third images are placed in front of nose poke zones.

Please note when running a service that uses the side screen:

  • The 'live video’ screen amalgamates the image as shown on the side screen with the overhead video tracking of the tank.
  • If you would like the ‘live video’ screen not to include the images presented on the side screen, whilst on this webpage click on ‘Show advanced controls’ and then click on ‘Lighting’. To turn the images back on you just click on ‘Lighting’ again.
  • The side screen image will not show on any picture that is taken in the unit during the service, however the side screen images will show on any video footage that is taken.
  • The image (3) below is a still taken from a video made whilst running this service and enables you to see the straight-down view of the tank (which includes the food hopper insert on the left and the 2-choice insert on the right), as well as the images as displayed on the side screen.
  • The video and 'live video' screen show some slight black marks around the circle, however these marks are not evident on images presented on the side screen.
Video Still From Side Screen Back Demo
(3) This video still, taken when running the script, side_screen_2choice_zfish.zs, shows how the side screen images are overlaid on the camera view of the tank. Please note that the black markings around some of the circle edge do not appear when the image is presented on the side screen.