DICOM black artifacts
Re: DICOM black artifacts
We tried your compiler flags and still get expected results from the command you posted. We're clueless why its failing for you. Try ldd /usr/local/bin/convert and make sure the convert program is picking up the correct libMagickCore.so library. Note, ImageMagick 6.7.3-0 is now available.
Re: DICOM black artifacts
No change with ImageMagick 6.7.3-0 eithermagick wrote:We tried your compiler flags and still get expected results from the command you posted. We're clueless why its failing for you. Try ldd /usr/local/bin/convert and make sure the convert program is picking up the correct libMagickCore.so library. Note, ImageMagick 6.7.3-0 is now available.
ldd looks fine to me :
Code: Select all
ldd /usr/bin/convert
linux-vdso.so.1 => (0x00007fff3b3ff000)
libMagickCore.so.5 => /usr/lib64/libMagickCore.so.5 (0x00007fa702408000)
libMagickWand.so.5 => /usr/lib64/libMagickWand.so.5 (0x00007fa7020ea000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fa701ecc000)
libc.so.6 => /lib64/libc.so.6 (0x00007fa701b28000)
liblcms2.so.2 => /usr/lib64/liblcms2.so.2 (0x00007fa7018d6000)
libtiff.so.5 => /usr/lib64/libtiff.so.5 (0x00007fa701661000)
libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00007fa7013c2000)
libjpeg.so.8 => /usr/lib64/libjpeg.so.8 (0x00007fa701185000)
liblqr-1.so.0 => /usr/lib64/liblqr-1.so.0 (0x00007fa700f71000)
libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007fa700c4f000)
libfftw3.so.3 => /usr/lib64/libfftw3.so.3 (0x00007fa7008d1000)
libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x00007fa70069a000)
libXext.so.6 => /usr/lib64/libXext.so.6 (0x00007fa700486000)
libSM.so.6 => /usr/lib64/libSM.so.6 (0x00007fa70027d000)
libICE.so.6 => /usr/lib64/libICE.so.6 (0x00007fa700060000)
libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007fa6ffd1e000)
libXt.so.6 => /usr/lib64/libXt.so.6 (0x00007fa6ffab7000)
liblzma.so.5 => /usr/lib64/liblzma.so.5 (0x00007fa6ff894000)
libbz2.so.1 => /lib64/libbz2.so.1 (0x00007fa6ff683000)
libz.so.1 => /lib64/libz.so.1 (0x00007fa6ff46d000)
libm.so.6 => /lib64/libm.so.6 (0x00007fa6ff1e9000)
libgomp.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libgomp.so.1 (0x00007fa6fefdb000)
librt.so.1 => /lib64/librt.so.1 (0x00007fa6fedd2000)
libltdl.so.7 => /usr/lib64/libltdl.so.7 (0x00007fa6febc8000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fa6fe9c4000)
/lib64/ld-linux-x86-64.so.2 (0x00007fa7028a8000)
libexpat.so.1 => /usr/lib64/libexpat.so.1 (0x00007fa6fe79a000)
libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007fa6fe57c000)
libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007fa6fe378000)
libXdmcp.so.6 => /usr/lib64/libXdmcp.so.6 (0x00007fa6fe172000)
Thank you!
Re: DICOM black artifacts
No, the video driver doesn't matter. We tried your image under Windows and Mac with 6.7.3-0 and it converted properly. Check that 'ls -lt /usr/lib64/libMagickCore.so.5' reports today as the create date.
Re: DICOM black artifacts
Yes it's from today:magick wrote:No, the video driver doesn't matter. We tried your image under Windows and Mac with 6.7.3-0 and it converted properly. Check that 'ls -lt /usr/lib64/libMagickCore.so.5' reports today as the create date.
Code: Select all
ls -lt /usr/lib64/libMagickCore.so.5
lrwxrwxrwx 1 root root 22 окт 10 02:12 /usr/lib64/libMagickCore.so.5 -> libMagickCore.so.5.0.0
EDIT: The command 'display GEORGIEV_EMILIYAN.DCM' renders the same artifacts like convert command, that's why I'm thinking that something wrong is going on with the dicom part of imagemagick (on my system) or may be something related to X or mesa or kwin? Is it possible to be file system related (i'm using ext4)?
Thank you!
Re: DICOM black artifacts
The only option left is that ImageMagick is picking up the wrong DCM module. Add '-debug module' to your command line. Yours should return:
Opening module at path "/usr/lib64/ImageMagick-6.7.3/modules-Q16/coders/dcm.la"
and 'ls -lt /usr/lib64/ImageMagick-6.7.3/modules-Q16/coders/dcm.so' should return today's date. The last option is to build ImageMagick statically with
Opening module at path "/usr/lib64/ImageMagick-6.7.3/modules-Q16/coders/dcm.la"
and 'ls -lt /usr/lib64/ImageMagick-6.7.3/modules-Q16/coders/dcm.so' should return today's date. The last option is to build ImageMagick statically with
- cd ImageMagick-6.7.3
./configure --disable-shared
make
make install
Re: DICOM black artifacts
Here is the debug output with dynamic linking :
It looks fine to me, no errors or warnings.
Here is the output with static linking (artifacts are still present):
I can't see any difference or problem in both outputs
I'll try today on my other PC and report (the main difference between both PCs are the processors)
Thank you for your help!
Code: Select all
convert -debug module -define dcm:display-range=reset GEORGIEV_EMILIYAN.DCM -define png:color-type=4 -quality 100 -define png:compression-level=9 GEORGIEV_EMILIYAN.DCM1.png
zsh: correct 'GEORGIEV_EMILIYAN.DCM1.png' to 'GEORGIEV_EMILIYAN.DCM.png' [nyae]? n
2011-10-10T11:38:40+03:00 0:00.030 0.010u 6.7.3 Module convert[4746]: module.c/OpenModule/1264/Module
Searching for module "DCM" using filename "dcm.la"
2011-10-10T11:38:40+03:00 0:00.030 0.010u 6.7.3 Module convert[4746]: module.c/GetMagickModulePath/565/Module
Searching for coder module file "dcm.la" ...
2011-10-10T11:38:40+03:00 0:00.040 0.010u 6.7.3 Module convert[4746]: module.c/OpenModule/1273/Module
Opening module at path "/usr/lib64/ImageMagick-6.7.3/modules-Q64/coders/dcm.la"
2011-10-10T11:38:40+03:00 0:00.070 0.010u 6.7.3 Module convert[4746]: module.c/OpenModule/1300/Module
Method "RegisterDCMImage" in module "DCM" at address 0x7f74be70d300
2011-10-10T11:38:40+03:00 0:00.070 0.010u 6.7.3 Module convert[4746]: module.c/OpenModule/1314/Module
Method "UnregisterDCMImage" in module "DCM" at address 0x7f74be70d380
2011-10-10T11:38:40+03:00 0:00.750 0.580u 6.7.3 Module convert[4746]: module.c/OpenModule/1264/Module
Searching for module "PNG" using filename "png.la"
2011-10-10T11:38:40+03:00 0:00.750 0.580u 6.7.3 Module convert[4746]: module.c/GetMagickModulePath/565/Module
Searching for coder module file "png.la" ...
2011-10-10T11:38:40+03:00 0:00.750 0.580u 6.7.3 Module convert[4746]: module.c/OpenModule/1273/Module
Opening module at path "/usr/lib64/ImageMagick-6.7.3/modules-Q64/coders/png.la"
2011-10-10T11:38:40+03:00 0:00.770 0.590u 6.7.3 Module convert[4746]: module.c/OpenModule/1300/Module
Method "RegisterPNGImage" in module "PNG" at address 0x7f74b51e97a0
2011-10-10T11:38:40+03:00 0:00.770 0.590u 6.7.3 Module convert[4746]: module.c/OpenModule/1314/Module
Method "UnregisterPNGImage" in module "PNG" at address 0x7f74b51e9b80
Here is the output with static linking (artifacts are still present):
Code: Select all
convert -debug module -define dcm:display-range=reset GEORGIEV_EMILIYAN.DCM -define png:color-type=4 -quality 100 -define png:compression-level=9 GEORGIEV_EMILIYAN.DCM1.png
zsh: correct 'GEORGIEV_EMILIYAN.DCM1.png' to 'GEORGIEV_EMILIYAN.DCM.png' [nyae]? n
2011-10-10T11:52:21+03:00 0:00.000 0.000u 6.7.3 Module convert[17842]: module.c/OpenModule/1264/Module
Searching for module "DCM" using filename "dcm.la"
2011-10-10T11:52:21+03:00 0:00.000 0.000u 6.7.3 Module convert[17842]: module.c/GetMagickModulePath/565/Module
Searching for coder module file "dcm.la" ...
2011-10-10T11:52:21+03:00 0:00.000 0.000u 6.7.3 Module convert[17842]: module.c/OpenModule/1273/Module
Opening module at path "/usr/lib64/ImageMagick-6.7.3/modules-Q64/coders/dcm.la"
2011-10-10T11:52:21+03:00 0:00.010 0.000u 6.7.3 Module convert[17842]: module.c/OpenModule/1300/Module
Method "RegisterDCMImage" in module "DCM" at address 0x7f9916ce5300
2011-10-10T11:52:21+03:00 0:00.010 0.000u 6.7.3 Module convert[17842]: module.c/OpenModule/1314/Module
Method "UnregisterDCMImage" in module "DCM" at address 0x7f9916ce5380
2011-10-10T11:52:22+03:00 0:00.500 0.480u 6.7.3 Module convert[17842]: module.c/OpenModule/1264/Module
Searching for module "PNG" using filename "png.la"
2011-10-10T11:52:22+03:00 0:00.500 0.480u 6.7.3 Module convert[17842]: module.c/GetMagickModulePath/565/Module
Searching for coder module file "png.la" ...
2011-10-10T11:52:22+03:00 0:00.500 0.480u 6.7.3 Module convert[17842]: module.c/OpenModule/1273/Module
Opening module at path "/usr/lib64/ImageMagick-6.7.3/modules-Q64/coders/png.la"
2011-10-10T11:52:22+03:00 0:00.500 0.480u 6.7.3 Module convert[17842]: module.c/OpenModule/1300/Module
Method "RegisterPNGImage" in module "PNG" at address 0x7f990d7c17a0
2011-10-10T11:52:22+03:00 0:00.500 0.480u 6.7.3 Module convert[17842]: module.c/OpenModule/1314/Module
Method "UnregisterPNGImage" in module "PNG" at address 0x7f990d7c1b80
I'll try today on my other PC and report (the main difference between both PCs are the processors)
Thank you for your help!
Re: DICOM black artifacts
Well i think now that this problem is processor related.
On my intell machine everything is fine and correctly rendered!
Here are the details:
cpuinfo:
with the following imagemagick version:
Here are the details of my AMD machine that produces the artifacts:
with:
My guess so far is that imagemagick's dicom module is using some processor instruction that is available in intell but not (or faulty) in amd
Thank you!
On my intell machine everything is fine and correctly rendered!
Here are the details:
cpuinfo:
Code: Select all
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Core(TM)2 Duo CPU T6600 @ 2.20GHz
stepping : 10
cpu MHz : 1200.000
cache size : 2048 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm dts
bogomips : 4399.44
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Core(TM)2 Duo CPU T6600 @ 2.20GHz
stepping : 10
cpu MHz : 2200.000
cache size : 2048 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm dts
bogomips : 4399.67
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:
Code: Select all
Version: ImageMagick 6.7.2-6 2011-09-20 Q32 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP HDRI
Here are the details of my AMD machine that produces the artifacts:
Code: Select all
processor : 0
vendor_id : AuthenticAMD
cpu family : 15
model : 67
model name : AMD Athlon(tm) 64 X2 Dual Core Processor 6000+
stepping : 3
cpu MHz : 1000.000
cache size : 1024 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow rep_good nopl extd_apicid pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy
bogomips : 2009.26
TLB size : 1024 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp tm stc
processor : 1
vendor_id : AuthenticAMD
cpu family : 15
model : 67
model name : AMD Athlon(tm) 64 X2 Dual Core Processor 6000+
stepping : 3
cpu MHz : 1000.000
cache size : 1024 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow rep_good nopl extd_apicid pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy
bogomips : 2009.26
TLB size : 1024 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp tm stc
Code: Select all
display -version
Version: ImageMagick 6.7.3-0 2011-10-10 Q64 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP HDRI
Thank you!
Re: DICOM black artifacts
We have an AMD dual processor (AMD Opteron Processor 844) and it produces the expected results. We're using gcc 4.6.1. We still have no idea why it fails for you.
Re: DICOM black artifacts
Try executing under qemu with your OS of choice. That way others will be able to exactly reproduce your environment, even if you have to post the qemu image...
Re: DICOM black artifacts
rnbc wrote:Try executing under qemu with your OS of choice. That way others will be able to exactly reproduce your environment, even if you have to post the qemu image...
Good idea
Thank you!
Re: DICOM black artifacts
You are absolutely correct,it's not the processor!magick wrote:We have an AMD dual processor (AMD Opteron Processor 844) and it produces the expected results. We're using gcc 4.6.1. We still have no idea why it fails for you.
I forgot that i compiled imagemagic on intel machine with different options of '--with-quantum-depth='.
Yes this option is the source of all of my problems: different quantum depth + different size of the dicom file = artifacts with different severity
A big dicom like this one (warning! It's 25MB image):
http://www.sendspace.com/file/xcjq54 + '--with-quantum-depth=64' the result is a black output
http://www.sendspace.com/file/xcjq54 + '--with-quantum-depth=32' the result is artifacts like mine
http://www.sendspace.com/file/xcjq54 + '--with-quantum-depth=8' the result is what i want (no artifcts)
A small dicom like this one ( 7.35MB )
http://www.sendspace.com/file/jc7l4g + '--with-quantum-depth=64' the result is artifacts like mine
http://www.sendspace.com/file/jc7l4g + '--with-quantum-depth=32' the result is what i want (no artifcts)
http://www.sendspace.com/file/jc7l4g + '--with-quantum-depth=8' the result is what i want (no artifcts)
You can see the pattern here
"--with-quantum-depth" is messing badly with dicoms
Thank you for the patience and help!
You guys are great
Re: DICOM black artifacts
We tried quantum depths of 8, 16,32, and 64 and both your images converted properly without artifacts. DICOM uses floating point extensively. Perhaps there is a problem in the floating point conversion.
Re: DICOM black artifacts
May be, I don`t know.magick wrote:We tried quantum depths of 8, 16,32, and 64 and both your images converted properly without artifacts. DICOM uses floating point extensively. Perhaps there is a problem in the floating point conversion.
At least now I can convert dicoms without artifacts using quantum depth of 8
I hope you'll be able to get to the root of this problem.
If you need some assistance from me just let me know. I would be glad to help.
You are great team!
Thank you!
Re: DICOM black artifacts
If you are aware what kernel options are responsible for floating point calculations I could check my kernel for them