Insert a sequence capture runnable inside MDA causing crash - 2.0 Gamma

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

Insert a sequence capture runnable inside MDA causing crash - 2.0 Gamma

austinb
I’m curious if someone may have any advice on this.

I basically took the “burst acquire” script and placed it inside one of the runnable example scripts.

When running the function by itself everything works.
When running the function inside MDA, it causes MDA to report a “no image from camera” error.

* I’m assuming this is because it’s not possible to use the image store system with MDA running?
Is there another way to accomplish a stream/burst capture of several frames? I’m ok just saving them to disk and not viewing them…

-Austin

Code example below




/**
 * Run an acquisition that stops after each image to allow the user to
 * manually adjust the microscope for the next channel.
 * Nico Stuurman, UCSF, June 2012.
 * [hidden email]
 */
import ij.gui.GenericDialog;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.micromanager.api.AcquisitionOptions;
import java.lang.System;
import ij.gui.GenericDialog;

//for storing image data
import org.micromanager.data.Coords;
import org.micromanager.data.Image;
import org.micromanager.data.Datastore;
import org.micromanager.display.DisplayWindow;



mm.acquisitions().clearRunnables();

runnable = new Runnable() {
   public void run() {


nrFrames = 10;
exposureMs = mmc.getExposure();
// Create a Datastore for the images to be stored in, in RAM.
store = mm.data().createRAMDatastore();
// Create a display to show images as they are acquired.
mm.displays().createDisplay(store);

// Start collecting images.
// Arguments are the number of images to collect, the amount of time to wait
// between images, and whether or not to halt the acquisition if the
// sequence buffer overflows.
mmc.startSequenceAcquisition(nrFrames, 0, true);
// Set up a Coords.CoordsBuilder for applying coordinates to each image.
builder = mm.data().getCoordsBuilder().z(0).channel(0).stagePosition(0);
int curFrame = 0;
while (mmc.getRemainingImageCount() > 0 || mmc.isSequenceRunning(mmc.getCameraDevice())) {
   if (mmc.getRemainingImageCount() > 0) {
      tagged = mmc.popNextTaggedImage();
      // Convert to an Image at the desired timepoint.
      image = mm.data().convertTaggedImage(tagged,
         builder.time(curFrame).build(), null);
      store.putImage(image);
      curFrame++;
   }
   else {
      // Wait for another image to arrive.
      mmc.sleep(Math.min(.5 * exposureMs, 20));
   }
}

mmc.stopSequenceAcquisition();
// Have Micro-Manager handle logic for ensuring data is saved to disk.
mm.displays().manage(store);




   
        print("I should print once per stage position");
   }
};

// Run the runnable on all frames and channels,
// but only when slize and position  are 0.
// -1 --> attach to all planes along given dimension

// Numbers are frames, stage positions, channels, slices
mm.acquisitions().attachRunnable(0, -1, 0, 0, runnable);

_______________________________________________
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: Insert a sequence capture runnable inside MDA causing crash - 2.0 Gamma

Stuurman, Nico
Hi Austin,

> I’m curious if someone may have any advice on this.
>
> I basically took the “burst acquire” script and placed it inside one of the runnable example scripts.
>
> When running the function by itself everything works.
> When running the function inside MDA, it causes MDA to report a “no image from camera” error.
>
> * I’m assuming this is because it’s not possible to use the image store system with MDA running?

Most likely.  It is quite a hack. Curious if this will work better in
2.0-gamma...


> Is there another way to accomplish a stream/burst capture of several frames? I’m ok just saving them to disk and not viewing them…

Why not set Time Points to 10, Interval to 0, Check Use Multiple
Positions, Set Acquisition Order to "Position, Time", and hit Acquire in
the MDA Window?

I may be missing a requirement..

Best,


Nico



_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Andor iXon 887

Jones, Matthew A
In reply to this post by austinb
Hi List,

I have inherited an Andor iXon 887; has anyone managed to get this to run through MicroManager? There are some incomplete threads from 2013, but no definitive answer.

Thanks!
Matt

Matt Jones PhD FHEA
Lecturer in Molecular Biology
University of Essex
T  01206 874740




_______________________________________________
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: Insert a sequence capture runnable inside MDA causing crash - 2.0 Gamma

AustinBlanco
In reply to this post by Stuurman, Nico

Hi Nico,

Thanks for writing back! 

This is in 2.0 Gamma.
Actual desired frames are for every stage position:
Multiple Z positions
3x normal single shots in FL
100 stream shots in FL # 4
100 stream shots in FL # 5
100 Stream shots in FL # 6

My assumption is that this wouldn/t fly using the MDA dialog. 


Austin Blanco
Advanced Research Consulting Corporation
e. [hidden email]
w. www.advancedresearch.co
c. 510.708.2995





On Aug 14, 2019, at 8:29 PM, Stuurman, Nico <[hidden email]> wrote:

Hi Austin,

I’m curious if someone may have any advice on this.

I basically took the “burst acquire” script and placed it inside one of the runnable example scripts.

When running the function by itself everything works.
When running the function inside MDA, it causes MDA to report a “no image from camera” error.

* I’m assuming this is because it’s not possible to use the image store system with MDA running?

Most likely.  It is quite a hack. Curious if this will work better in
2.0-gamma...


Is there another way to accomplish a stream/burst capture of several frames? I’m ok just saving them to disk and not viewing them…

Why not set Time Points to 10, Interval to 0, Check Use Multiple
Positions, Set Acquisition Order to "Position, Time", and hit Acquire in
the MDA Window?

I may be missing a requirement..

Best,


Nico



_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general



_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general