Kitaya lab

Obtaining information


GetBackButtonStat()

Returns 1 if "Back" button in the main window is clicked. Otherwise returns 0.

GetEndTaskNowButtonStat()

Returns 1 if "EndTask" button in the main window is clicked. Otherwise return 0.

GetRecordFps()

Returns number of frames per second (FPS) for the video recording.

GetRecordingStat()

Returns 1 if the video recording is activated. Otherwise return 0.

GetRoiSensitivity()

Returns a string containing values of sensitivities of nosepoke detecting ROIs.

GetSaveTrgStat()

Returns 1 if "SavePara" or "Start" buttons is clicked. Otherwise return 0.

GetServoAngle()

Returns a string containing values of set angles of servos.

GetTaskID()

Returns ID of the current task.

GetTaskStartedYear()

Returns the year the current task started.

GetTaskStartedMonth()

Returns the month the current task started.

GetTaskStartedDay()

Returns the day the current task started.

GetTaskStartedMinute()

Returns the minute the current task started.

GetTaskStartedSecond()

Returns the second the current task started.

IsStartTime()

Returns 1 if the current time is the set start time in the setting menu. Return 0 if it isn't.

GetArbitaryWaterSupplyStat()

Returns 1 only once after finishing of AWS. Otherwise, it returns 0.






GUI control

MainWindow

PutStartBackButton()

Places "Start", "AdjustPanel" and "Back" buttons on the left of the main window.

PutPreTaskButton()

Places "StartNow" and "Back" buttons in the left of the main window.

PutEndTaskNowButton()

Places "EndTask" button in the left of the main window.

RemoveEndTaskNowButton()

Removes "EndTask" button from the main window.

RemoveMainRightWidget()

Removes the task buttons on the right of the main window.

SetDispVariable(Order : int, Item name : string, Value : string)

Shows values of the given variables in the bottom of the main window. The following code is an example showing how it works,

Code:
SetDispVariable(0, 'Color', 'Red')
SetDispVariable(2, 'Texture', 'Rough')
SetDispVariable(1, 'Size', '1 meter')

Result:
"Color:Red Size:1 meter Texture:Rough"



DigitalOutWindow

PutDigitalOutGui(Channel# : int)

Puts a digital output GUI of the given channel on the DigitalOut window.

RemoveAllDigitalOutGui()

Removes all digital output GUIs on the DigitalOut window.



RoiWindow

PutRoiGui(ROI# : int, NosepokeDetectionMode : int, ThresholdDirection: int, DoesShowRoiSymbol : int)

Puts a GUI of the given ROI in the ROI window. The details of the arguments are as below,

ROI# :
A corresponding ROI ID#.

NosepokeDetectionMode :
This argument determines which detection method will be used. If 0, the set values on the ROI GUI are used as background light intensities.
If 1, the darkest or the brightest pixel colors in the latest 5 seconds are used as the backgrounds.

ThresholdDirection :
This argument instructs whether the bright color or the dark color should be detected.
If 1, it detects bright color. If 0, it detects dark color. Normally 1 is used to detect panel touching because mouse's nose appears to be brightly colored. If black-furred mouse is used, the ROI placed on the water access slit should be 0 because its back of the head looks dark.

DoesShowRoiSymbol :
This argument indicates whether the red square is shown or not when it detects the subject. If 1, this function is activated.

RemoveAllRoiGui()

Removes all GUIs on the ROI window.



ServoWindow

PutServoGui(Channel# : int)

Adds a servo GUI of the given channel on the servo window.
<pic>

RemoveAllServoGui()

Removes all servo GUIs on the servo window.






Device control

DigitalOut


RoofLightOn()

Turns on the ceiling illumination (Digital output channel 13 is activated).

RoofLightOff()

Turns off the ceiling illumination (Digital output channel 13 is deactivated).

InfraredLightOn()

Turns on the infrared illumination (Digital output channel 12 is activated).

InfraredLightOff()

Turns off the infrared illumination (Digital output channel 12 is deactivated).

DigitalOutOn(Channel# : int)

Turns on the given digital output channel.

DigitalOutOff(Channel# : int)

Turns off the given digital output channel.

DigitalOutBlinkOn(Channel# : int)

Starts blinking of the given digital output channel. This mode can be terminated by DigitalOutOff(Channel# : int).

LightCycleControlOn()

Turns on the automatic ceiling lights control mode. The light/dark cycle can be set at "Setting" menu. This is effective only during homecage analysis mode.

LightCycleControlOff()

Turns off the automatic ceiling lights control mode. The light/dark cycle can be set at "Setting" menu. This is effective only during homecage analysis mode.

StartLickRecording()

Start logging of the lick events to the water nozzle. The log will be exported as "* Lick.txt" and "* Lick.csv"

StartLickRecording()

Finishes logging of the licking events.



Digital Input


DigitalInOn(Channel# : int)

Sets the given channel for digital input mode.

DetectLeverPress(Channel# : int)

Returns 1 if the given channel is grounded.



Analog input


DetectLeverPressAnalog(Threshold : int)

Returns an analog channel# which lowered the given threshold.



Servo

ServoPosInside(Channel# : int)

Rotates the given servo to the angle set as "In" angle.

ServoPosMiddle(Channel# : int)

Rotates the given servo to the angle set as "Mid" angle.

ServoPosOutside(Channel# : int)

Rotates the given servo to the angle set as "Out" angle.

StartArbitaryWaterSupply(ServoCh : int, CueCh : int, IsBlink : int, millisec : int)

Stars AWS. The details of arguments are as below,

ServoCh :
Digital output channel# which is connected to water arm servo

CueCh :
Digital output channel# which is connected to water cue LED

IsBlink :
If 1, water cue LED blinkgs. If 0, it turns on.

millisec :
The duration of AWS (in milliseconds).



Panel

CreateNormalPanel(Panel# : int)

Creates a normal square-white panel (Panel# is corresponds to ROI #).

CreateNormalPanel_All()

Creates the same number of normal square-white panels as it was set in the panel adjusting.

CreateBlinkPanel(Panel# : int)

Creates a blinking square-white panel (Panel# is corresponds to ROI #).

CreateBlinkPanel_All()

Creates the same number of blinking square-white panels as it was set in the panel adjusting.

CreateTexturedPanel(Panel# : int)

Creates a panel which has the image which was uploaded in the "Setting" menu.

CreateTexturedPanel_All()

Creates the same number of textured panels as it was set in the panel adjusting.

ShowPanel(Panel# : int)

Turns on display of the given-created panel.

ShowAllPanel()

Turns on displays of all the created panels.

HidePanel(Panel# : int)

Turns off display of the given-created panel.

HideAllPanel()

Turns off displays of all the created panels.

DeletePanel(Panel# : int)

Deletes the given-created panel.

DeleteAllPanel()

Deletes all created panels.



Camera

StartRecording()

Starts video recording.

EndRecording()

Ends video recording.

SetEndRecordingTimer(FrameNum : int)

Finishes video recording after the given frames.



Others

DetectRoiNosepoke()

Returns the ROI# which detects the subject.

Timer_Start(Timer# : int)

Starts the given timer.

Timer_End(Timer# : int)

Stops the given timer.

Timer_Reset(Timer# : int)

Stops and resets the count of the given timer.

Timer_GetSec(Timer# : int)

Returns the elapsed time of the given timer in seconds.

SendMail(Subject : string, Body : string)

Sends email to the address which was set in "Setting2" menu. The title and body are entered as arguments.

SwitchTask(Task# : int)

Switches to the given task.