Do the dcmqrscp can be competent as a good database?

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
kamil
Posts: 63
Joined: Fri, 2009-04-17, 09:18

Do the dcmqrscp can be competent as a good database?

#1 Post by kamil »

Or can be enhance it to a good database?
And I want to know the efficency of using findscu to query message from dcmqrscp.

Thank you very much!

Michael Onken
DCMTK Developer
Posts: 2052
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#2 Post by Michael Onken »

Hi Kamil,

dcmqrdb only uses an index file to manage DICOM studies/series/images in the archive. Since the index file is just searche from start to end for an incoming request, I expect the performance being a littlebit worse than a database in the very beginning but extremely worse compared to a DB if you have more than a few dozens of studies.

We have heard of people using dcmqrdb also for larger scale projects with thousands of studies. If the index file can be kept in memory, the performance is maybe somehow ok. But if the server starts swapping and re-reading from hard disk it becomes really slow. Please also note that you have to change some constants in dcmqrdb's code if you want it to accept more than a few hundred images. Search the forum for this; e. g. you will find this posting.

findscu should perform pretty good, it is quite a simple program and does not do much unnecessary stuff, I think ;)

Best regards,
Michael

kamil
Posts: 63
Joined: Fri, 2009-04-17, 09:18

#3 Post by kamil »

Michael Onken wrote:Hi Kamil,

dcmqrdb only uses an index file to manage DICOM studies/series/images in the archive. Since the index file is just searche from start to end for an incoming request, I expect the performance being a littlebit worse than a database in the very beginning but extremely worse compared to a DB if you have more than a few dozens of studies.

We have heard of people using dcmqrdb also for larger scale projects with thousands of studies. If the index file can be kept in memory, the performance is maybe somehow ok. But if the server starts swapping and re-reading from hard disk it becomes really slow. Please also note that you have to change some constants in dcmqrdb's code if you want it to accept more than a few hundred images. Search the forum for this; e. g. you will find this posting.

findscu should perform pretty good, it is quite a simple program and does not do much unnecessary stuff, I think ;)

Best regards,
Michael
If I want to establish a high performance DB as a achiving server, how can I use dcmtk to do this? May I enchance the dcmqrscp(using dcmtk's other functions)? Or create a new way of achiving?Or as you say, keep the index file in the memroy?

Thanks,
Kamil

Michael Onken
DCMTK Developer
Posts: 2052
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#4 Post by Michael Onken »

Hi,

if would extend dcmqrdb to use a "real" database like MySQL, Postgres or if you want a slim variant, SQLite. If you dig into dcmqrdb's source code, you will find an abstract interface for a data source that is currently only implemented for the index file. You should write an implementation for SQL, then.

Another possibility is just to use an existing Open Source PACS. For example, look on the Internet for Conquest PACSor dcm4che

2TAKTER
Posts: 4
Joined: Fri, 2010-03-05, 09:18

#5 Post by 2TAKTER »

can you specify where exactly in the code I have to search?
a kind of ODBC connection would be great here

i've found the handle assoc for the index.dat in dcmqrdbi.cxx class DcmQueryRetrieveIndexDatabaseHandleFactory

the dcmqrscp.cxx contains the following lines:

Code: Select all

#ifdef WITH_SQL_DATABASE
    // use SQL database
    DcmQueryRetrieveSQLDatabaseHandleFactory factory;
#else
    // use linear index database (index.dat)
    DcmQueryRetrieveIndexDatabaseHandleFactory factory(&config);
#endif
but the class DcmQueryRetrieveSQLDatabaseHandleFactory is not used anywhere right?

Michael Onken
DCMTK Developer
Posts: 2052
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#6 Post by Michael Onken »

Hi,

No, someone at OFFIS started an implementation of a database backend, that's why you find this #define in the code. So it's clear that you should start your own implementation by implementing the abstract base classes existing, e. g. implement a DcmQueryRetrieveIndexDatabaseHandleFactory or whatever you call it to replace the file-based DcmQueryRetrieveIndexDatabaseHandleFactory. Same do for the other file-based classes.

Good luck :)
Michael

2TAKTER
Posts: 4
Joined: Fri, 2010-03-05, 09:18

#7 Post by 2TAKTER »

horray :P
so ok, i didn't worked with C since 2003 so it's time to clean up that dusted part in my head. hope i make some progress there and can give some input or a finished source back for the project.

are you still working on the dcmtk?

Michael Onken
DCMTK Developer
Posts: 2052
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#8 Post by Michael Onken »

Yes of course we still work on DCMTK :-) Code is added if we have some spare time or companies order some extensions for that. Also, we have students with their diploma thesis or sometimes phds working on DCMTK. You can download the current development versions (pretty stable!) also from the DCMTK download page (look for "snapshot"). Hope you find some C/++ left under the dust hood,

Michael

2TAKTER
Posts: 4
Joined: Fri, 2010-03-05, 09:18

#9 Post by 2TAKTER »

oh, are there any sql features added in the developer version?

Michael Onken
DCMTK Developer
Posts: 2052
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#10 Post by Michael Onken »

No!

2TAKTER
Posts: 4
Joined: Fri, 2010-03-05, 09:18

#11 Post by 2TAKTER »

ok, as far as i understand the code, the content of IdxRecord, defined in dcmqridx.h, is stored in the index.dat right?

so as far as i understand it, i have to define a class DcmQueryRetrieveSQLDatabaseHandleFactory in the dcmqrdbi.h

afterwards i create a function with the same name in dcmqrdbi.cxx which writes the data to an sql database...

so the theorie... it's just that i understand it right ... hope i don't annoy too much :D

Michael Onken
DCMTK Developer
Posts: 2052
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#12 Post by Michael Onken »

Right,

for a database implementation "just" write a class that substitutes class DcmQueryRetrieveIndexDatabaseHandleFactory (dcmqrdbi.h) which is derived the from the abstract base class DcmQueryRetrieveDatabaseHandle (dcmqrdba.h).

Your database class must also derive then from this abstract base class. This requires you in your database class to overwrite all abstract (pure virtual) function prototypes for receiving DICOM files (storeRequest()), and searching DICOM files (e. g. startFindRequest() and others).

Best regards,
Michael

Post Reply

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] and 1 guest