convert DICOM (>8bits grayscale) in JPG

  • Hello,
    I have 1 problem : In the dicom.ini i have :


    ExportConverters = 1
    ExportConverter0 = save jpg as c:\test\%b.jpg


    The conversion works but : black and white at the file. jpg are reversed and the quality is not good.
    If send a DICOM 8 bits : no problem for the jpg.


    How when DICOM images sent are greater than 8 bits (grayscale)?


    Tanks for your help.

  • Hi,


    save jpg as uses an automatic level and window setting and does not negate the image. Dor 16 bits images it uses:


    pixelvalue = 255 * (r - level + window/2) / window;


    where level and winow are passed. If you pass a suitable level and negative window the image quality should be better. E.g.,


    save jpg as file level 1000 window -1000


    If you need more advanced processing to determine level and window I suggest to write a small lua script.


    Marcel

  • Hi Marcel,


    Tanks for your help.


    I did the tests but it does not work.
    Can you show me where to put the command line : save jpg as file level 1000 window -1000 ?


    In "dicom.ini" file, is it here : exportconverter0 = save as jpg file level window 1000 -1000 ?


    This does not work the image quality is identical to the previous.


    I have a small level in programmation... :oops:


    Stéphane

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!