3
$\begingroup$

Mathematica 9 (windows 10) displays image as:

enter image description here

mathematica 10.2 (windows 10:) displays image as:

enter image description here

Here is the source file:

Import["https://dl.dropboxusercontent.com/u/68983831/46405725"]

How to achieve same display as mathematica 9? No code generated above image. Just the file was imported.

$\endgroup$
2
  • 1
    $\begingroup$ I think we need the actual source image to figure out what might be going wrong here, not just what's displayed. $\endgroup$ Dec 4, 2015 at 5:50
  • $\begingroup$ @MichaelWitt uploaded source image $\endgroup$
    – User12309
    Dec 4, 2015 at 16:32

1 Answer 1

5
$\begingroup$

The root cause is probably that the image is a 16 bit gray-value image which needs adjustment before it can be displayed on most standard monitors (which will have 8 bit gray-values).

For some reason this mapping goes differently in Mathematica 9...

Import["https://dl.dropboxusercontent.com/u/68983831/46405725"]

enter image description here

... than in Mathematica 10:

enter image description here

A workaround would be to do the re-scaling yourself using ImageAdjust of the data component of the file:

Import["https://dl.dropboxusercontent.com/u/68983831/46405725", 
       {"DICOM", "Data"}][[1]] // Image // ImageAdjust

enter image description here

or by simply dividing by 256:

Import["https://dl.dropboxusercontent.com/u/68983831/46405725", 
       {"DICOM", "Data"}][[1]] /256. // Image

enter image description here

$\endgroup$
2
  • $\begingroup$ Probably you mean dividing by 255. because channel values for images of type "Byte" in Mathematica run from 0 to 255. $\endgroup$ Dec 6, 2015 at 13:44
  • $\begingroup$ @AlexeyPopkov no, division by 256 is right shifting by 8 bits, and since the dicom image is 16 bit, this scales back to 8 bits. $\endgroup$ Dec 6, 2015 at 14:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.