# HG changeset patch # User Alain Mazy # Date 1555595167 -7200 # Node ID e77cbe4bb4c85bcd8f894d5046af4bd18c6db860 # Parent ccd1a1ede305baaf2388960403319425909eefe1 fix + access to DicomFrameConverter members to allow serialization diff -r ccd1a1ede305 -r e77cbe4bb4c8 Applications/Qt/QCairoWidget.cpp --- a/Applications/Qt/QCairoWidget.cpp Thu Apr 18 11:04:46 2019 +0200 +++ b/Applications/Qt/QCairoWidget.cpp Thu Apr 18 15:46:07 2019 +0200 @@ -200,7 +200,7 @@ if (event) { - surface_.SetSize(event->size().width(), event->size().height()); + surface_.SetSize(event->size().width(), event->size().height(), true); image_.reset(new QImage(reinterpret_cast(surface_.GetBuffer()), event->size().width(), diff -r ccd1a1ede305 -r e77cbe4bb4c8 Framework/Toolbox/DicomFrameConverter.h --- a/Framework/Toolbox/DicomFrameConverter.h Thu Apr 18 11:04:46 2019 +0200 +++ b/Framework/Toolbox/DicomFrameConverter.h Thu Apr 18 15:46:07 2019 +0200 @@ -13,7 +13,7 @@ * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Affero General Public License for more details. - * + * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . **/ @@ -63,13 +63,61 @@ { // TODO: check whether this dtor is called or not // An MSVC warning explains that declaring an - // std::auto_ptr with a forward-declared type - // prevents its dtor from being called. Does not + // std::auto_ptr with a forward-declared type + // prevents its dtor from being called. Does not // seem an issue here (only POD types inside), but - // definitely something to keep an eye on. + // definitely something to keep an eye on. (void)0; } + // AM: this is required to serialize/deserialize it + DicomFrameConverter( + bool isSigned, + bool isColor, + bool hasRescale, + double rescaleIntercept, + double rescaleSlope, + bool hasDefaultWindow, + double defaultWindowCenter, + double defaultWindowWidth, + Orthanc::PhotometricInterpretation photometric, + Orthanc::PixelFormat expectedPixelFormat + ): + isSigned_(isSigned), + isColor_(isColor), + hasRescale_(hasRescale), + rescaleIntercept_(rescaleIntercept), + rescaleSlope_(rescaleSlope), + hasDefaultWindow_(hasDefaultWindow), + defaultWindowCenter_(defaultWindowCenter), + defaultWindowWidth_(defaultWindowWidth), + photometric_(photometric), + expectedPixelFormat_(expectedPixelFormat) + {} + + void GetParameters(bool& isSigned, + bool& isColor, + bool& hasRescale, + double& rescaleIntercept, + double& rescaleSlope, + bool& hasDefaultWindow, + double& defaultWindowCenter, + double& defaultWindowWidth, + Orthanc::PhotometricInterpretation& photometric, + Orthanc::PixelFormat& expectedPixelFormat) const + { + isSigned = isSigned_; + isColor = isColor_; + hasRescale = hasRescale_; + rescaleIntercept = rescaleIntercept_; + rescaleSlope = rescaleSlope_; + hasDefaultWindow = hasDefaultWindow_; + defaultWindowCenter = defaultWindowCenter_; + defaultWindowWidth = defaultWindowWidth_; + photometric = photometric_; + expectedPixelFormat = expectedPixelFormat_; + } + Orthanc::PixelFormat GetExpectedPixelFormat() const { return expectedPixelFormat_; @@ -103,7 +151,7 @@ { return rescaleIntercept_; } - + double GetRescaleSlope() const { return rescaleSlope_;