XIMEA camera interface

Hi Alina,

The interface to XIMEA cameras is now in the MWorks nightly build. For details, please see the user manual. To use it, you’ll need to install the XIMEA macOS Software Package on the machine running MWServer.

As I said previously, captured images are converted to JPEG format for storing in the event file. You can also view them while the experiment is running via MWClient’s Image Viewer window. Just set the “Image data variable” field to the name of the variable used in the image_data parameter. On my iMac, I can easily capture 100 frames per second with only moderate impact on the CPU. Hopefully, things will run smoothly on your hardware, too.

As noted in the docs, MWorks configures the output pin to be on during frame exposure. However, I wasn’t able to test this, as I don’t have the tools to bring the 25V of the output pin down to the 3.3V that can be tolerated by the Arduino boards I have on hand. Be sure to get that voltage down to a safe level for your recording hardware.

I’ve attached a simple demo experiment that exercises the camera. I’ve also included a Python script that demonstrates how to extract the images from your event file.

If this all sounds OK, the next step is for me to return the camera to you for testing. I can probably stop by this morning, if you’re around. If not, maybe we can find a time next week.

If you have any questions or other feedback, please let me know!

Cheers,
Chris

Attachment: ximea_camera_demo.zip (2.93 KB)

Hi Chris,

That all sounds good, unfortunately I was completely occupied with meetings on Friday and did not see your email until much later. Happy this seems to be working, documentation also looks good.

Thanks for warning me about the voltage output problem!

There’s a surgery on Tuesday morning and Wednesday morning I have a meeting until about 10am. Monday I have sth at 11am and need to catch Kostas in the workshop before that, but I can meet you before 11am if I know fairly precisely when you would come. Would anything suit you on Monday or Wednesday?

Alina

Hi Alina,

I could come by Monday morning, but I’m not sure how precise I can be with the timing. How about Wednesday around 11am?

Chris

Yes, let’s do that then!

Alina

Hi Chris,

Just a brief feedback that I got it to run, how stable it is on my rig and how fast it can go reliably remains to be tested . But based on my previous tests on rig 2 I am optimistic.

OK. Thanks for letting me know!

Chris

Hi Chris,

Given that the mworks files get really large with the camera images, I anticipate a future need to have the mworks file part that is not the images extracted to share it with others for example. Or let’s imagine that I decide post-hoc I don’t need the camera data for certain recordings and want to save on data, it would be nice to just store the classical mworks file. Just a thought for now. I’m new to mworks as you know so there’s a good chance that this is utterly trivial.

Hi Alina,

It’s certainly possible (not utterly trivial, but not difficult) to remove the camera images from an event file. I can write a short Python script to do it, if/when you need it.

Cheers,
Chris

Hi Alina,

Given that the mworks files get really large with the camera images, I anticipate a future need to have the mworks file part that is not the images extracted to share it with others for example.

I’ve attached a Python script that will remove the image events from an event file. Usage is

python3 remove_image_events.py infile outfile varname

The script copies the input file to the output file and removes the events from the latter. varname is the name of the variable you assigned to the image_data parameter.

The script makes use of the MWK2Reader class that I mentioned elsewhere (and therefore also depends on msgpack). This will allow you to run it on Braintree, if needed. Actually, MWK2Reader is only used to convert the variable name to an event code. The real work of the script is just an SQLite DELETE, followed by VACUUM to minimize the size of the output file.

If you have any problems using the script, please let me know.

Cheers,
Chris

Attachment: remove_image_events.zip (1.74 KB)