BakingTray
Search…
Settings Files
BakingTray uses configuration files located in the SETTINGS directory.

System Settings

The so-called "system settings" are those that describe parameters of the rig that are unlikely to change between sessions. This includes things like how fast the stages are supposed to move, the settling time of the PIFOC, and general features of the cutting cycle. BakingTray.settings.readSystemSettings parses systemSettings.yml and creates it if does not already exist. You will be prompted to edit the file. The settings of course can be changed at a later time. Here is what each parameter means:
  • SYSTEM.ID - A string defining the unique name of your microscope. This will allow you to distinguish between different microscopes should you have multiple systems.
  • SYSTEM.xySpeed - The target maximum speed of your X/Y stage in mm/s. With the fast PI stages a value of 100 mm/s or even a little more is not unreasonable.
  • SYSTEM.homeZjackOnZeroMove - If 1 the Z stage is zeroed each time the user asks for it to go to the lowest position (0 mm). 0 otherwise.
  • SYSTEM.dominantTilingDirection - The stage axis which will conduct the bulk of the motions in the S-shaped tile scan. It makes sense to set this as being the top stage in your stack, as this will be carrying the smallest load. This should be the string y or x.
  • SYSTEM.autoROIchannelOrder - By default this is the list {'red','green','blue'}. It is suggested to leave like this. The red channel is best for the auto-ROI algorithm, as the agar fluoresces least in this channel.
  • SYSTEM.bladeXposAtSlideEnd - Scalar corresponding to the the X stage position associated with when the blade just reaches the edge of the slide.
  • SYSTEM.slideFrontLeft - A vector of length 2 defining the X/Y position at which the objective is directly over the front/left corner of the slide.
  • SYSTEM.defaultSavePath - The default path to bring up for saving data. If missing or not valid we use the current directory instead. Likely you are saving data to a separate RAID array or SSD. In this case set it to the drive letter: D:\ or whatever. Doing this reduces user errors and questions regarding to where data should be saved.
  • SYSTEM.cutterSide - set to 1 if the vibrotome is on the right as you look at the system. Set to -1 if the vibrotome is on the left.
  • SLICER.approachSpeed - The speed in mm/s with which the sample is brought to the cutting start point. You can leave this at around 25 mm/s. It's not critical.
  • SLICER.vibrateRate - Vibrate rate of the blade in cycles per second. This will vary by vibrotome. If you are using a vibrotome where this setting is applied in hardware, you can set this to anything you like.
  • SLICER.postCutDelay - Number of seconds to wait for the cut slice to settle to the bottom of the bath. About 5 seconds is reasonable.
  • SLICER.postCutVibrate - The vibrate rate to use during the post-cut delay period. We find that hugely reducing the blade speed (e.g. to 3 Hz) allows the slice to slide off the blade.
  • SLICER.defaultYcutPos - Scalar defining the Y position at which we cut. This depends on the water bath and vibratome position and is not sample-dependent.
Slack messages
The SLACK settings in the systemSettings.yml file are there to provide a Slack hook which is used by BakingTray to send progress messages to a Slack channel. This section is optional and is filled out as follows:
1
SLACK:
2
user: '@MicroscopeName'
3
hook: 'https://hooks.slack.com/services/T7S8UFJKL/CVG8T59LP/lKW6o9bw88jrEnJ87T27Ie2m1'
Copied!
The user setting is simply the microscope name and is appended to the message. The hook is a string the corresponds to a web hook you create for a Slack channel. Once you have completed the above, restart BakingTray and test your Slack integration:
1
>> hBT.slack('This is a test message')
Copied!
There is no feedback to the command line but you should see the Slack message appear on the target channel.

Component Settings

The componentSettings.m file defines how the hardware components of the rig are to be set up. It is read by BakingTray.settings.readComponentSettings and created if it does not exist. Instructions for filling in this file are present in the comments of that file. It's vital this file is filled in correctly to avoid damage to your system, particularly for the motion components. For instance, the motion limits of the stages are defined in this file and are used to make it impossible for out of bounds motions to be executed.
You should first run your stages using the manufacturer's software to familiarise yourself with them. When filling in the component settings file, keep the following in mind:
  • The X stage moves left/right as you look at the rig and positive is to the right. Middle of the travel range is 0.
  • The Y stage moves front/back as you look at the rig and positive is away from you. Middle of the travel range is 0.
  • The Z stage pushes up the sample and positive is up. Fully lowered is 0.
  • All motion commands need to be in mm.
For instance, you may find that your X stage moves from "0" to "100" mm with zero on the left. This means the middle of the motion range is 50 mm, not 0 mm, and positive values are to the left not to the right. Thus, the motion commands going to this device will need to be modified. The easiest way of doing this is to create a stage class specific to this stage and use the transformInputDistance and transformOutputDistance properties to effect the conversion. These properties can also be used to change units. Examples:
  • The haydon43K4U class which converts between stepper motor steps and mm.

Startup File

If present, a file named SETTINGS\startup_bt.m will run automatically once BakingTray has started. This is done by BakingTray.m You may put whatever code you want to execute into this file. It is not sanity checked!
Copy link
Contents