# HG changeset patch # User Benjamin Golinvaux # Date 1563525040 -7200 # Node ID 2b4b6b86520a9042fae3cff08c69bc122ff2e489 # Parent a6c12fe88bcb9eed59c58859affbabb8a5c85355 Re-enabled gl debug output in GuiAdapter + REMOVED GZIP ENCODING IN OrthancSeriesVolumeProgressiveLoader + added ability to use custom windowing in GrayscaleStyleConfigurator diff -r a6c12fe88bcb -r 2b4b6b86520a Applications/Generic/GuiAdapter.cpp --- a/Applications/Generic/GuiAdapter.cpp Thu Jul 18 10:39:00 2019 +0200 +++ b/Applications/Generic/GuiAdapter.cpp Fri Jul 19 10:30:40 2019 +0200 @@ -725,7 +725,7 @@ // SDL ONLY void GuiAdapter::Run() { -#if 0 +#if 1 // TODO: MAKE THIS DYNAMIC !!! See SdlOpenGLViewport vs Cairo in ViewportWrapper # if ORTHANC_ENABLE_OPENGL == 1 && !defined(__APPLE__) glEnable(GL_DEBUG_OUTPUT); diff -r a6c12fe88bcb -r 2b4b6b86520a Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp --- a/Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp Thu Jul 18 10:39:00 2019 +0200 +++ b/Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp Fri Jul 19 10:30:40 2019 +0200 @@ -264,7 +264,10 @@ if (quality == BEST_QUALITY) { std::auto_ptr tmp(new GetOrthancImageCommand); - tmp->SetHttpHeader("Accept-Encoding", "gzip"); + // TODO: review the following comment. Commented out by bgo on 2019-07-19 + // reason: Alain has seen cases where gzipping the uint16 image took 11 sec + // to produce 5mb. The unzipped request was much much faster. + //tmp->SetHttpHeader("Accept-Encoding", "gzip"); tmp->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Pam))); tmp->SetInstanceUri(instance, slice.GetExpectedPixelFormat()); tmp->SetExpectedPixelFormat(slice.GetExpectedPixelFormat()); @@ -273,7 +276,9 @@ else { std::auto_ptr tmp(new GetOrthancWebViewerJpegCommand); - tmp->SetHttpHeader("Accept-Encoding", "gzip"); + // TODO: review the following comment. Commented out by bgo on 2019-07-19 + // (gzip for jpeg seems overkill) + //tmp->SetHttpHeader("Accept-Encoding", "gzip"); tmp->SetInstance(instance); tmp->SetQuality((quality == 0 ? 50 : 90)); tmp->SetExpectedPixelFormat(slice.GetExpectedPixelFormat()); diff -r a6c12fe88bcb -r 2b4b6b86520a Framework/Scene2D/GrayscaleStyleConfigurator.cpp --- 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(layer); @@ -75,7 +78,14 @@ if (hasWindowing_) { - l.SetWindowing(windowing_); + if (windowing_ != ImageWindowing_Custom) + { + l.SetWindowing(windowing_); + } + else + { + l.SetCustomWindowing(customWindowCenter_, customWindowWidth_); + } } } } diff -r a6c12fe88bcb -r 2b4b6b86520a Framework/Scene2D/GrayscaleStyleConfigurator.h --- a/Framework/Scene2D/GrayscaleStyleConfigurator.h Thu Jul 18 10:39:00 2019 +0200 +++ b/Framework/Scene2D/GrayscaleStyleConfigurator.h Fri Jul 19 10:30:40 2019 +0200 @@ -36,19 +36,24 @@ bool linearInterpolation_; bool hasWindowing_; ImageWindowing windowing_; - + float customWindowWidth_; + float customWindowCenter_; // TODO - Add custom windowing public: GrayscaleStyleConfigurator() : revision_(0), linearInterpolation_(false), - hasWindowing_(false) + hasWindowing_(false), + customWindowWidth_(0), + customWindowCenter_(0) { } void SetWindowing(ImageWindowing windowing); + void SetCustomWindowing(float windowWidth, float windowCenter); + void SetLinearInterpolation(bool enabled); bool IsLinearInterpolation() const