(Using MicroManager for the first time) Slightly altered burst mode?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

(Using MicroManager for the first time) Slightly altered burst mode?

Nicola Fairbairn

Hi there,


I'm currently trying to use a laser alongside a VariSpec Liquid Crystal Tunable Filter (LCTF) and a Hamamatsu C-4742-95 Camera for fluorescent imaging microscopy.


I want to use micromanager to sweep through a series of wavelengths while taking intermittent photos at every wavelength in 1nm or something similar - by automating this, it will save me a lot of work as I won't have to repeatedly take a photo, set the new wavelength, etc over and over. I've been doing some reading on previous archived threads for micro-manager-general and from what I've read it seems like I want something similar to the 'burst' mode or the 'Fast Time Series Acquisition'. I'm not entirely sure if that's the tool I need to do what I want to do, could someone point me in the right direction?

Furthermore, another issue I'm having is that I suspect I'd maybe have to do some programming alongside it to make it work if it isn't 'Burst' mode that I need, so I decided to try the Micromanager instructions on their website to allow me to use MATLAB to control it: https://micro-manager.org/wiki/Matlab_Configuration

However, I was unsuccessful as MATLAB didn't seem to like the MMCcore java object/didn't know what it was. I think the main issue here is that I'm not fluent in creating java object classes on MATLAB. I havn't used MATLAB properly in a few years, and all in all I only have about 2 years experience in it.

Any help you could provide me would be most excellent.

Kind regards,

Nicki



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: (Using MicroManager for the first time) Slightly altered burst mode?

Kyle Douglass-2
Hi Nicki,


On Tue, Jun 26, 2018 at 11:11 AM, Nicola Fairbairn <[hidden email]> wrote:

I want to use micromanager to sweep through a series of wavelengths while taking intermittent photos at every wavelength in 1nm or something similar - by automating this, it will save me a lot of work as I won't have to repeatedly take a photo, set the new wavelength, etc over and over. I've been doing some reading on previous archived threads for micro-manager-general and from what I've read it seems like I want something similar to the 'burst' mode or the 'Fast Time Series Acquisition'. I'm not entirely sure if that's the tool I need to do what I want to do, could someone point me in the right direction?

You will probably need to gather some information first before you can find an adequate solution. For example:
1. How fast must you acquire your images?
2. Does the LCTF support hardware triggering, or do you intend to tune its wavelength using a software library?
3. Can you trigger your camera as well? (Almost certainly the answer is yes, but it's worth checking :)
4. Does the LCTF have Micro-Manager device adapter?

The answers to these questions will help determine what constraints your solution must adhere to; there are many possible ways that you could approach this problem, so knowing which ones won't work helps to narrow the range of possibilities.
 
However, I was unsuccessful as MATLAB didn't seem to like the MMCcore java object/didn't know what it was. I think the main issue here is that I'm not fluent in creating java object classes on MATLAB. I havn't used MATLAB properly in a few years, and all in all I only have about 2 years experience in it.

Could you please post a small excerpt from your script that contains the lines that generate the error, along with the error message that was output?

Cheers,
Kyle


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: (Using MicroManager for the first time) Slightly altered burst mode?

Nicola Fairbairn

Hi Kyle,


For the first part of your email, I've managed to get the LCTF to talk to MM so all is well, I can alter the image according to the LCTF and I've worked out a way of taking snaps over a temporal region.


As for the second part, I've just followed the instructions on the link provided to get Micromanager to work with MATLAB, and I'm stuck at the stage where you're asked to 'create a java object of class MMCcore'.


I used the javaclasspath command and couldn't see the MMCore class on the class path, which is what MATLAB is complaining about.

As far as I'm aware I want to use the javaaddpath function to get the .jar file onto the path to define the MMCore object; the 'Micromanager Core API' is also provided but I'm not sure what to use it for/how to download it or where I get the .jar MMCore file from: https://valelab4.ucsf.edu/~MM/doc/mmcorej/mmcorej/CMMCore.html


Kind regards,



Nicki


From: Kyle Douglass <[hidden email]>
Sent: 27 June 2018 07:14:52
To: Micro-Manager General
Subject: Re: [micro-manager-general] (Using MicroManager for the first time) Slightly altered burst mode?
 
Hi Nicki,


On Tue, Jun 26, 2018 at 11:11 AM, Nicola Fairbairn <[hidden email]> wrote:

I want to use micromanager to sweep through a series of wavelengths while taking intermittent photos at every wavelength in 1nm or something similar - by automating this, it will save me a lot of work as I won't have to repeatedly take a photo, set the new wavelength, etc over and over. I've been doing some reading on previous archived threads for micro-manager-general and from what I've read it seems like I want something similar to the 'burst' mode or the 'Fast Time Series Acquisition'. I'm not entirely sure if that's the tool I need to do what I want to do, could someone point me in the right direction?

You will probably need to gather some information first before you can find an adequate solution. For example:
1. How fast must you acquire your images?
2. Does the LCTF support hardware triggering, or do you intend to tune its wavelength using a software library?
3. Can you trigger your camera as well? (Almost certainly the answer is yes, but it's worth checking :)
4. Does the LCTF have Micro-Manager device adapter?

The answers to these questions will help determine what constraints your solution must adhere to; there are many possible ways that you could approach this problem, so knowing which ones won't work helps to narrow the range of possibilities.
 
However, I was unsuccessful as MATLAB didn't seem to like the MMCcore java object/didn't know what it was. I think the main issue here is that I'm not fluent in creating java object classes on MATLAB. I havn't used MATLAB properly in a few years, and all in all I only have about 2 years experience in it.

Could you please post a small excerpt from your script that contains the lines that generate the error, along with the error message that was output?

Cheers,
Kyle


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: (Using MicroManager for the first time) Slightly altered burst mode?

Kyle Douglass-2
Hi Nicki,

On Wed, Jun 27, 2018 at 12:18 PM, Nicola Fairbairn <[hidden email]> wrote:

For the first part of your email, I've managed to get the LCTF to talk to MM so all is well, I can alter the image according to the LCTF and I've worked out a way of taking snaps over a temporal region.



Nice! Ok, so it sounds as if you're quite far along with your implementation. It's a bit difficult for me to follow what you have tried at this point over e-mail, but I can at least offer this advice. When you talk of "burst mode" I am assuming that you're referring to one of the scripts that initializes a free-running acquisition and pulls the images into the GUI as they become available. (The script for Micro-Manager 2.0 beta that does this is here: https://github.com/micro-manager/micro-manager/blob/mm2/scripts/burstAcquisition.bsh) You will probably need to ensure some sort of synchronization between your LCTF and the individual camera exposures, but I do not think that burst mode inherently provides any such synchronization. In my mind, you will have at least two options to implement the synchronization:

1. Explicitly snap an image in the script, verify that the new image has arrived, then change the LCTF's wavelength.
2. Set up the LCTF so that it is triggered by a camera exposure (or vice-versa). Then you will not need to be explicit about when the LCTF is updated within the Micro-Manager script itself.
 

As for the second part, I've just followed the instructions on the link provided to get Micromanager to work with MATLAB, and I'm stuck at the stage where you're asked to 'create a java object of class MMCcore'.


I used the javaclasspath command and couldn't see the MMCore class on the class path, which is what MATLAB is complaining about.

As far as I'm aware I want to use the javaaddpath function to get the .jar file onto the path to define the MMCore object; the 'Micromanager Core API' is also provided but I'm not sure what to use it for/how to download it or where I get the .jar MMCore file from: https://valelab4.ucsf.edu/~MM/doc/mmcorej/mmcorej/CMMCore.html



There are a few ways to setup MATLAB with Micro-Manager. In the past I have done the following to configure Micro-Manager for use in MATLAB:

1. Save the following code to a .m file named MMsetup_javaclasspath.m inside Matlab's prefdir directory. This directory may be found by typing prefdir into the Matlab Command Window. (I *think* this script was originally made by Kyle Karhohs and I lifted it from the Micro-Manager mailing list.)

function [] = MMsetup_javaclasspath(path2MM)
fileList = getAllFiles(path2MM);
fileListJarBool = regexp(fileList,'.jar$','end');
fileListJarBool = cellfun(@isempty,fileListJarBool);
fileListJar = fileList(~fileListJarBool);
fid = fopen(fullfile(prefdir,'MMjavaclasspath.txt'),'w');
fprintf(fid,'<before>\r\n');
cellfun(@(x) fprintf(fid,'%s\r\n',x), fileListJar);
fclose(fid);
%% nested directory listing ala gnovice from stackoverflow
% inputs and outputs are self-explanatory
function fileList = getAllFiles(dirName)
dirData = dir(dirName);      % Get the data for the current directory
dirIndex = [dirData.isdir];  % Find the index for directories
fileList = {dirData(~dirIndex).name}';  % Get a list of the files
if ~isempty(fileList)
    fileList = cellfun(@(x) fullfile(dirName,x),fileList,'UniformOutput',false);
end
subDirs = {dirData(dirIndex).name};  % Get a list of the subdirectories
validIndex = ~ismember(subDirs,{'.','..'});  % Find index of subdirectories
%   that are not '.' or '..'
for iDir = find(validIndex)                  % Loop over valid subdirectories
    nextDir = fullfile(dirName,subDirs{iDir});    % Get the subdirectory path
    fileList = vertcat(fileList, getAllFiles(nextDir));  % Recursively call getAllFiles
end


2. Run the above function in MATLAB, supplying the full path to MM's install directory. (On Debian Linux, it's often /usr/local/ImageJ/plugins/Micro-Manager/ ; in Windows, it's typically something like C:\Program Files\Micro-Manager-1.4.22, but not always and depends on the version).

3. Inside Matlab's prefdir directory, open the file MMjavaclasspath.txt that was created by this code.

4. If javaclasspath.txt doesn't exist, rename the file from MMjavaclasspath.txt to javaclasspath.txt. If it does exist, append the contents of MMjavaclasspath.txt to javaclasspath.txt.

5. Restart Matlab.

6. Test whether Matlab can access the Java classes by importing the MM core and creating an instance. If this returns no errors, Matlab now has access to the MM Java wrappers.

import mmcorej.*
mmc = CMMCore;


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general