Can we apply the code for the file of
vinguyen3685 opened this issue · 2 comments
Hi,
First of all, I would like to thank you so much for sharing your interesting code. I downloaded the code and try to run with your input file '.raw' containing CT images and I worked very well.
However, I just have the binary data to present the porous medium domain. Can your code be applied for such .dat input file?
I am looking forward to hearing from you soon.
Thanks and best regards!
Vi
Thanks Vi for your kind words. Yes, by default the code assumes .dat files are in ASCII (text) format. If your data are not in ASCII, then you can either (a) rename the file suffix into .raw, or (b) in the top of your IMAGE.mhd file add a keyword: BinaryData = True
so that the code treats the image data format as raw/binary. Make sure the code reports the right value for porosity (void fraction) if in doubt what is inside your .dat file.
FYI, binary data can be saved in both binary/raw or ascii/text format. In Windows Powershell, you can run gc IMAGE.dat -head 10
and if the data format is ASCII they will be printed as human readable, otherwise you will get weird characters. In Linux the equivalent command is head IMAGE.dat
.
Ali
Thank you so much for your kind support. I will follow your advice.
Regards!
Vi