From d9f4b77b657cd51da676b614b30465167dca23e1 Mon Sep 17 00:00:00 2001 From: Mihail Isakov Date: Mon, 20 Dec 2021 09:01:56 +0100 Subject: [PATCH] BUG: GDCM IO: reset internal variables It is safer to reset several variables on InternalReadImageInformation, because a user can re-use the IO. --- Modules/IO/GDCM/src/itkGDCMImageIO.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Modules/IO/GDCM/src/itkGDCMImageIO.cxx b/Modules/IO/GDCM/src/itkGDCMImageIO.cxx index dafc19b33df..986fb8ed264 100644 --- a/Modules/IO/GDCM/src/itkGDCMImageIO.cxx +++ b/Modules/IO/GDCM/src/itkGDCMImageIO.cxx @@ -441,6 +441,11 @@ GDCMImageIO::Read(void * pointer) void GDCMImageIO::InternalReadImageInformation() { + // Reset, a user can re-use IO. + m_RescaleIntercept = 0.0; + m_RescaleSlope = 1.0; + m_SingleBit = false; + // ensure file can be opened for reading, before doing any more work std::ifstream inputFileStream; // let any exceptions propagate