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
which as you can tell - isn't like
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
DICOM convert problem
Re: DICOM convert problem
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
oooh, one sec and I will try that
Re: DICOM convert problem
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
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?
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
FAN-BLUMMIN-TASTIC!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.
Thanks magick, what does -normalise do then? (I know I can RTFM but it is easier to just ask!)
Mike
Re: DICOM convert problem
http://www.imagemagick.org/script/convert.php - convert functions?
http://www.imagemagick.org/script/comma ... #normalize - normalise function
http://www.imagemagick.org/script/comma ... #normalize - normalise function
Re: DICOM convert problem
brilliant, thanks to you both for your help - I could well be back sometime for more assistance!