Conquest 1.4.16alpha...1.4.16alpha5 released

  • Hi,

    I am today releasing a server with new JPEG2000 and JPEG code by Bruce Barton. Thanks Bruce for this great job. The jpeg2000 implementation is from Jasper, while the JPEG implementation is a heavily patched version by Bruce (6c) from the independent jpeg group code. This version is released for windows (no source) and linux (source only). It also fixes numerous small bugs of 1.4.15(abc). It is an alpha release, fully functional but without any updates to the MANUALs. New compression codes are jk: jpeg2000 and jl: lossyjpeg2000.

    The windows release is here:…/
    To install for windows: progress as usual.

    The linux release is here:…uestlinux1416alpha.tar.gz
    To install for linux:

    Good luck and please report any bugs you find!

  • List of known bugs/wishes in 1.4.16alpha(2)

    1) Rare random high CPU load hang of a single server thread (bug recently reported on 1.4.14 and 1.4.15alpha, not on 1.4.13). Not recently confirmed.

    2) Wish: a clean way of exiting, i.e., that counts active threads:…c.php?f=33&t=1843&start=0


    4) Wish: safer printing: thread-safe and no drops;

    5) Seems like a warning will drop the connection (logs to be provided):

    6) Default ports 5678 and 5679 seem in use by Vista; also port 1155. Modify port ranges and test availability of port on fresh install.

    7 ) Incomplete server response in cqdicom - lambert ?. Fixed in 1.4.16beta

    8 ) Web interface fails to query studies and series in databases with really old definition (no patient name in study).

    ------- Newly found:

    9) RetrieveResultConverter0 (1.4.15 feature) is only enabled for NKI clients. Fixed in 1.4.16alpha2 below.

    10) wish: put zipped log files into a logs directory instead of next the the GUI. Fixed in 1.4.16alpha2 below. Starts doing this if you make a logs directory under the server directory.

    11) The browser and k-pacs viewer do not support JPEG2000 and multiframe. Fixed in 1.4.16alpha2 below.

    12) Another rare virtual server crash. Fixed in 1.4.16alpha2 below.

    13) Leak in jpeg and jpeg 2000 code (see below). Fixed in 1.4.16alpha3 below.

    14) %s does not give the destination in RetrieveResultConverter0 for non-NKI clients. Fixed in 1.4.16alpha3 below.

    15) crash on dgate --modifyimage; see…c.php?f=33&t=2143&start=0. Fixed in 1.4.16alpha3 below.

    16) wish: print to other DICOM printers. Fixed in 1.4.16alpha3 below.

    17) crash of virtualserver in other rare cases. still open.

    18 ) wish: let dgate -- commands work on remote server. Fixed in 1.4.16alpha3 below.


    19) attempted jpeg compression of RT/PR objects crashes the server. Fixed in 1.4.16alpha4 below.

    20) Only minor bug found jpeg2k lossless GUI selection is not reflected on menu. Saved dicom.ini correct - confirmed.…d3992a23104ca64b214#p7148. Fixed in 1 4.16beta.

    21) the show headers option in GUI shows a blank page with jpeg2k compressed images - confirmed.…d3992a23104ca64b214#p7148. Fixed in 1 4.16beta.

    22) view incoming images in GUI not functioning - confirmed.…d3992a23104ca64b214#p7148. Fixed in 1 4.16beta.

    23) A possible solution would be to add the current thread number to each line logged (not only to start and end of the thread) so that a simple sort before parsing the daily log files would overcome this problem.

    24) Wish: make virtualserver scriptable, or provide filters for it (i.e., on callingae). Fixed in 1.4.16beta.

    25) dgateserv indeed does not test if dgate runs. Fixed in 1 4.16beta: the service will stop if dgate crashes.

    26) NKI or JPG can be enabled even if jpg support not enabled. Fixed in 1 4.16beta.

    27) Add .# to sequence read/write syntax; maybe .* to add to a worklist. Fixed in 1.4.16beta.

    28) Add QueryResultConverter and ModalityWorkListQueryResultConverter. Fixed in 1.4.16alpha5.

    29) It is possible that a write fails (e.g., due to a disk full) and creates a 0 KB file; this should have given an error message. Fixed in 1.4.16beta: 0 byte files gives now an error.

    30) YBR_FULL_422 images should not be passed to dcmcjpg. Fixed in 1.4.16alpha5.

    31) A virtual server move of over 1000 CT slices causes a timeout (or other error) on the c-move client, followed by a crash of the server. This problem occurs on a production server but not an test server...

    32) there is a bug in the seriesdesc filter in DcmMove in dgate.cpp line 6406 - imagetype is passed instead. Fixed in 1.4.16alpha5.

    33) Add "system" import converter. Fixed in 1.4.16alpha5.

    34) PatientStudyFinder is not fully thread safe. Fixed in 1.4.16beta.

    35) Add "system" export converter. Fixed in 1.4.16beta.

    36) Add -w option for dgate. Fixed in 1.4.16beta.

    37) Add "get patient" etc as ImportConverter. Fixed in 1.4.16beta.

    38) Make %x/y/z ImportConverter variables local? Fixed in 1.4.16beta.

    39) virtualservermask import converter command. Fixed in 1.4.16beta.

    40) In alpha5: the QueryResultConverter hides CompressionConverter0. Fixed in 1.4.16beta.

    41) Make LossyQuality configurable in ImportConverter, forward statement and/or queryconverter.

    42) Add ArchiveConverter0.

    43) Files with Planarconfiguration=1 are not correctly displayed and/or compressed. Fixed in 1.4.16beta.

    44) Rephrase: Failed on VR Search: 0002 0010 (testing phase) - ignored. Fixed in 1.4.16beta.

    45) Virtualserver to multiple servers will send empty CMOVE to server not containing images. Fixed in 1.4.16beta.

    46) Unix free disk space check fails on NAS. Should this be configurable to still allow writing, i.e., by setting IgnoreMagDeviceThreshold to 1? Fixed in 1.4.16beta.

    To get a list of bugs fixed in 1.4.16alpha please have a look in the bug list for the 1.4.15 release. Please report any bugs you find!

  • I hereby release an update that enables the browser and (optionally) the KPACS viewer to display JPEG2000 images. Also provides a better interface in the browser for multiframe images.

    To enable JPEG2000 in the KPACS viewer add this line to dicom.ini that forces decompression to be done by the server, not the viewer:

    UseKpacsDecompression = 0

    Since the changes only affect the GUI, I will not release the updates for Linux - the web viewer already worked for JPEG2000 and multiframe.

    The update is here:…

    Please combine these with the files from 1.4.16alpha listed above and report any bugs found.


  • Leak! :shock: Sorry :oops: , there was a memory leak in DecompressJPEGL() and a leak in CompressJPEG2K(). Both have been fixed and the changed source code files posted at:…ware-Repository/index.php
    For those using the compiled Windows file, you will have to wait for Marcel. A quick fix is to just restart the server, this will release the memory; you may have to do it often depending on the amount of jpeg files being decoded and jpeg2k files being encoded. I have not tested my files on a Windows system, but the changes were minor and should not have any problems compiling.
    Again, sorry I missed that.

    Bruce Barton
    BITS Limited

  • Hi,

    This is a bug fix update for 1.4.16alpha, called Conquest 1.4.16alpha3.

    The windows release is here:…
    To install for windows: progress as usual.

    The linux release is here:…estlinux1416alpha3.tar.gz
    To install for linux:

    The dgate source code is here:…erver/
    The dicom library is unchanged.

    Good luck and please report any bugs you find!

  • Another fix. I needed frames to work with Jasper JPEG2000 and Libjpeg, which I added. I also added the OpenJPEG library to it, but Jasper is faster and OpenJPEG appears to have a memory leak on the compression side. At the same time I fixed all the warnings except for multi-char and for two dgate warnings that will require Marcel to decide. The files are in my usual place.…ware-Repository/index.php


  • In UpdateOrAddToTable:if (DB.NextRecord()), a small routine to remove blanks from the end of a line would point to unknown if the string length was 0 (s[i-1][-1]).
    Changed from: (len = strlen(s[i-1])
    To: if((len = strlen(s[i-1])))// Skip empty strings. bcb
    I only saw it on a 64 bit build and only with some images. May be only 64 bit, some images, or both. However I could see more of a problem with an int64 pointing to -1 than an int32.

  • Looking closer, I think j should be signed in this case. I will make the changes and replace j with (int)l. This is a warning that my great (or not so great) gcc4.2 missed. Normally, for ((unsigned int)j=len-1; j>=0; j--) would generate the warning "comparison is always true due to limited range of data type". I'm going to take a second look unsigned changes. :oops:

  • Bruce,

    I am trying to merge your stuff into the server. I have a query though. You seem intent to define INT32 as unsigned long in your jpeg code. This is incorrect on linux64 bit, as long will be 64 bit.

    See:…ontent=64-bit-development. A quote: "And finally, 64-bit model in Linux (LP64) differs from that in Windows (LLP64) only in the size of long type. Since it is their only difference, we'll avoid using long, unsigned'long types, and will use ptrdiff_t, size_t types to generalize the article."

    Have you considered this?

    Edit: I have merged your code, but if I send data from the server to itself in jpeg2000 encoding (set in, there is a large memory leak, which does not occur with jpeg or other encodings. Maybe it occurs when encoding in jpeg2000 for transmission. Can you try to reproduce that?



  • Marcel,

    Sorry about the long delay. Sounds like a good fix for the long problem, it is in the jpeg library and was not my doing, but I should have fixed it. I will fix it and some other small warnings (HAVE_STDDEF_H redefine) and repost the library. I wanted to test my leak fix code and ran into many problems. For example, you can not delete the last vr in a dicom object. It will corrupt LastVR and LastVRG. That is still not fixed, I just stopped using it on the image vr. As I turned on warnings, I would fix them too. I think I have all of the leaks and the warnings fixed (except 4 redifines in libjpeg). There are a lot of small change throughout the code. Since I was only looking for GCC warnings, I surrounded my changes with "ifdef __GNUC__" "else". This will let you make the changes you want. I changed most classes initialization routines to the faster way, otherwise you double initialize each variable. I noticed the speed deference. I just wanted to fix the --testcompression routine before I posted it. I don't know how many changes you have made, but Apple has a very good file merge program. If you want, you can post or send me what you have now and I can merge them or I can post what I have and you can merge them.


  • Hi Bruce,

    Nice to talk again. And my delay was major compared to yours ;->>> Let me know what constructs are giving trouble, then I can check them out.

    Here are the dgate sources as I updated them this weekend, based on your post. If you can merge your stuff that would be nice.…er/

    With kind regards,


  • Marcel,
    Sorry about all the changes. Most of the changes are in a "#ifdef __GNUC__" and should not effect your build, but I think you should try to remove as many as you can. I can see a speed difference with member initializations ( ) and the private no copies are harmless. If you search the code for "QUES:", you will find some questions that I had. I am running several servers currently with the code I posted. It also builds on 3 different systems with -wall and only -wno-multichar. No warnings ( I know, I'm just crazy). I copied from how to fix the long problem and did it in both dgate and the jpeg library. My leak detector tells me I have fixed all of the leaks in JPEG/J2K, but Activity Monitor ( an Apple face on ps ) shows it growing real memory. I think this is just because there is a lot of memory on the system and OSX just leaves it with the app.. Let me know what you see. Both are posted in the normal place:…ware-Repository/index.php



  • Hi Bruce,

    I am slowly working my way through your changes. Mostly I am fixing tab use [historically set to 8 for me] and dos/unix linefeeds, but I am inspecting every change. Hope you stop changing most files after this, though. ;->>>. I just downloaded the alpha4 changes. Did you change the library code as well?


  • Hi Marcel

    I did #if's in most of my changes. The only library change is the one I control, jpeg-6c. I changed the INT32 to match the change in ctypes.h. Jpeg-6c with the changes is posted where I put the alpha4 changes. Jasper and openJPEG are still the same. I will set my tabs to 8 and check all of the linefeeds before I post any more files. I did notice that different files have different tabs. I would just look at the changes and we can fix the look later ( unless your crazy about tabs, like I am about warnings ).


  • Hi Marcel,

    Another small change. I found that images that were acquired by "the DICOM box" (0x0008,0x1090 ManufacturerModelName) were allowed to have 00010101 as the birthdate. When this image is sent to OsiriX, it shortened the date to 10101 for the data but left the length at 8 corrupting the file. To fix this and other possibly bad dates, I look for a leading ascii zero as the first character of an 8 length date vr (type == DA) and change it to a one. I also changed my tabs to 8 and my CRs to CRLFs, let me know if its correct.
    Posted the file here:…ware-Repository/index.php


Participate now!

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