Skip to content

Commit

Permalink
Merge pull request #121 from henrypinkard/main
Browse files Browse the repository at this point in the history
Fix multi cam
  • Loading branch information
henrypinkard authored Apr 16, 2024
2 parents d883a12 + cd387e1 commit 8b1a818
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.micro-manager.acqengj</groupId>
<artifactId>AcqEngJ</artifactId>
<version>0.37.1</version>
<version>0.37.2</version>
<packaging>jar</packaging>
<name>AcqEngJ</name>
<description>Java-based Acquisition engine for Micro-Manager</description>
Expand Down
21 changes: 17 additions & 4 deletions src/main/java/org/micromanager/acqj/internal/Engine.java
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,13 @@ private void acquireImages(final AcquisitionEvent event,
// TODO: probably there should be a timeout here too, but I'm
// not sure the snapImage system supports it (as opposed to sequences)
ti = core_.getTaggedImage(camIndex);
cameraName = core_.getCameraDevice();
if (ti.tags.has("Camera")) {
// This is present for multi cam adapter
cameraName = ti.tags.getString("Camera");
} else {
// but not regular cameras
cameraName = core_.getCameraDevice();
}
} catch (Exception e) {
//continue waiting
}
Expand Down Expand Up @@ -606,6 +612,11 @@ private void acquireImages(final AcquisitionEvent event,
// add standard metadata
AcqEngMetadata.addImageMetadata(ti.tags, correspondingEvent,
currentTime - correspondingEvent.acquisition_.getStartTime_ms(), exposure);
// special behavior for multi camera adapter
if (core_.getNumberOfCameraChannels() > 1) {
AcqEngMetadata.setAxisPosition(ti.tags, "camera", cameraName);
}

// add user metadata specified in the event
try {
correspondingEvent.acquisition_.addTagsToTaggedImage(ti.tags, correspondingEvent.getTags());
Expand All @@ -620,9 +631,11 @@ private void acquireImages(final AcquisitionEvent event,
// this is not the most pleasant place to put this call, but I can not find anything better.
stopHardwareSequences(hardwareSequencesInProgress);

event.acquisition_.postNotification(
new AcqNotification(AcqNotification.Camera.class,
axesAsJSONString, AcqNotification.Camera.POST_SEQUENCE_STOPPED));
if (event.getSequence() != null) {
event.acquisition_.postNotification(
new AcqNotification(AcqNotification.Camera.class,
axesAsJSONString, AcqNotification.Camera.POST_SEQUENCE_STOPPED));
}

if (timeout) {
throw new TimeoutException("Timeout waiting for images to arrive in circular buffer");
Expand Down

0 comments on commit 8b1a818

Please sign in to comment.