Issue44

Title Bad interpretation of photometric interpretation "MONOCHROME1"
Priority bug Status resolved
Superseder Nosy List admin
Assigned To
Keywords Orthanc Core

Created on 2017-03-31.11:40:18 by admin, last changed by admin.

Files
File name Uploaded Type Edit Remove
4027862789-Invert.png admin, 2020-06-29.15:19:43 image/png
Monochrome1.dcm admin, 2020-06-29.15:18:25 application/dicom
Monochrome2.dcm admin, 2020-06-29.15:18:29 application/dicom
Messages
msg197 (view) Author: admin Date: 2017-03-31.11:40:18
[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
```
msg198 (view) Author: admin Date: 2020-06-29.15:18:25
[Bugzilla user: s.jodogne@gmail.com]
[Bugzilla date: 2020-06-29T13:18:25+00:00]

Created attachment 87
Monochrome1.dcm
msg199 (view) Author: admin Date: 2020-06-29.15:18:29
[Bugzilla user: s.jodogne@gmail.com]
[Bugzilla date: 2020-06-29T13:18:29+00:00]

Created attachment 88
Monochrome2.dcm
msg200 (view) Author: admin Date: 2017-03-31.11:42:42
[BitBucket user: Sébastien Jodogne]
[BitBucket date: 2017-03-31.09:42:42]

As a temporary workaround, it is possible to use the "invert contrast" button in the Orthanc Web Viewer: ![Invert.png](4027862789-Invert.png)
msg201 (view) Author: admin Date: 2020-06-29.15:19:43
[Bugzilla user: s.jodogne@gmail.com]
[Bugzilla date: 2020-06-29T13:19:43+00:00]

Created attachment 94
4027862789-Invert.png
msg202 (view) Author: admin Date: 2017-06-09.16:14:58
[BitBucket user: Sébastien Jodogne]
[BitBucket date: 2017-06-09.14:14:58]

Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)

→ https://hg.orthanc-server.com/orthanc/changeset/e002430baa41
History
Date User Action Args
2026-07-29 15:51:20admincreate