diff Framework/Toolbox/DicomInstanceParameters.cpp @ 1206:c93a6218f0cd

Fixed photometric interpretation in texture creation
author Benjamin Golinvaux <bgo@osimis.io>
date Tue, 03 Dec 2019 09:51:00 +0100
parents 7681f3943748
children 17a92c39c633 2d8ab34c8c91
line wrap: on
line diff
--- a/Framework/Toolbox/DicomInstanceParameters.cpp	Fri Nov 29 18:08:56 2019 +0100
+++ b/Framework/Toolbox/DicomInstanceParameters.cpp	Tue Dec 03 09:51:00 2019 +0100
@@ -420,7 +420,19 @@
         texture->SetCustomWindowing(data_.defaultWindowingCenter_,
                                     data_.defaultWindowingWidth_);
       }
-        
+      
+
+      if (data_.imageInformation_.GetPhotometricInterpretation()
+        == Orthanc::PhotometricInterpretation_Monochrome1)
+      {
+        texture->SetInverted(true);
+      }
+      else if (data_.imageInformation_.GetPhotometricInterpretation()
+        == Orthanc::PhotometricInterpretation_Monochrome2)
+      {
+        texture->SetInverted(false);
+      }
+
       return texture.release();
     }
   }