Building Wrapper Library to use PICam SDK in LabVIEW

PICam-LabVIEW-Wrapper This project is a simple C++ wrapper for the PICam SDK. The purpose of this wrapper is to resolve necessary pointers, perform data conversions, and expose certain functions to LabVIEW. The wrapper is designed to be used in LabVIEW as a DLL. The wrapper is not a complete wrapper for the PICam SDK, but it does provide a good starting point for developing a more complete wrapper.

Read More

Optical/Chemical Kinetics (Update 2023/10/02)

XPM->Exp1->Exp2->Offset I have added an updated Mathematica file here named as “DecayModelling.nb” that has more details on how to drive the model from a set of differential equations and initial conditions. Additionally, it has all the analytical solution at the end with thoughtfully organized modules. The modules can be mixed and matched to build several models.

Read More

Wandering Baseline Correction

For my experiment which was related to picking signal from a sensitive load sensor I needed a way to remove the wandering baseline. The sensor was connected to small fish and the resulting signal suffers from natural wandering baseline. Simply taking a mean of buffered data could not give an acceptable result, therefore I wrote this piece of LabVIEW code. Wandering Baseline Correction

Read More

A Simple OMR Study Program (for Zebrafish)

For my experiment I was set to make program that can trigger swimming behaviour in an head-fixed adult zebrafish. This kind of behaviour can be triggered by presenting a moving grating. To do so I made simple animation for different kind of moving grating that can trigger the swimming in upward, downward, left, right, forward and backward direction in Blender. The with a simple labview program I can read the frames and have control over the frame-rate.

Read More

Control Ableton Live with OSC through Max for Live

One can’t imageing to what extent a bored man can go! To prove this I always wanted to control my Ableton Live set with my iPad. I wanted to have full control. I started with TouchOSC but I found it very limiting. They I saw “TouchAble” and “LK”. “LK” looks like a great piece of work with an active maintanance. So I bought that. Then before actually making any music I thought wouldn’t it be cool if I could make my own control surface! Well it is very very cool. I also always wanted to learn Max so I found this a good opportunity to learn and build something that I can use along with LK.

Read More

Detecting Cell Units (Neurons) and Their Activies

The past two years as my first postdoc project I started building a two photon microscope and virtual reality setup. The setup runs in a close loop so the animal behaviour can be mapped to its brain activity. To extract the neurons activities I ended up using CaImAn package in Matlab. To ease my pain and build a smooth pipeline for my application I build a script that calls CaImAn function in a certian order. The script starts with a popup that ask for user input for essential parameters and then ask for the image file. At the end, after the script finishes it will clean up the unncessary variables and save the rest for the user’s reference as a “.mat” file in the same directory.

Read More

UDP Sender/Receiver between LabVIEW and Python

I have been developing and imaging system that can monitor the brain activity at cellular level in a transgenic adult zebrafish brain. The imaging is done while the animal is swimming in an immersive virtual reality environment. The animal is head-fixed and forces are recoded with a load cell. With the sensors data I could get necessary metric to navigate in a 3D rendering environment. In our case, we used Panda3D which can be scripted in Python. The main challenge was how to send the meterics recorded in LabVIEW to the Python script. There are several ways to that, such as, Python node VI in LabVIEW, ActivX object, TCP and UDP. I chose UDP as I need fast (less than 10 ms) communication. ActiveX and Python node VI were not fast enough for my application. Although UDP is a lossy protocol, it is still suitable for my application.

Read More

Projectile Motion with Drag Force in Mathematica

As far as I rememeber this is my frist fully accomplished project. I had to calculate and compare a projectile’s motion without and with the air resistance (drag force). I basically keep this here for my own personal pleasure as a thing to remember. If you evaluate the “Projectile-Comparison.nb” in this repository you should be able to get something like below Projectile Motion Comparison

Read More

Optical/Chemical Kinetics

This is a Mathematica file that evaluates a series of different kinetics from their differential equation form. Depending on whether doing chemistry or photochemistry this can find the concentration of products or the excitons respectively. The conditions are a typical summation of exponential decays, to profiles with a rise feature or a condition that the decay is proceeded after a spike (rise = decay time-constant).

Read More

Crystal Growth by Chemical Vapor Transport Technique (CVT)

During my master degree I managed to grow some ZnSSe crystals by CVT technique. To do that I had to find the right calibration curve for the temperature difference inside the tube-furnace. To do so I had to calculate the pressure of the possible species in the vaccum tube using the chernove bulk diffusion model.

Read More

Fitting TCSPC data in MatLab

I put together a small example of a typical TCSPC measurement. I used PicoHarp 300 from Picoquant. Great system but you are limited to their fitting software which can be something you not really looking for. Of course it can fit typical summation of exponential functions but if your fitting model is specific you might want to do this in MatLab or some other environement. Picoquant made availabe an script that can load picoquant proprietory files in MatLab. From Matlab you have unlimited freedom to deal with your data they way you want.

Read More

Multi-component Exponential Fitting algorithms in MatLab

Coming soon … I will update this page with all the codes I have written in MatLab to process multi-exponential decays. The instrument response function (IRF) can be synthsized or acquried then be numerically convoluted with the model for precise lifetime calculation. Alternatively, the model can be evaluated with the IRF in mind. Hopefully they can serve as an starting point or a reference for various applications.

Read More

Tuned Amplifier (Replace Lockin with a simple circuit)

Tuned Amp Circuit and response During my PhD program there were some concerns about the long time constant of the lock-in amplifer (SRS-844) which caused directional bluring (along the fast axis) in our laser scanning microscope. Knowing the fact that lock-in amplifers are costly I got the motivation to simulate and build an analogue circuit to overcome this. I was aware of a paper that discussed a module (tuned amplifier) to replace a lock to detect estmulated Raman scattering (SRS) signal. I basically replated their work which was also originated from a paper from 1992. Here I attach my design as a reference in case anyone wants to implement it in therir system. In my case I got a funding source to buy a faster lock-in amplifier so I did not pursue this further. To get design and PCB schematic files head over to this project.

Read More

Series of Macros for Repetitive Image Processing

My project typically involved extracting features from a time-resolved images. I was trying to get meaningfull metrics to compare mophological features and lifetime values accross the stack of images. To ease my pain I tried to automate as many operations as can. It all ended up with bunch of imagej macros that I am shairing here for others as a reference to get some ideas in case of doing something similar.

Read More

Laser Scanning Microscope Acquisition GUI in Labview

This is a post dedicated to the LSM acquisition software me and my co-woker (slash mentor Joy Chung). Most of the primary work has been layed out for me by Joy. I had minor contirbution to bring it together and refine the aesthetics. This LabVIEW is written over couse of 5 years and evolved kind of with me during my PhD and it’s very dear to me. I hope this can be useful for others as well as tool as is, a scheme how the the time resolved LSM interface should look like or as a code template for trouble shooting.

Read More