Type of ImageNumbe in DICOMImages table

  • Hi,
    Type of ImageNumbe in DICOMImages table is VARCHAR,
    for this reason in the MySQL is a problem with sorting images (1, 10, 100, 101, ..., 2, 20, 21, ..., 3, ...).
    I change the type manually on INT and now sorting is (1, 2, 3, 4, ...).
    Whether this type should not be the default?
    Whether there are cases in which this value is not a number?


    ps. correct sorting is needed in my php script

  • Hi,


    changing database fields sounds very scary to me (fully untested), maybe better use something like:


    ImageQuerySortOrder = CAST(DICOMImages.ImageNumbe AS UNSIGNED)


    in dicom.ini. Note that you have to download a patch like 1.4.15c to be able to use this.


    Marcel

  • my php script does not process the data from ./dgate, I think that changing the settings on dicom.ini will not help me, the script processes the data stored in the database.
    I wonder if such a change fields may affect the DICOM client's work?

  • Hi,


    I see. Well you can just try it out of course. Keep me posted of any issues you find. It may be that the database performs the correct translation from string to integer on insert and select statements, but I would be very suprised if access to the server (query results) would still work. The code expects string results to be read back everywhere, and that may not be easy to change.


    Marcel

  • little workaround without changing field type in db:

    Code
    $sql = $db->Execute("SELECT SOPInstanc, ImageNumbe FROM DICOMImages WHERE SeriesInst = '".$_GET[series]."'");
    while ($i = $sql->FetchRow()) {
    $ct[$i[ImageNumbe]] = $i[SOPInstanc];
    }
    ksort($ct);
    print_r($ct);


    Array
    (
    [1] => 1.2.840.113619.2.55.3.279708285.98.1246942308.103.1
    [2] => 1.2.840.113619.2.55.3.279708285.98.1246942308.103.2
    [3] => 1.2.840.113619.2.55.3.279708285.98.1246942308.103.3
    [4] => 1.2.840.113619.2.55.3.279708285.98.1246942308.103.4
    [5] => 1.2.840.113619.2.55.3.279708285.98.1246942308.107.5
    [6] => 1.2.840.113619.2.55.3.279708285.98.1246942308.107.6
    [7] => 1.2.840.113619.2.55.3.279708285.98.1246942308.107.7
    [8] => 1.2.840.113619.2.55.3.279708285.98.1246942308.107.8
    [9] => 1.2.840.113619.2.55.3.279708285.98.1246942308.111.9
    [10] => 1.2.840.113619.2.55.3.279708285.98.1246942308.111.10
    [11] => 1.2.840.113619.2.55.3.279708285.98.1246942308.111.11
    [12] => 1.2.840.113619.2.55.3.279708285.98.1246942308.111.12
    [13] => 1.2.840.113619.2.55.3.279708285.98.1246942308.115.13
    [14] => 1.2.840.113619.2.55.3.279708285.98.1246942308.115.14
    [15] => 1.2.840.113619.2.55.3.279708285.98.1246942308.115.15
    [16] => 1.2.840.113619.2.55.3.279708285.98.1246942308.115.16
    [17] => 1.2.840.113619.2.55.3.279708285.98.1246942308.119.17
    [18] => 1.2.840.113619.2.55.3.279708285.98.1246942308.119.18
    [19] => 1.2.840.113619.2.55.3.279708285.98.1246942308.119.19
    [20] => 1.2.840.113619.2.55.3.279708285.98.1246942308.119.20
    [21] => 1.2.840.113619.2.55.3.279708285.98.1246942308.123.21
    [22] => 1.2.840.113619.2.55.3.279708285.98.1246942308.123.22
    [23] => 1.2.840.113619.2.55.3.279708285.98.1246942308.123.23
    [24] => 1.2.840.113619.2.55.3.279708285.98.1246942308.123.24
    [25] => 1.2.840.113619.2.55.3.279708285.98.1246942308.127.25
    [26] => 1.2.840.113619.2.55.3.279708285.98.1246942308.127.26
    [27] => 1.2.840.113619.2.55.3.279708285.98.1246942308.127.27
    [28] => 1.2.840.113619.2.55.3.279708285.98.1246942308.127.28
    [29] => 1.2.840.113619.2.55.3.279708285.98.1246942308.131.29
    [30] => 1.2.840.113619.2.55.3.279708285.98.1246942308.131.30
    [31] => 1.2.840.113619.2.55.3.279708285.98.1246942308.131.31
    [32] => 1.2.840.113619.2.55.3.279708285.98.1246942308.131.32
    [33] => 1.2.840.113619.2.55.3.279708285.98.1246942308.135.33
    [34] => 1.2.840.113619.2.55.3.279708285.98.1246942308.135.34
    [35] => 1.2.840.113619.2.55.3.279708285.98.1246942308.135.35
    [36] => 1.2.840.113619.2.55.3.279708285.98.1246942308.135.36
    [37] => 1.2.840.113619.2.55.3.279708285.98.1246942308.139.37
    [38] => 1.2.840.113619.2.55.3.279708285.98.1246942308.139.38
    [39] => 1.2.840.113619.2.55.3.279708285.98.1246942308.139.39
    [40] => 1.2.840.113619.2.55.3.279708285.98.1246942308.139.40
    [41] => 1.2.840.113619.2.55.3.279708285.98.1246942308.143.41
    [42] => 1.2.840.113619.2.55.3.279708285.98.1246942308.143.42
    [43] => 1.2.840.113619.2.55.3.279708285.98.1246942308.143.43
    [44] => 1.2.840.113619.2.55.3.279708285.98.1246942308.143.44
    )


    ps. example, using the ADODB library

Participate now!

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