[BitBucket user: Sébastien Jodogne]
[BitBucket date: 2017-03-31.09:40:18]
See the following discussion on the forum: https://groups.google.com/d/msg/orthanc-users/V5jCSXNgu0w/raYSUx26AQAJ
"MONOCHROME1" and "MONOCHROME2" are currently taken as synonyms by Orthanc, whereas "MONOCHROME1" should map the lowest value as white instead of black.
Two sample images are attached. Here is a sample Matlab/Octave script that does the expected calculation:
```
monochrome1 = 'bcdd600a-a6a9c522-5f0a6e84-8657c9f3-b76e59b7';
size1 = [ 2010 2446 ];
monochrome2 = 'f00947b7-f61f7164-c93414d1-c6fbda6a-9e92ed20';
size2 = [ 1572 2010 ];
function image = LoadImage(id, size)
# Download the raw pixel data
raw = urlread([ 'http://localhost:8042/instances/' id '/content/PixelData/0' ]);
# Write it to some temporary file
f = fopen('tmp', 'wb');
fwrite(f, raw);
fclose(f);
# Load back as a Matlab matrix
f = fopen('tmp', 'r');
image = fread(f, size, 'uint16');
fclose(f);
endfunction
colormap(gray);
a = LoadImage(monochrome1, size1); imagesc((max(max(a)) - a)')
#a = LoadImage(monochrome2, size2); imagesc(a')
# Monochrome1 (chest): Raw background is white, should be rendered as black => invert
# Monochrome2 (key): Raw background is white, should be rendered as white
```
|