Skip to content

karolvegso/Read_Pilatus100K_Image_C_sharp_ConsoleApp

Repository files navigation

Read_Pilatus100K_Image_C_sharp_ConsoleApp

This experimental C# code opens image taken with Pilatus100K detector.

The openning of image from Pilatus detector is demonstrated for detector Pilatus 100K, for which the size of the image is 487 x 195 pixels (Horizontal x Vertical). The size of the image in C# program are set as constant integers. The number of pixels is 487 x 195 = 94965 pixels. However, in each pixel is stored intensity encoded in 4 bytes. The path to image is written in the line 20. The image file is open in the line 21. The binary image data are read in the line 25. However, the image file header composed of 4096 bytes is skipped in the line 24. The array with the name pixel_array is filled for each pixel with 4 numbers representing bytes. The array with the name pixel_array_flipped is only used to change the order of the bytes. The first byte in the pixel_array_flipped is converted into the binary string. The second byte in the pixel_array_flipped is converted into the binary string. The third byte in the pixel_array_flipped is converted into the binary string. The fourth byte in the pixel_array_flipped is converted into the binary string. The converted first, second, third, fourth bytes into the binary strings are stored in the array with name binnary_array. The binary strings for first, second, third, fourth bytes are concatenated into the single string in the array with name binary_array_dense. The binary strings for each pixel are converted from sequence of binary chars (0 or 1) to intensity values. Please see array with the name intensity_array. The intensity values for all pixels are finally written into the text file. This C# experimental code shows how to open tif binary file from Pilatus detector. You can use this file in your project.

About

This experimental C# code opens image taken with Pilatus100K detector.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages