Tuesday, February 19, 2008

LS2KMacro – Status

The macro for the MPM system is progressing, and the current version implements 4 out of the 5 original requirements.

- From the macro GUI, the user can enter the number of columns (X direction) and rows (Y direction) to be included in the scan.

- An input box allows the user to define the degree of overlap between the frames.

- The scan can be interrupted in mid-operation by clicking the “Stop” button. Then, the user can either continue the scan from the current position by clicking the “Resume” button, or the “Start” button can be used to start a new scan from the beginning. If the user-defined settings such as X and Y frames or overlap are changed, these new settings will be used the next time Start is pressed.

- A check-box is used to provide the option of homing back to the starting position at the end of the run.

This version of the code has been tested on our system using LaserSharp2000. The features described above worked successfully, and we were able to view the images scanned by the MPM after each movement of the XY stage to the next frame.

This macro code and installation instructions can be found at http://dev.drbio.cornell.edu/lt222/LS2Kmacro/downloads.html.
Look for files under the heading "a.92". Please note that some features of the GUI are for development purposes only (such as the listbox and cheesy graphic), and this will not be the final format of the interface. Any comments/suggestions about features wanted in the final format would definitely be appreciated!

As for the next step… I am currently working on automatically saving the image files directly from the macro. I am also working on a method for taking z-stacks of selected frames. I have been developing one possible method for selecting the frames graphically. This involves overlaying a grid (each square represents one frame) on an image of the entire field of view, and the user can click on each frame they want a z-stack of. Another possible method would be selecting the frames numerically. I am also getting input from MPM users on methods they might like. (Again, any comments would be appreciated.) Another feature I will try to add in future versions is the option to move the stage to a user-selected position at the end of the scan.

-Lisa

17 comments:

Sushmita Mukherjee said...

Hi Lisa,

I tested the new macro. I was able to register the ActiveX component fine. I confirmed my serial port (port#4) from the previous version of the macro(test_a10.vbs). The stage responds fine to it. However, when I run the current macro using the same port setting, the system freezes up. It gives a series of error statements.
1. On the macro dialog box, I get the statement "Open the serial port. Move X=0 y=0.
2. Run time error '0'
3. Run time error '440' Automation error
4. Run time error '402' Must close or hide topmost modal form first
5. Automation error

When I close the script dialog box, the whole field fills up with hatch bars. then, I can close screens, but cannot open anything, like a new image window.

Sushmita

Lisa Toth said...

Hi Sushmita,

Thank you for your reply.

I am not able to duplicate this series of errors here. I don't know how your system differs from ours, so I will make a series of incremental tests which add a little bit of functionality at a time. Hopefully then we can isolate where this problem is coming from. I will let you know when I've posted the new tests.

-Lisa

Lisa Toth said...

Hi Sushmita,
Please try Test1 posted here.

Thanks!
-Lisa

Sushmita Mukherjee said...

Hi Lisa,

I tested the new macro (test1). Now, it controls and moves the stage fine. If I change the preset for the X-max, it still seems to go to the right place. However, if I change the preset for Ymax, the stage fails to go to the location it should. Also, this macro doesn't initiate a scan or acquire images.

Best,

Sushmita

Lisa Toth said...

Hi Sushmita,
I have just posted Test 2. This tests the DoEvents function which enables the stage to be stopped mid-scan and then either resume from the current position or return to the home position and start a new scan. I am using the word "scan" here to mean the movement of the stage through the pattern. This test will not acquire any images - I will add that into a later test.

The installation instructions document gives more information on how to use the macro. Please let me know if you have any questions, and also let me know if the stage moves to the position you specify or if you continue to have trouble with the final stage position.

Thank you,
Lisa

Sushmita Mukherjee said...

Hi Lisa,

I tested the new macro (test2). It works perfectly - just like your have described.

Thanks.

Sushmita

Lisa Toth said...

That is good news! Now on to the next one... I have uploaded Test 3. This test is very similar to the last one, except that instead of simply pausing after each stage movement it should actually acquire images. There are more details in the installation document. Please let me know how it goes!

Thanks,
Lisa

Sushmita Mukherjee said...

Hi Lisa,

I tested the macro test3 - and it does not work on our system. As soon as the macro is Run, the LaserSharp program crashes with the following error messages:
1. Run time error '0'
2. Run time error '440'
Automation Error
3. Run-time error '402'.
Must close or hide topmost modal form first.

On the macro dialog box, I see:
Open the serial port.
MOVE X=0 Y=0
Acquiring Image at Row 1 Col 1

After I close all the error windows, the Lasersharp needs to be restarted.

The port selection was correct, and test2 worked fine on the same run.

Sushmita

Lisa Toth said...

Hi Sushmita,

That is not so good news, but at least we have isolated the problem.

When you get all of these errors, do they appear immediately when you start the vbscript, or do they appear after you press the start button on the macro GUI? Do they all appear at the same time or after different events? Do the messages in the macro dialog box appear before or after any of the errors?

I haven't seen these errors, but I will look into what causes them and hopefully that will help determine what is different between our two systems.

Thank you for your help.

-Lisa

Lisa Toth said...

Also,
What version of LaserSharp are you running?

Thanks!

Sushmita Mukherjee said...

Hi Lisa,

Here are the responses to your questions.

1. Our application: LaserSharp 2000 5.2 build 823; Copyright 1993-2004

2. Errors appear after hitting the start button on the macro GUI.

3. They all appear at the same time. You have to close the one of top to see the next below. In that sense, the errors probably appear in reverse order to how I have listed them.

4. The messages on the macro dialog box and the error messages are practically simultaneous. It seems like the dialog box comes first, but I can't be sure.

Sushmita

Lisa Toth said...

Hi Sushmita,

Paul has suggested that your computer might be missing a file needed to properly run programs created in Visual Basic. Could you please search your computer for the file "msvbvm60.dll"?

If it does not exist on your computer, you can download a service pack from microsoft (found here) which may fix the problem.

After you download the file and install it, you need to restart your computer. Then, re-register the dll file for Test3 the same way you did before (using regsvr32 ls2k_test3.dll). And then try the test again.

If you do have the file already or if installing it does not fix the problem, then we will keep working on this.

Thank you,
Lisa

Sushmita Mukherjee said...

Hi Lisa,

I searched for msvbvm60.dll. I found two entries:

C:\WINNT\$NtServicePackUninstall$

and

C:\WINNT\system32

Sushmita

Lisa Toth said...

Hi Sushmita,

Please try Test4.

The purpose of this test is just to make sure that we are able to access the microscope settings from within our program. This test will not acquire images, but it will move the stage as in the previous test.

After you click the "Start" button, you should see three messages appear in the macro dialog box telling you the XPixel size, pixelsperline, and scan box size. After the messages appear, the stage should move through the number of rows and columns specified, and then you should receive the message "Scan Sequence Completed".

I haven't created an instructions document for this test. It is the same as before but with the ls2k_test4 files. Please let me know if you have any questions.

Thank you very much!
-Lisa

Sushmita Mukherjee said...

Lisa,

Test4 works fine - including the stop and resume buttons.

Sushmita

Lisa Toth said...

Hi Sushmita,
That is helpful because now we have narrowed it down to the one command that is causing your system to crash. We now have the same version and build of Lasersharp that you are running. Once that is installed we will try to re-create the same problem here and hopefully will be able to do most of the troubleshooting over here. I will definitely keep you posted. Thank you again for your help.

-Lisa

Lisa Toth said...

Hi Sushmita,

I found out that our systems are not exactly the same (hardware-wise) as you have the MRC-1024 and we have the Radiance. We contacted someone from Bio-Rad support who said that some commands may not work on the MRC-1024.

He gave us a service pack for your version which may fix the problem. I have posted it here as "Service Pack for Laser Sharp v5.2".

He also suggested running the script "BioRadHelper.txt" before running the macro. This file should be included in the scripts folder on your system. Please let me know if you can't find it and I will get it for you.

Thank you,

-Lisa