DICOM to jpg

  • Hi, as always, thanks for the great software that conquest is.


    Sometimes I have issues with window center and width when using the "save jpg to..." in dicom.ini


    How the center and width are defined in the resulting jpg? Is there any way to change or control that?


    Thanks

  • Hi, thanks for the nice words.


    by default level and window are computed from the min and max value in the image. If you look in extensions/browserdisplay.lua you see how it can be read from the image header and passed to the image creation, i.e. using the level and window clauses.


    Marcel


  • Thanks for the clarification.. I will have to sudy some lua to get to understand how to pass that..


    So to pass dicom tags 0029,1050 (window center) and 0028,1051 (window width) to save JPGs, the modifications should be done directly in browserdisplay.lua, as I understand

  • No,


    this script shows the capability of the command. You could call it as follows, for instance, for each incoming image:


    Code
    [lua]
    ImportConverter0=c=(Data.WindowCenter or 0) if c=='' then c=0 end;w=(Data.WindowWidth or 0) if w=='' then w=0 end;s=(Data.RescaleSlope or 1) if s=='' then s=1 end;i=(Data.RescaleIntercept or 0) if i=='' then i=0 end;if string.find(c,'%\\') then c=string.match(c, '(.-)\\') end;if string.find(w,'%\\') then w=string.match(w,'(.-)\\') end;w=tonumber(w)/tonumber(s); c=tonumber(c)/tonumber(s);Data:Script('save jpg level '..math.floor(c)..' window '..(math.ceil(w))..' size 1600 frame '..frame..' to '..Data.SOPInstanceUID..'.jpg')

Participate now!

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