Problem written bigendian mammo images

  • Hi Marcel,


    I just found this:


    Jean-Christophe

  • Her is the complet header dump:


    Jean-Christophe

  • I think it works partialy,the first US is changed:

    Code
    (0028,0002) US 1 # 2 SamplesPerPixel(0028,0004) CS [MONOCHROME1 ] # 12 PhotometricInterpretation(0028,0010) US 2294 # 2 Rows(0028,0011) US 1914 # 2 Columns(0028,0100) US 16 # 2 BitsAllocated(0028,0101) US 14 # 2 BitsStored(0028,0102) US 13 # 2 HighBit(0028,0103) US 0 # 2 PixelRepresentation


    but the others,at the end,not:


    Jean-Christophe

  • Correction: it does not correct the iconimage. You would need separate converters for that, e.g.,


    ImportConverter16 = Data.IconImage[1].HighBit = swab(Data.IconImage[1].HighBit)
    etc


    So this is easy to fix.


    Next, also the pixel data needs to be swabbed.


    ImportConverter18 = for i=0, Data.Rows-1 do local a=Data:GetRow(i) for j=0,Data.Columns-1 do a[j]=swab(a[j]) end Data:SetRow(i, 0, a) end


    Marcel

  • Hi Marcel,


    Data.IconImage[1] don't works,I change it to:
    Data.IconImageSequence


    So the end of my dicom.ini is:


    Code
    [lua]ImportConverter0 = function swab(a) return math.floor(a/256)+256*(a%256) endImportConverter1 = Data.SamplesPerPixel = swab(Data.SamplesPerPixel)ImportConverter2 = Data.Rows = swab(Data.Rows)ImportConverter3 = Data.Columns = swab(Data.Columns)ImportConverter4 = Data.BitsAllocated = swab(Data.BitsAllocated)ImportConverter5 = Data.BitsStored = swab(Data.BitsStored)ImportConverter6 = Data.HighBit = swab(Data.HighBit)ImportConverter7 = Data.PixelRepresentation = swab(Data.PixelRepresentation)ImportConverter11 = Data.IconImageSequence.SamplesPerPixel = swab(Data.IconImageSequence.SamplesPerPixel)ImportConverter12 = Data.IconImageSequence.Rows = swab(Data.IconImageSequence.Rows)ImportConverter13 = Data.IconImageSequence.Columns = swab(Data.IconImageSequence.Columns)ImportConverter14 = Data.IconImageSequence.BitsAllocated = swab(Data.IconImageSequence.BitsAllocated)ImportConverter15 = Data.IconImageSequence.BitsStored = swab(Data.IconImageSequence.BitsStored)ImportConverter16 = Data.IconImageSequence.HighBit = swab(Data.IconImageSequence.HighBit)ImportConverter17 = Data.IconImageSequence.PixelRepresentation = swab(Data.IconImageSequence.PixelRepresentation)ImportConverter18 = for i=0, Data.Rows-1 do local a=Data:GetRow(i) for j=0,Data.Columns-1 do a[j]=swab(a[j]) end Data:SetRow(i, 0, a) end


    I use a batch file to modify explictbigendian to explictlittlendian in each dicom files(in the folder c:\image) and then copy the images in the incoming folder from conquest:

    Code
    @echo off
    dir c:\gsar121\image /A /B /O:GEN > c:\gsar121\filelist.txt
    for /f %%a in (filelist.txt) do call :Commande %%a
    xcopy c:\image "D:\dicomserver1417d\data\incoming" /E /R /C /I /Y /H /G
    :Commande
    C:\gsar121\gsar.exe -s1.2.840.10008.1.2.2 -r1.2.840.10008.1.2.1 -o "C:\gsar121\image\%1"


    I just tried with some files and it works!


    Thanks for your help,Marcel!

  • Summary after looking at some logs:


    Accepted transfer syntax is 1.2.2 BigEndianExplicit, Values like rows are wrongly writen to the database.


    Thus errors are:
    data not swapped on reading but still interpreted like LittleEndian
    transfer syntax not set to 1.2.1
    writing 1.2.2 seems to swap elements, but not VR lengths


    These bugs show that it is essential to keep BigEndianExplicit disabled in dgatesop.lst


    Marcel

Participate now!

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