-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feedback on new camera trigger API proposal (Chapter 2) #226
Comments
I'm collecting a feedback from PVCAM adapter point of view. But before posting anything I'd like to clarify how exactly the new API will be integrated to existing code structure. If I get it right, the new API calls will be added to For example: You mentioned in Backwards compatibility chapter that Or do you plan to provide default implementation for new functions in Would it be even possible to provide default implementations for more complex functions like |
Thanks @tomhanak !
Yes on the mirroring 1:1, but the proposal I wrote is core additions to
Correct
Most likely we'll need to add something like a
It would certainly be nice if it were possible, but this is something it would be great to get your feedback on to see if the proposal for how to do this actually makes sense. |
How will the end user control the trigger settings? You have rejected new properties with standardized names that would show up in property browser, and I agree with the conclusion, but... Then there must be another GUI the user could use, probably on main window below binning and shutter settings? How would you present the options? Four combo-boxes with names from code? That would confuse everyone, though. One combo box with all 34=81 combinations? I doubt so... The It is not explicitly mentioned anywhere, but I suppose any type of running acquisition/burst will be possible to abort by I see again a statement "Camera is always ready for a burst" and I saw it also somewhere around I was unable to uniquely map PVCAM's Below are all PVCAM trigger modes, expected trigger settings and mapping to PVCAM functions. A live acq. with
It could be theoretically configured exactly as shown on you first example diagram "Software triggered burst", but in this case the
A live acq. with
A live acq. with
A live acq. with
A live acq. with
A live acq. with
A live acq. with
|
Remaining thoughts that I didn't want to mix with my previous long comment. I'm missing getters for trigger types. Instead of caching every trigger type on adapter side in related setters, I would use those getters from within What to do with existing adapter-specific properties related to triggers, like "TriggerMode" in PVCAM adapter? We would like to keep it because most of the PVCAM parameters are presented 1:1 as properties in the browser. Would it be possible to call Regarding the confusion "what happens if somebody configures the new-stype trigger and then call the existing Having four dedicated |
There's lots going on here, so I'll try to split my comments into readable lengths. I'm also going to concentrate first on the most widely available trigger types and leave rolling shutter modes to the next round of discussions. Also please bear with me if I fail to point out every issue on the first try. First, regarding terminology and concepts:
|
Now about how to structure individual functions/properties/features/whatever we want to call them. Some of this overlaps with what @tomhanak pointed out above.
|
Regarding the API for starting and stopping acquisitions. I am of the opinion that the scope of this work should be limited to providing an API to specify trigger settings and send software triggers. Changing how to start and stop an acquisition should be a separate proposal if needed. The meaning of (Note that SFNC also has an AcquisitionArm command, whose use is optional. This is similar to MMDevice's So I'm not really sure why a function with a new name ( |
Thanks to both of you for all the excellent feedback! I've gone through your comments and provided responses below. I've also made a rough list of areas/issues to consider more or revise in the API based on your comments. Next steps: Mark and I will meet and discuss these in more depth. After that, I will revise and post a new proposed API. That will be available for more feedback, and simultaneously I will start building a prototype device adapter with this revised API on a Basler camera (chosen because it is similar to GenICam, and because I am already familiar with the SDK having written its adapter a few years ago). Between additional feedback and the hands-on experience of building a prototype, hopefully we can progress towards finalizing this soon. Things to change and/or discuss further(please comment if I've missed anything)
Agreed, you're right.
Yes, that makes sense.
Yes that makes sense. There are three potential ways to do this, and the current API uses two:
I think in this new API it makes sense to stick with only (2) or only (3). My preference would be (3), though I haven't fully thought through any backwards compatibility challenges.
I think that's okay because if they're much faster closing the shutter in between exposure end and readout end is less of a concern
I hadn't considered this before. I could see how it would make sense that SendBurstEndTrigger() could be used akin to an abort function or
That makes sense, and I think it is okay to put both
So if I understand, you're advocating for keeping the trigger types cached in the Core instead of the Adapter. Seems reasonable to me.
This would be fairly easy to add. Though maybe this argues for keeping the state management in the adapter instead, and adding getter methods to the adapter interface.
There are callback mechanisms that go from adapter -> core -> UI, although I believe they are incomplete/inconsistent. Maybe @nicost and @marktsuchida can say more.
I'm not entirely sure I understand the use case here, could you explain a bit more?
Yes, I think that makes sense. I think the core should be able to handle routing to the correct API, though I'd like to test it out. Agree that it should be forbidden at higher levels of software.
Agree Onto Mark's comments
It's "Based on", not a replication of the spec. Please point out any changes to naming conventions (in addition to those you already have) that are the same concepts with different names.
We disagree on this, and I'm not sure there is an objective correct answer here, though I get where you are coming from. Here are the reasons I see to use the "burst" terminology: It is confusing that we currently use "Acquisition" to mean a single burst of frames (e.g. When I read "burst", I think "happens really fast". When I read "bursts" (plural), I agree with you, I think of happening in multiple series of frames. The proposed API is singular, not plural. So it can be used for, for example, to collect a single timelapse of frames as fast as possible. This, to me, should be called a burst. It can also be used multiple times to collect multiple series of frames. For example a timelapse triggered z-stack. We already call something like this a (Multi-D) acquisition, so I think this fits nicely with the paradigm that GenICam describes. I am not alone in thinking that a "burst" and a "sequence acquisition" are equivalently "a series of frames acquired really fast". Though the API doesn't say it explicitly, we use the term "burst" to mean this in several places in the documentation already (1, 2, 3 -- search for "burst"), and MM users use the terminology as well when asking questions (4, 5). So I don't think this is introducing anything new as much as it is clarifying an existing inconsistency in MM. We could similarly replace "Burst" everywhere in this proposed API with "SequenceAcquistion", but this is more verbose, and in my opinion less clear. I also think these is less potential for errors and confusion from users if the new API is clearly delineated from the old API in function names. Finally, I don't see any reason that calling it "Burst" would lead to limitations on the device adapter side. "Acquisition" and "Burst" have analogous trigger types in GenICam (AcquisitionStart--FrameBurstStart, AcquisitionEnd--FrameBurstEnd, AcquisitionActive--FrameBurstActive), it seems like cameras that have no special Burst modes could still pretty easily map their acquisition features to our "burst" API. But where there is an additional special Burst mode available for extra high speed (like the one in Basler), then that's definitely something we want to expose so that users have access to the highest-performance.
Yes, that makes sense. Can you propose new function names reflecting this?
This makes sense, I don't have much experience with these settings. I'd like to actually prototype something on a camera to see how it might work and what I'm missing. In the meantime, if you can offer your best guess at what the API should like that would be helpful.
I see what you mean. This still isn't totally clear to me and I think my understanding would benefit from prototyping. I have a hunch this ties in with how one interprets a burst.
Good point. if we do it as functions, they're essentially going to be exactly like properties but without being in config groups. It is worth investigating in prototyping how difficult it would be to make standardized properties in the core.
It seems to me these are interrelated enough that it would be hard and confusing to do one without the other. I think it is another thing that would benefit from prototyping before reaching a final decision.
I think this is essentially the same as Phew! That was lot. It will definitely be helpful to talk through this more on Zoom. |
After discussing with @marktsuchida , a new version of the API has been created: A brief overview of some of the important changes: Similarity to GenICamSince the first version of this @marktsuchida has come to the idea that this API should follow GenICam as closely as possible, unless there is a compelling reason to diverge. I too have become convinced of this. The new version has numerous changes to make this a reality (not bothering to list them all here because there are many) Triggers as properties vs. functionsAfter further study of GenICam, I don't think it makes more sense to make triggers functions instead of properties. Each trigger type (e.g. FrameStart, FrameBurstEnd), which GenI calls "TriggerSelector", has its own state: On/Off, delay, internal/external/software. Enumerating these for all triggers would either lead to an enourmous number of properties, or would not show all the trigger settings at once in properties. Either way it would be hard to visualize Furthermore, changing one part of the state at a time (e.g. source=Internal, or activation=RisingEdge) would lead to a property state that is not necessarily valid until some validate function is called, or it would require the adapter to adjust to a valid combination in a complicated and potentially confusing way. The new API thus includes Caching of trigger states should be on the camera or device adapterAs @marktsuchida correctly points out, this will avoid the core getting desynchronized Old API/backward compatibilityThe old (camera) API for now will be optional on new devices, to be removed later in the future (maybe) The old (core) API will be implemented in terms of the new camera API when it is present, or fall back on the old camera API when its not Bursts/Acquisition TerminologyI've come around to @marktsuchida's position of using the The distinction between these may not matter so much in practice. For example, in the Basler API, Acquisitions and Bursts are the same thing. But better to stick with what is more explicitly outlined in GenICam. Some users may still think of these as Bursts, and there remains confusion with MDAs. Oh well. Include AcquisitionStart, AcquisitionStop, etc.Yes. This seems much simpler to me by including these than by trying to contort existing API to fit them. It also will separate old API from new, which I think will make things cleaner and backwards compatibility easier. The only downside I see is that the Core API will have many functions, some of which have simialr names, which are part different APIs. Open to suggestions to simplify this. Next stepsThe new API (v2) is here Closing this issue now, and opening a new issue for discussion of v2 of the API and the prototyping process. |
A draft of a new camera triggering API has been created here. This issue is for providing feedback on that proposal.
Will it map all types of cameras used in MM? Are there additions/changes that should be made?
The text was updated successfully, but these errors were encountered: