wrong image format after converter or export

  • From extensions:


  • thank you Marcel.
    It looks to me this is lua.
    I've never used lua in the ini file


    this is what I use :
    ImportConverter = ifequal "%m","DX"; mkdir C:\Users\xxxx\Dropbox\xxxx\%VPatientName\%VStudyInstanceUID\; save jpg to C:\Users\xxxx\Dropbox\xxxx\%VPatientName\%VStudyInstanceUID\%V0010,0020-%V0008,0018.jpg

    I don't know how to add the level to it.

  • does it sounds good like this :

    ImportConverter4 = ifequal "%m","DX"; lua "process_us_images.lua"


    and a lua script :


    -- process_us_images.lua

    function mkdir(path)

    os.execute('mkdir "' .. path .. '"')

    end


    function convert_and_adjust_window_level(dicomPath, jpgPath, wc, ww)


    print("Converting and adjusting window level: ", dicomPath, jpgPath, wc, ww)

    end


    -- Main processing function

    function process_image(Data)

    local patientName = Data.PatientName

    local studyInstanceUID = Data.StudyInstanceUID

    local patientID = Data.PatientID

    local sopInstanceUID = Data.SOPInstanceUID


    local baseDir = 'C:\\Users\\xxxx\Dropbox\\xxxx\\'

    local dicomDir = baseDir .. patientName .. '\\' .. studyInstanceUID .. '\\'

    local jpgPath = dicomDir .. patientID .. '-' .. sopInstanceUID .. '.jpg'


    -- Ensure the directory exists

    mkdir(dicomDir)


    -- Example window level values, adjust as necessary

    local wc = 600

    local ww = 400


    -- Convert and apply window level

    convert_and_adjust_window_level(dicomPath, jpgPath, wc, ww)

    end


Participate now!

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