jantograaf Posted October 1, 2019 Posted October 1, 2019 I'm trying, preferably using AutoIt, to convert RAW pixel data from one format to another. And I need help detecting what formats they actually are, because I'm at the end of my wits here... Brief explanation: I have an XML-file with RAW Pixel Data included therein as an element (sourced from a Dicom-file). The pixeldata looks something like this: <element tag="7fe0,0010" vr="OW" vm="1" len="5898240" name="PixelData" binary="yes">0e07\0dc7\0dfd\0e03\0e2f\0e15\0dfe\0e12\0e0f\0db0\0dc8\0e03\0e4a\0dce\0e4f\0e23\0dd4\0e0a\0dcc\0e19\0e56\0e20\0df8\0dd8\0e29\0de1\0deb\0e23\0e3a\0dce\0e05\0e09\0df1\0e3c\0e31\0df5\0e38\0e88\0e75\0de7\0e1d\0e1e\0e19\0e03\0e03\0e25\0e60\0e26\0e83\0e00\0e14\0e07\0e39\0e17\0e4c\0e67\0e3b\0dab\0e11\0dda\0e39\0dde\0df9\0dd8\0ee4\0e82\0e44\0e17\0e77\0e0f\0e37\0e64\0e36\0e39\0e1c\0e4a\0e5f\0dfb\0e1d\0e11\0e0e\0e48\0e64\0e35\0e65\0e5e\0e00\0e35\0e49\0e5f\0e3a\0dcb\0e23\0e34\0e27\0e1f\0e14\0e1d\0e4a\0e4c\0de6\0df2\0e5b\0e42\0e35\0e5a\0e47\0e43\0dd8\0e09\0e72\0e25\0ddd\0e12\0ec8\0e03\0e6a\0e1b\0e1a\0e27\0e08\0de8\0e0f\0e0f\0e5a\0e16\0de0\0dd3\0e5a\0dfb\0e5a\0e4d\0e1e\0e15\0e16\0e6c\0eb0\0e5b\0e6d\0e2d\0ddb\0e3c\0e6a\0e02\0e64\0e5a\0e12\0ddd\0ea8\0e27\0e5c\0df2\0e1a\0e22\0df1\0e97\0e03\0deb\0e05\0e22\0eb2\0e26\0e57\0e86\0e8e\0e3e\0e88\0e54\0e3b\0e3c\0e4b\0e65\0e12\0e21\0de6\0db9\0e63\0ea4\0e66\0e54\0ea1\0e36\0e39\0e61\0e69\0e35\0e8c\0e65\0e45\0e7d\0e5f\0e67\0e67\0e7c\0ed5\0e46\0e2d\0e24\0dcc\0dfd\0e70\0e36\0e33\0e51\0def\0e36\0e4d\0e3a\0e52\0e5e\0e80\0e2e\0ead\0e95\0ef5\0e6e\0e80\0e66\0e80\0dc5\0e14\0e8d\0e7c\0e4d\0e58\0e29\0e31\0e29\0ea3\0e51\0e9c\0e7b\0e11\0e59\0e05\0e10\0e98\0e13\0e48\0e74\0e53\0e47\0e71\0dfb\0e0c\0e92\0e96\0ed8\0e8b\0e48\0e27\0e28\0e32\0e26\0e5e\0ea7\0ec8\0e4d\0e07\0e37\0e31\0e39\0e3b\0e4b\0e5c\0e36\0e88\0e42\0e91\0eb0\0e64\0e2c\0dc1\0ddf\0e85\0f0c\0ea7\0e44\0e29\0e3b\0e9c\0e95\0eab\0e88\0e47\0dd2\0e41\0e28\0e4f\0e73\0ea1\0e90\0e77 ... </element> I'm trying to replace the RAW Pixel Data by data from another file, but the encoding looks different. I can open this RAW file in ImageJ as a 16Bit Unsigned Little Endian RAW File, but I think I need to reencode this to work inside the XML container (to be able to convert it back to a working DCM-image). The contents of the other raw file show like this: =;4;<;-;=;;;5;5;4;0;3;+;G;.;F;9;@;9;/;:;?;0;>;:;A;@;A;C;8;6;;;/;9;6;5;1;<;4;E;8;8;*;6;9;9;.;>;.;:;.;2;5;?;/;3;6;6;0;2;1;@;1;8;/;7;+;0;.;4;/;4;7;8;*;;;/;1;5;3;*;,;-;3;';6;.;6;1;-;,;8;0;6;/;<;4;8;,;-;';6;-;;;);6;+;/;.;+;7;2;/;1;0;4;-;5;,;2;$;.;-;<;/;.;!;(;";,;*;2;;,;(;$;';&;+;3;#;+;&;3;;$;!;.;#;#;";(;);3;#;:;%;*;*;,;;);!;!;);(;";(;;#;!;2;&;.;!;+;#;*;(;;; ;;#; ;&;;%;;0;;";;;;;;&;;#;;;;;;;;;;;;;;;;;;; Does anyone have any clue how to convert the second format to the first one? I've tried converting every single character to its UTF-16LE equivalent, but to no avail. If anyone has any idea, I'd be glad to hear it 🙂 Thanks in advance! Jan
cbruce Posted December 1, 2019 Posted December 1, 2019 @jantograaf, you have *no* idea... [smile] As Wikipedia says... Quote Standardization Providing a detailed and concise description of the content of raw files is highly problematic. There is no single raw format; formats can be similar or radically different. Different manufacturers use their own proprietary and typically undocumented formats, which are collectively known as raw format. Often they also change the format from one camera model to the next. Several major camera manufacturers, including Nikon, Canon and Sony, encrypt portions of the file in an attempt to prevent third-party tools from accessing them. The only help I can offer is to check out the source code in the old dcraw program. The lib still gets code updates sometimes, but I don't think anyone is currently adding new raw formats. CBruce
Comatose Posted February 21, 2020 Posted February 21, 2020 Just a blind stab at this ... If you can make a picture out of the raw data at that point you should be able just to save it with the appropriate extension and AutoIt will do the rest. I may be wrong here but, I know if I load up a .bmp or any picture and save it as say a .png ... AutoIt creates the .png in the proper format.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now