# MetaData from a Dalsa Nano

**URL:** <https://forum.commonvisionblox.com/t/metadata-from-a-dalsa-nano/810>\
**Category:** .Net API\
**Created:** [June 11, 2019, 1:48pm UTC](https://forum.commonvisionblox.com/t/metadata-from-a-dalsa-nano/810 "2019-06-11T13:48:26Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Ben](https://avatars.discourse-cdn.com/v4/letter/b/df788c/32.png) [@Ben](https://forum.commonvisionblox.com/u/Ben)\
**Post date:** [June 14, 2019, 1:32pm UTC](https://forum.commonvisionblox.com/t/metadata-from-a-dalsa-nano/810/7 "2019-06-14T13:32:41Z")

</div>

OK, a few pointers for any other poor mortal who bites of more than they can chew.

- Do I have to use DeviceImage, or can I use StreamImage?  
This question related to the code [here](https://forum.commonvisionblox.com/t/using-chunk-mode-data-with-cvb-net/333) which uses DeviceImage. Given that the only ‘added value’ of DeviceImage is that it contains a reference to Device, I refactored the three classes from github, which ends up meaning that the signature of GetChunk is `GetChunk(Image image, Device device)`.

- Do I really have to set PixelFormat to Raw to get the metadata?  
It doesn’t look like it.

- Could someone point me towards documents which could at least give me the memory layout, offsets etc.?  
I didn’t find any documents, but I’ve managed to get this far (as it’s all I need):

For the rest

```
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct NanoInfoChunk
{
    public const uint ID = 0xCD000001;

    public long Dummy;
    public long ChunkExposureTime;
    public long ChunkCyclingPresetCurrentActiveSet;
}

```

If you want to work on the rest, you can add the three middle lines to DeferenceNanoInfoOn (still inspired from the code posted on the other topic):

```
private static unsafe NanoInfoChunk DereferenceNanoInfoOn(Image image, GevChunk chunk)
{
    var chunkPtr = new IntPtr(image.GetBufferBasePtr().ToInt64() + chunk.Offset);
    byte[] bytes = new byte[chunk.Length];
    Marshal.Copy(chunkPtr, bytes, 0, (int)chunk.Length);
    System.Diagnostics.Debug.WriteLine(BitConverter.ToString(bytes));
    return *(NanoInfoChunk*)chunkPtr;
}
```

---

_[View the full topic](https://forum.commonvisionblox.com/t/metadata-from-a-dalsa-nano/810)._
