Mercurial > hg > orthanc-stone
diff Framework/Scene2D/GrayscaleStyleConfigurator.cpp @ 913:2b4b6b86520a
Re-enabled gl debug output in GuiAdapter +
REMOVED GZIP ENCODING IN OrthancSeriesVolumeProgressiveLoader +
added ability to use custom windowing in GrayscaleStyleConfigurator
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Fri, 19 Jul 2019 10:30:40 +0200 |
parents | e62e7361fd60 |
children | 4d1f57773b5b |
line wrap: on
line diff
--- a/Framework/Scene2D/GrayscaleStyleConfigurator.cpp Thu Jul 18 10:39:00 2019 +0200 +++ b/Framework/Scene2D/GrayscaleStyleConfigurator.cpp Fri Jul 19 10:30:40 2019 +0200 @@ -34,6 +34,12 @@ revision_++; } + void GrayscaleStyleConfigurator::SetCustomWindowing(float windowCenter, float windowWidth) + { + SetWindowing(ImageWindowing_Custom); + customWindowCenter_ = windowCenter; + customWindowWidth_ = windowWidth; + } void GrayscaleStyleConfigurator::SetLinearInterpolation(bool enabled) { @@ -41,14 +47,12 @@ revision_++; } - TextureBaseSceneLayer* GrayscaleStyleConfigurator::CreateTextureFromImage( const Orthanc::ImageAccessor& image) const { throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); } - TextureBaseSceneLayer* GrayscaleStyleConfigurator::CreateTextureFromDicom( const Orthanc::ImageAccessor& frame, const DicomInstanceParameters& parameters) const @@ -66,7 +70,6 @@ } } - void GrayscaleStyleConfigurator::ApplyStyle(ISceneLayer& layer) const { FloatTextureSceneLayer& l = dynamic_cast<FloatTextureSceneLayer&>(layer); @@ -75,7 +78,14 @@ if (hasWindowing_) { - l.SetWindowing(windowing_); + if (windowing_ != ImageWindowing_Custom) + { + l.SetWindowing(windowing_); + } + else + { + l.SetCustomWindowing(customWindowCenter_, customWindowWidth_); + } } } }