Wikipedia:Reference desk/Archives/Computing/2014 October 16

= October 16 =

How to open a file
I got sent a bunch of what are supposed to be images from a hospital (I believe that are a mix of x-rays, cat scans and photographs -- the mix of file sizes also makes me thins so, from 500 kb to 20 mb). They have no file extensions; they are just named similar to "I0000100". I am on a desktop mac (mac mini, 2.4 GHz Intel Core 2 Duo, 4GB 1067 MHz DDR3; OSX Build 13F34). When I look in Finder it says for each under Kind: "Unix Executable File". When I double click terminal opens up and gives me a message box which I can't repeat because it contains private information but it says in part that it is indeed an "IMAGE" and at the end "cannot execute binary file", "logout", "[Process completed]" I tried dragging them into Adobe and Preview but that did not work. Any advice?--71.167.166.18 (talk) 16:21, 16 October 2014 (UTC)


 * The obvious thing is to ask the hospital what format they are. Also, do other files on your Mac list the file extensions ?  If not, then you may have to turn that option on.  And finally, if you have no other method, you can try changing the file name to every graphics file extension type you can think of and then try to open those.  With any luck you will hit on the right one.  Of course, it's also possible they are in some proprietary format that only the hospital can view, or perhaps a format only Windows or Linux can open, like a Windows Media File. StuRat (talk) 16:33, 16 October 2014 (UTC)


 * Open the OS-X terminal and cd to the directory where you've saved these files. Type file * and for each file it will try to figure out the file's type based on its contents (see file (command) for an explanation). If it just says "data", that means it doesn't know what the files are, and something may have gone wrong somewhere. -- Finlay McWalterᚠTalk 16:48, 16 October 2014 (UTC)


 * (I thought of that - but I think 'file' says the exact same thing as 'finder'....I believe they use the same algorithm and the same database of file types.) SteveBaker (talk) 16:55, 16 October 2014 (UTC)


 * If they really are "Unix executable" then you're going to need to find an appropriate Unix machine to run them on...that might be exceedingly difficult.  However 'finder' (and the 'file' command-line tool that uses the same mechanism) can easily fail to categorize very obscure file types - and when that happens, it often tries to guess - and produces the wrong answer as a result.   That's almost certainly what's going on here.   But if the format is that obscure, then it's very likely that you need a specialist application to open them anyway.  I agree with StuRat - you're going to need to ask the person who sent you the files.


 * I suppose that one last-ditch thing would be to open up a command-line window on your Mac and run the "strings" program on each of the files in turn...probably like this:

strings L0000100 | more


 * ...this will extract any human-readable ASCII information from within the file.  So, for example, when I run 'strings' on a truetype font file, then buried within 50 lines of garbage, I see "Created by MyScriptFont.comMediumFontForge 2.0"...which tells me that maybe Googling for that program might get me someplace.   But this is a real long-shot.


 * SteveBaker (talk) 16:55, 16 October 2014 (UTC)


 * OSX Finder says "Unix executable" for many things that are not. I doubt a hospital would send executables for that kind of data. If the other suggestions here don't work, I would try copying file1>file1.png, file1.tiff, file1.RAW, and then seeing if your image viewer apps can display them. I picked those formats because they are fairly common in scientific settings, but of course you can also try other popular Image_file_formats such as .jpeg, .gif, etc. SemanticMantis (talk) 17:14, 16 October 2014 (UTC)


 * Threads like this lead me to believe that the Finder reports anything with the x (execute) permission as a "Unix executable", regardless of the contents. I would definitely run file on these files. The format may be DICOM. -- BenRG (talk) 17:43, 16 October 2014 (UTC)
 * Yeah - I'd bet on them being DICOM too. There is a freeware DICOM viewer called "EMV" that you might want to check out.   I'm sure there are others out there.  SteveBaker (talk) 20:46, 16 October 2014 (UTC)
 * A lot of advice! Thanks. I will try out some of them tomorrow (can't today).--71.167.166.18 (talk) 20:55, 16 October 2014 (UTC)


 * I can't speak for the file magic database on OS-X, but its Linux equivalent does have magic patterns for DICOM files, identifying them as "DICOM medical imaging data" - so it should be able to successfully distinguish DICOMs from generic "data". -- Finlay McWalterᚠTalk 13:18, 17 October 2014 (UTC)