areaDetector / ADAravis

areaDetector driver for GenICam cameras using the Aravis library on Linux.
https://areadetector.github.io/master/ADAravis/ADAravis.html
6 stars 8 forks source link

14 bit data type #15

Closed hinxx closed 12 months ago

hinxx commented 2 years ago

One of the cameras we are working with uses 14 bit data type to deliver pixel data after converting raw readout to temperature. With that said we did not achieve something that works with 8/16 it data types. Uncommenting the following line gives success:

https://github.com/areaDetector/ADAravis/blob/1455cc46565e2c49ce12d29370ad6253f7e344c0/aravisApp/src/ADAravis.cpp#L93

Is the a way to get away without maintaining this it in a separate branch/fork?

MarkRivers commented 2 years ago

Please post the error message you receive if you don't comment out that line. Is the camera actually returning an array of uint16 and not some packed 14-bit data? Presumably you do want the 14-bit data stored in an NDUInt16 NDArray, correct?

I am trying to understand why that line would cause a problem.

MarkRivers commented 2 years ago

Please post a screen shot of your main ADAravis screen.

hinxx commented 2 years ago

Please post the error message you receive if you don't comment out that line.

2022/02/10 12:25:26.681 ADAravis:processBuffer: unknown pixel format 17825829
2022/02/10 12:25:26.697 ADAravis:lookupColorMode: Could not find a match for pixel format: 17825829

The above message is received when using stock ADAravis code (with the line in the initial report commented). As soon as that line is uncommented, I can select Mono14 Pixel format, and the data on the IOC makes sense. So the problem is that stock code that line commented out while need it uncommented.

Is the camera actually returning an array of uint16 and not some packed 14-bit data?

I think it is returning the packed 14 bit data as far as I can tell (because going with Pixel format = Mono16 results in data that does not make sense). My understanding is that because the camera packs the pixel data into 14 bits it is not possible to use Mono16 data type on the IOC. We tried different settings for convert format and bit shifting (with Mono16) but could never see the reasonable data in the IOC.

Presumably you do want the 14-bit data stored in an NDUInt16 NDArray, correct?

Yes, that is the intention.

Please post a screen shot of your main ADAravis screen.

I'll have to come back to you with that one as the setup is torn down at the moment.

MarkRivers commented 2 years ago

@hinxx I misread your original message, I thought you were commenting out that line, but now I see that you were uncommenting it. That makes sense, and the question is why was it originally commented out. I will research that.

MarkRivers commented 2 years ago

Line 93 was inherited from aravisGigE, and was commented out in this commit by @thomascobb:

https://github.com/areaDetector/aravisGigE/commit/5c2d3d3cc508ff59712474d45b7a65f93ebd7b64

The commit message says:

aravisGigE: explicitly set packet size to 1500 to avoid Bad Frame 2 messages when camera has just restarted. Don't try and use Mono14 mode for UInt16 as it doesn't seem to work on Manta cameras

Are you using a Manta camera, or some other type?

hinxx commented 2 years ago

Using Flir A35 and another Mako camera in my setup. I'm running two different ADAravis IOCs at the moment (stock code with Mako and the code with uncommented line with Flir).

MarkRivers commented 2 years ago

I uncommented that line and pushed to the master branch. Please make sure the master branch runs on both cameras.

thomascobb commented 2 years ago

My original comment was about an early firmware version of the Manta (1.52 I think). It's entirely possible that they have fixed it since then. The Mako and Manta firmwares follow a similar (identical?) numbering scheme so it would be useful to know if the Mako works in 14-bit mode. @hinxx: if the 14-bit mode works with the Mako, please can you post the firmware version of the Mako that you have?

hinxx commented 2 years ago

if the 14-bit mode works with the Mako, please can you post the firmware version of the Mako that you have?

Sure! I'll give it a try in the coming days.

MarkRivers commented 2 years ago

I have 2 Manta cameras, G-507C and G-146C. According to the specs on their Web site they only support Mono8. Mono12, and Mono12Packed, so I cannot test the Mono14 mode.

thomascobb commented 2 years ago

We have the Manta G125B and G235B which don't seem to be 14-bit according to the website. I guess a previous firmware might have advertised 14-bit mode when it wasn't available?

hinxx commented 2 years ago

My Mako G-234B also supports only 8 and 12 bits. Fw version 00.01.54.18318.

MarkRivers commented 12 months ago

I think this was fixed by uncommenting that line, so I am closing this issue.