Page 1 of 1

DICOM convert problem

Posted: 2007-05-23T14:18:44-07:00
by spikeZ
Hi folks, first post on here but am no stranger to programming so i hope you guys can help me out!

I am converting DICOM files to png format but I only get a gray image with a very faint outline of the original image.
(Btw DICOM images are the what comes off an MRI machine and other medical imagery machines)

So I am using PHP to run the scripts.

$image_details = `convert dicom_tests\IM3 dicom_tests\IM3_convert.png`;

but that gives me
Image
which as you can tell - isn't like
Image
which was converted in Photoshop.

Am I missing something really obvious or do I need to change a setting somewhere?!
If you need the header information, let me know as it's rather lengthy!

TiA for any advice and assistance,

Spike

Re: DICOM convert problem

Posted: 2007-05-23T14:28:37-07:00
by Bonzo
A typing error as you do not have an original file extension ?

Code: Select all

$image_details = `convert dicom_tests\IM3.dicom dicom_tests\IM3_convert.png`;

Re: DICOM convert problem

Posted: 2007-05-23T14:30:40-07:00
by spikeZ
oooh, one sec and I will try that :)

Re: DICOM convert problem

Posted: 2007-05-23T14:33:22-07:00
by magick
Add -normalize to your command line. If that fails, post a URL to your image so we can download an reproduce the problem.

Re: DICOM convert problem

Posted: 2007-05-23T14:35:13-07:00
by spikeZ
no difference I'm afraid.

Interestingly comparing the histograms for the 2 images there are some stark differences. Just as a snippet
Photoshop Converted:
Histogram:
8972: #000000 black
10318: #010101 rgb(1,1,1)
10861: #020202 rgb(2,2,2)
3870: #030303 grey1
2531: #040404 rgb(4,4,4)
977: #050505 grey2
800: #060606 rgb(6,6,6)
302: #070707 rgb(7,7,7)
715: #080808 grey3
152: #090909 rgb(9,9,9)
342: #0A0A0A grey4
277: #0B0B0B rgb(11,11,11)
// snipped //

IM converted
Histogram:
5549: #800180018001 rgb(50.0023%,50.0023%,50.0023%)
422: #800280028002 rgb(50.0038%,50.0038%,50.0038%)
1008: #800380038003 rgb(50.0053%,50.0053%,50.0053%)
4906: #800680068006 rgb(50.0099%,50.0099%,50.0099%)
4343: #800580058005 rgb(50.0084%,50.0084%,50.0084%)
2426: #800480048004 rgb(50.0069%,50.0069%,50.0069%)
1096: #800B800B800B rgb(50.0175%,50.0175%,50.0175%)
// snipped //

any thoughts?

Re: DICOM convert problem

Posted: 2007-05-23T14:36:47-07:00
by spikeZ
magick wrote:Add -normalize to your command line. If that fails, post a URL to your image so we can download an reproduce the problem.
FAN-BLUMMIN-TASTIC!
Thanks magick, what does -normalise do then? (I know I can RTFM but it is easier to just ask!)

Mike

Re: DICOM convert problem

Posted: 2007-05-23T14:39:15-07:00
by Bonzo

Re: DICOM convert problem

Posted: 2007-05-23T14:40:32-07:00
by spikeZ
brilliant, thanks to you both for your help - I could well be back sometime for more assistance!