N/A in #im while querying in Osirix

  • Hello im using
    DICOM server 'RCPACS-POZ01' (version 1.4.16, port 4006, bits 64) was started on Tue May 14 03:30:01 2013
    Old JPEG decoder=0, JPEGLIB jpeg codec=1, LIBJASPER jpeg2000 codec=1
    Run time (s) total 577, query 0, load 2, save 2, compress 17, process 0, gpps 0
    Associations=3102; Threads=2740 (1 open); Images sent=323, recieved=383, forwarded=383
    Images printed=0, in color=0
    Activity: Echo:0, Find:2701, Move:18, Unknown:0, gpps:489602
    Images (de)compressed: NKI 1077, JPEG 0, JPEG2000 0, RLE 0, Planes removed 0, Palettes removed 0, Downsize 0
    Space on MAG0 : 1210219 MByte
    Database type: native MySQL connection
    on linux


    while im querying database i cant get numbers of stored images, im only gets n/a note in proper col.


    can u help me with it?


    Marcin

  • YEP that's exactly what i've done...
    Maybe you'll consider control of acrnema.map file with use of database some like:


    when ull use conquest-start file:


    (just create web part to change rows in database)



    (.....)
    init_delay = 0
    if ENV['opts'].assoc:
    # just reload the acrnema.map
    cmd.append("--read_amap:")
    pidfile = '/dev/null'
    init_delay = 0
    pidfile = open(pidfile, 'w')

    # start the instances
    retval = 0
    for instance in ENV['instances']:
    try:
    inst_dir = "%s/%s" % (CONFDIR, instance)
    os.chdir(inst_dir)
    _null = open("%s/dgate.log" % inst_dir, "a")
    cmd2 = ["sudo","-u","root","%s/acrnema" % inst_dir]
    k = Popen(cmd2, stdout=_null, stderr=STDOUT)
    d = Popen(cmd, stdout=_null, stderr=STDOUT)
    time.sleep(init_delay)
    if d.returncode:
    (.....)


    dicom.ini


    (.....)
    # Names of the database tables
    PatientTableName = DICOMPatients
    StudyTableName = DICOMStudies
    SeriesTableName = DICOMSeries
    ImageTableName = DICOMImages
    DMarkTableName = DICOMAccessUpdates
    RegisteredMOPDeviceTable = RegisteredMOPIDs
    UIDToMOPIDTable = UIDToMOPID
    UIDToCDRIDTable = UIDToCDRID
    AETableName = DICOMAeList
    (....)



    some uncompiled file
    Ive got already compiled file acrnema (if You want it jus ask)


    [root@alfa c_progs]# cat acrnema.cpp
    #include <stdio.h>
    #include <my_global.h>
    #include <mysql.h>
    #include <libini.h>
    #include <iostream>
    #include <fstream>
    #include "simpleini.h"
    using namespace std;
    int main() {
    MYSQL *conn;
    MYSQL_RES *result;
    MYSQL_ROW row;
    int num_fields;
    int i, errorcheck;


    CSimpleIniA ini;
    ini.SetUnicode();
    ini.LoadFile("dicom.ini");
    const char * serwer = ini.GetValue("sscscp", "SQLHost", "default");
    const char * base = ini.GetValue("sscscp", "SQLServer", "default");
    const char * user = ini.GetValue("sscscp", "Username", "default");
    const char * pass = ini.GetValue("sscscp", "Password", "default");
    const char * name = ini.GetValue("sscscp", "AETableName", "default");
    const char * n;
    string w;
    w="SELECT * FROM ";
    w.append(name);
    n=w.c_str();
    conn = mysql_init(NULL);
    ofstream myfile ("acrnema.map", ios::out);
    if (conn == NULL) {
    printf("Error %u: %s\n", mysql_errno(conn), mysql_error(conn));
    exit(1);
    }


    !mysql_real_connect(conn, serwer, user, pass, base, 0, NULL, 0);
    if (conn == NULL)
    {
    printf("Error %u: %s\n", mysql_errno(conn), mysql_error(conn));
    exit(1);
    }


    mysql_query(conn,n);
    result = mysql_store_result(conn);


    num_fields = mysql_num_fields(result);
    while ((row = mysql_fetch_row(result)))
    {
    for(i = 0; i < num_fields; i++)
    {
    myfile << row[i];
    myfile << " ";
    }
    myfile << "\n";
    }


    mysql_free_result(result);


    mysql_close(conn);


    myfile.close();
    return 0;
    }



    and database:
    DROP TABLE IF EXISTS `DICOMAeList`;
    /*!40101 SET @saved_cs_client = @@character_set_client */;
    /*!40101 SET character_set_client = utf8 */;
    CREATE TABLE `DICOMAeList` (
    `AETitle` varchar(30) NOT NULL,
    `IP_Host` varchar(45) NOT NULL,
    `Port` int(4) NOT NULL,
    `Compress` varchar(2) NOT NULL,
    PRIMARY KEY (`AETitle`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    /*!40101 SET character_set_client = @saved_cs_client */;


    --
    -- Dumping data for table `DICOMAeList`
    --


    LOCK TABLES `DICOMAeList` WRITE;
    /*!40000 ALTER TABLE `DICOMAeList` DISABLE KEYS */;
    INSERT INTO `DICOMAeList` VALUES ('Divinus','192.168.0.95',4096,'ul'));
    /*!40000 ALTER TABLE `DICOMAeList` ENABLE KEYS */;
    UNLOCK TABLES;

  • U can control system without access to server. To change acrnema You can use your browser what's easier for average users. Only after change u have to reload dgate to load new values.
    This before was only example... structure of database can be modify.
    the same with routing... configuration by web will be easier than wrote all sentences in file...


    that's my opinion :)


    best regards


    Marcin

  • Hi Marcin,


    this is true, although scripts in the conquest web interface can do all these things as well, there are commands to change acrnema.map (and lots of other settings) in file and memory. I just had not come around to implementing a web page to support this. With Lua scripting anybody can - in principle - write such pages without changing server code.


    The problem with your change is that it breaks the interface to the windows GUI so I am not inclined to include it. But I appreciate you offering these changes.


    Regards,


    Marcel

  • I couldn't find any manual describing all functions of conquest web interface thats why i started to write my own scripts.
    Can U send me on marcin@divnet.pl full manual of it or some files. thats will be helpfull with writing web (maybe php) system to controle conquest dicom server


    regards


    Marcin

  • Hi


    The commands are accessible with dgate --, e.g., dgate --put_amap:N,AE,PORT,COMP. These are briefly documented in the manual.


    Documentation is sparse but samples of lua scripts generating web pages can be found on the forum. In lua, dgate -- commands are accessible as well.


    This is a sample:


    Code
    local i
    for i=0,100 do
    local AE,IP,P,C = get_amap(i)
    if AE==nil then break end
    print('testing AEs', i, AE, IP, P, C)
    if Association.Calling==AE and Association.ConnectedIP~=IP then
    print('changing AE to:', i, AE, Association.ConnectedIP, P, C)
    servercommand('put_amap:'..i..','..AE..','..Association.ConnectedIP..','..P..','..C)
    end
    end


    Marcel

Participate now!

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