Getting DICOM images out of software encapsulation?

Discussion in 'Computing and Networks' started by allisonr, Aug 16, 2016.

  1. allisonr

    Thread Starter New Member

    Aug 16, 2016
    I've been using NX Viewer to view radiographs, however I also wanted to export them without having to burn CDs and send them to 3rd party archives, so I took note on where files were being stored and copied them.

    Their size should be appropriate, however they have an odd extension (not .dcm nor .dicom) and even those that have a proper .dicom extension, can't be opened by various dicom viewers.

    I've loaded one into an hex editor and apparently there's some sort of encapsulation. Is there any way to get rid of this and view pictures on computer?

    Thank you very much

    Allison R

  2. MrSoftware

    Senior Member

    Oct 29, 2013
    I'm not familiar with DICOM data so I can't tell what's the good data in your screen shot, but in general you need to figure out if your data just has something extra at the start and maybe the end, or if it's encoded or encrypted. If it really is as simple as some extra data at the start and/or end, then first figure out how to tell where the good data starts. Is it a fixed amount of extra data at the start/end? Or is it variable in size. Once you have that figured out, use your favorite language to write a little program that skips the undesirable data and copies the good data into a new file. Or use something like "dd" on the command line to do the same. If programming or shell scripting isn't your thing, just google binary copy specific bytes using dd.

    Or if you're looking for jpeg data inside the file, just scan the data looking for start of data and end of data markers. More info on that here: