# HG changeset patch # User Sebastien Jodogne # Date 1559129971 -7200 # Node ID a68cd7ae88388d6abef7c998cb6e59572c72e684 # Parent 68f888812af47292ea4c6bcdb1b7e00782d963a9 fix diff -r 68f888812af4 -r a68cd7ae8838 Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp --- a/Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp Wed May 29 08:36:13 2019 +0200 +++ b/Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp Wed May 29 13:39:31 2019 +0200 @@ -42,20 +42,22 @@ DicomVolumeImageMPRSlicer::Slice(*that.volume_, plane), that_(that) { - if (GetProjection() == VolumeProjection_Axial) + if (IsValid()) { - // For coronal and sagittal projections, we take the global - // revision of the volume because even if a single slice changes, - // this means the projection will yield a different result --> - // we must increase the revision as soon as any slice changes - SetRevision(that_.seriesGeometry_.GetSliceRevision(GetSliceIndex())); - } + if (GetProjection() == VolumeProjection_Axial) + { + // For coronal and sagittal projections, we take the global + // revision of the volume because even if a single slice changes, + // this means the projection will yield a different result --> + // we must increase the revision as soon as any slice changes + SetRevision(that_.seriesGeometry_.GetSliceRevision(GetSliceIndex())); + } - if (that_.strategy_.get() != NULL && - IsValid() && - GetProjection() == VolumeProjection_Axial) - { - that_.strategy_->SetCurrent(GetSliceIndex()); + if (that_.strategy_.get() != NULL && + GetProjection() == VolumeProjection_Axial) + { + that_.strategy_->SetCurrent(GetSliceIndex()); + } } } }; @@ -264,7 +266,7 @@ std::auto_ptr tmp(new GetOrthancImageCommand); tmp->SetHttpHeader("Accept-Encoding", "gzip"); tmp->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Pam))); - tmp->SetInstanceUri(instance, slice.GetExpectedPixelFormat()); + tmp->SetInstanceUri(instance, slice.GetExpectedPixelFormat()); tmp->SetExpectedPixelFormat(slice.GetExpectedPixelFormat()); command.reset(tmp.release()); } diff -r 68f888812af4 -r a68cd7ae8838 Framework/Oracle/OrthancRestApiCommand.h --- a/Framework/Oracle/OrthancRestApiCommand.h Wed May 29 08:36:13 2019 +0200 +++ b/Framework/Oracle/OrthancRestApiCommand.h Wed May 29 13:39:31 2019 +0200 @@ -95,6 +95,11 @@ void SetBody(const Json::Value& json); + void SwapBody(std::string& body) + { + body_.swap(body); + } + void SetHttpHeader(const std::string& key, const std::string& value) { diff -r 68f888812af4 -r a68cd7ae8838 Framework/Oracle/ThreadedOracle.cpp --- a/Framework/Oracle/ThreadedOracle.cpp Wed May 29 08:36:13 2019 +0200 +++ b/Framework/Oracle/ThreadedOracle.cpp Wed May 29 13:39:31 2019 +0200 @@ -248,7 +248,7 @@ client.SetTimeout(command.GetTimeout()); CopyHttpHeaders(client, command.GetHttpHeaders()); - + std::string answer; Orthanc::HttpClient::HttpHeaders answerHeaders; client.ApplyAndThrowException(answer, answerHeaders);