DICOM convert problem

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
spikeZ
Posts: 5
Joined: 2007-05-23T13:56:22-07:00

DICOM convert problem

Post 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
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: DICOM convert problem

Post 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`;
spikeZ
Posts: 5
Joined: 2007-05-23T13:56:22-07:00

Re: DICOM convert problem

Post by spikeZ »

oooh, one sec and I will try that :)
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: DICOM convert problem

Post 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.
spikeZ
Posts: 5
Joined: 2007-05-23T13:56:22-07:00

Re: DICOM convert problem

Post 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?
spikeZ
Posts: 5
Joined: 2007-05-23T13:56:22-07:00

Re: DICOM convert problem

Post 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
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: DICOM convert problem

Post by Bonzo »

spikeZ
Posts: 5
Joined: 2007-05-23T13:56:22-07:00

Re: DICOM convert problem

Post by spikeZ »

brilliant, thanks to you both for your help - I could well be back sometime for more assistance!
Post Reply