Skip to content

syncAndCrunch walk through

Rob Campbell edited this page Mar 12, 2017 · 5 revisions

syncAndCrunch is the function that processes data during acquisition, sends images of the most recently completed section to the web, and stitches data automatically once acquisition is complete. This page describes in detail how to set it up and run it.

  1. If you are running the command on a remote server you will probably want to set up a persistent session so the analysis does not stop if you disconnect. Use the Unix screen or tmux commands or set up VNC or even TeamViewer.

  2. Start MATLAB and change to the directory on which the RAID volume is mounted. E.g. maybe your RAID volume is on /mnt/data and you keep your stuff on /mnt/data/rupert. So you will: cd /mnt/data/rupert Do not create the experiment directory (i.e. the name of the directory containing the data on the buffer server): this is done automatically by syncAndCrunch.

  3. We will now use the syncAndCrunch function to begin the analysis. You can remind yourself what the command does with help syncAndCrunch

  4. Change to your directory within MATLAB (here we are using /mnt/data/rupert, but you will use your own). Now run L=pwd. This creates a variable with the name of this local directory.

  5. Now you will create a variable containing the name of you experiment directory on the buffer server. e.g.

S = ’/mnt/tvbuffer/Data/rupert/PFY_0123’;

(obviously substituting this with your own data directory). 7. Now you can run syncAndCrunch. e.g.

syncAndCrunch(L,S,2,1:3,0,1)

You will want to enter the correct parameters for you data. The above command pre-processes the data by building comb-correction coefficients for channel 2 only, illumination correction for all three channels, and plotting channel 1 on the web. Read the help for the command if it's not clear why it does that. Note that one of the options will delete the third channel from the server without confirmation! You should now see stuff scrolling down the screen and it should appear to be doing things. After a bit you’ll see it say that it’s building the web images.
You can the navigate to the URL to which the images are sent. This is set vi a the INI file. It will just keep looping. If running on a remote server you can detach from your screen session or VNC connection. When all sections have been acquired, it will stop pulling in data and automatically start stitching. If you finish the acquisition early, you can manually trigger stitching by creating a file called ‘FINISHED ’ in the experiment root directory. syncAndCrunch will automatically start stitching when it finds the FINISHED file. Alternatively, you can quit with ctrl+c and run the stitching commands manually. It is important that you keep an eye on the progress of the experiment by looking on the web from time to time. syncAndCrunch will usually send messages to Slack (if you have configured this) if it crashes. You can then re-start it.