# HG changeset patch # User Benjamin Golinvaux # Date 1571233401 -7200 # Node ID 391fb6d6905dec44b7050b72f46df5450d34fd21 # Parent 6dd90b8d15892c47fc44b491e93395ce9c4678a8 OrthancMultiframeVolumeLoader asks volume image to compute range + added IsContextLost to wasm viewport + added "computeRange" bool property to DicomVolumeImage + added ability to ask the MPR slicer for its source volume (to retrieve voxel value range) diff -r 6dd90b8d1589 -r 391fb6d6905d Framework/Loaders/OrthancMultiframeVolumeLoader.cpp --- a/Framework/Loaders/OrthancMultiframeVolumeLoader.cpp Tue Oct 15 14:30:19 2019 +0200 +++ b/Framework/Loaders/OrthancMultiframeVolumeLoader.cpp Wed Oct 16 15:43:21 2019 +0200 @@ -112,8 +112,6 @@ } }; - - class OrthancMultiframeVolumeLoader::LoadTransferSyntax : public State { public: @@ -229,7 +227,7 @@ geometry.SetAxialGeometry(parameters.GetGeometry()); geometry.SetVoxelDimensions(parameters.GetPixelSpacingX(), parameters.GetPixelSpacingY(), spacingZ); - volume_->Initialize(geometry, format); + volume_->Initialize(geometry, format, true /* Do compute range */); } volume_->GetPixelData().Clear(); diff -r 6dd90b8d1589 -r 391fb6d6905d Framework/Scene2D/LookupTableTextureSceneLayer.cpp --- a/Framework/Scene2D/LookupTableTextureSceneLayer.cpp Tue Oct 15 14:30:19 2019 +0200 +++ b/Framework/Scene2D/LookupTableTextureSceneLayer.cpp Wed Oct 16 15:43:21 2019 +0200 @@ -52,7 +52,7 @@ SetTexture(t.release()); } - SetLookupTableGrayscale(); + SetLookupTableGrayscale(); // simple ramp between 0 and 255 SetRange(0, 1); } @@ -158,7 +158,8 @@ { Orthanc::ImageProcessing::GetMinMaxFloatValue(minValue_, maxValue_, GetTexture()); assert(minValue_ <= maxValue_); - + // TODO: debug to be removed + LOG(ERROR) << "LookupTableTextureSceneLayer::FitRange(): minValue_ = " << minValue_ << " maxValue_ = " << maxValue_; IncrementRevision(); } @@ -168,6 +169,8 @@ std::auto_ptr cloned (new LookupTableTextureSceneLayer(GetTexture())); + + // TODO: why is windowing_ not copied?????? cloned->CopyParameters(*this); cloned->minValue_ = minValue_; cloned->maxValue_ = maxValue_; diff -r 6dd90b8d1589 -r 391fb6d6905d Framework/Viewport/WebAssemblyViewport.h --- a/Framework/Viewport/WebAssemblyViewport.h Tue Oct 15 14:30:19 2019 +0200 +++ b/Framework/Viewport/WebAssemblyViewport.h Wed Oct 16 15:43:21 2019 +0200 @@ -73,6 +73,11 @@ return (compositor_.get() != NULL); } + bool IsContextLost() + { + return context_.IsContextLost(); + } + virtual ICompositor& GetCompositor() ORTHANC_OVERRIDE; virtual void Refresh() ORTHANC_OVERRIDE; diff -r 6dd90b8d1589 -r 391fb6d6905d Framework/Volumes/DicomVolumeImage.cpp --- a/Framework/Volumes/DicomVolumeImage.cpp Tue Oct 15 14:30:19 2019 +0200 +++ b/Framework/Volumes/DicomVolumeImage.cpp Wed Oct 16 15:43:21 2019 +0200 @@ -36,12 +36,14 @@ } - void DicomVolumeImage::Initialize(const VolumeImageGeometry& geometry, - Orthanc::PixelFormat format) + void DicomVolumeImage::Initialize( + const VolumeImageGeometry& geometry, + Orthanc::PixelFormat format, + bool computeRange) { geometry_.reset(new VolumeImageGeometry(geometry)); image_.reset(new ImageBuffer3D(format, geometry_->GetWidth(), geometry_->GetHeight(), - geometry_->GetDepth(), false /* don't compute range */)); + geometry_->GetDepth(), computeRange)); revision_ ++; } diff -r 6dd90b8d1589 -r 391fb6d6905d Framework/Volumes/DicomVolumeImage.h --- a/Framework/Volumes/DicomVolumeImage.h Tue Oct 15 14:30:19 2019 +0200 +++ b/Framework/Volumes/DicomVolumeImage.h Wed Oct 16 15:43:21 2019 +0200 @@ -67,7 +67,7 @@ } void Initialize(const VolumeImageGeometry& geometry, - Orthanc::PixelFormat format); + Orthanc::PixelFormat format, bool computeRange = false); void SetDicomParameters(const DicomInstanceParameters& parameters); diff -r 6dd90b8d1589 -r 391fb6d6905d Framework/Volumes/DicomVolumeImageMPRSlicer.h --- a/Framework/Volumes/DicomVolumeImageMPRSlicer.h Tue Oct 15 14:30:19 2019 +0200 +++ b/Framework/Volumes/DicomVolumeImageMPRSlicer.h Wed Oct 16 15:43:21 2019 +0200 @@ -89,6 +89,11 @@ { } + boost::shared_ptr GetVolume() const + { + return volume_; + } + virtual ~DicomVolumeImageMPRSlicer(); virtual IExtractedSlice* ExtractSlice(const CoordinateSystem3D& cuttingPlane) ORTHANC_OVERRIDE;