4/7/2024 0 Comments Dicom image converter![]() The code is as follows: public static void ImportImage(string file) If you use the lines annotated in the above code, the generated DICOM file image is a gray image (black-and-white image). Why is the application data 3 times the product of the width and height of the image? This is because R, G and B each account for one Byte. The code is as follows: public static byte GetPixels(Bitmap bitmap)īyte bytes = new byte You only need to reverse rows of BMP images, and columns do not need to reverse.įortunately, Microsoft's C# gives us a better class library called the Bitmap class, which can be used without the need for this inversion.įirst, get the image data area from the BMP diagram. So if you parse the BMP file directly, remember to invert the data area, otherwise the image you see when you generate DICOM is inverted. BMP files are displayed from the bottom left, while DICOM images are displayed from the top left. It's a big head.įirst, look at the BMP file format. Du Niang for a long time, but also in CSDN and other forums to see some intermittent documents, the most important thing is that the code is only fragments, not a complete implementation. Recently, the problem of conversion between DICOM and BMP files has been studied.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |