Page MenuHomePhabricator

mitkDicomSeriesReader does not compile on gcc 4.1.2.
Closed, DuplicatePublic

Description

Hi All,

Briefly: I was compiling a recent version of MITK (c855dedda4) on gcc 4.1.2, and it failed due to a warning of casting to unsigned long. The following change enabled me to compile.

Thanks

Matt

diff --git a/Core/Code/IO/mitkDicomSeriesReader.txx b/Core/Code/IO/mitkDicomSeriesReader.txx
index 80c95e5..551bfca 100644

  • a/Core/Code/IO/mitkDicomSeriesReader.txx

+++ b/Core/Code/IO/mitkDicomSeriesReader.txx
@@ -468,7 +468,7 @@ DicomSeriesReader::InPlaceFixUpTiltedGeometry( ImageType* input, const GantryTil

resampler->SetOutputParametersFromImage( input ); // we basically need the same image again, just sheared
 
typename ImageType::SizeType largerSize = resampler->GetSize(); // now the resampler already holds the input image's size.
  • largerSize[1] += tiltInfo.GetTiltCorrectedAdditionalSize();

+ largerSize[1] += static_cast<typename ImageType::SizeType::SizeValueType>(tiltInfo.GetTiltCorrectedAdditionalSize());

resampler->SetSize( largerSize );
 
resampler->Update();

Event Timeline

That email isn't very clear once pasted into bugzilla... so it was just a static_cast:

  • largerSize[1] += tiltInfo.GetTiltCorrectedAdditionalSize();

+ largerSize[1] += static_cast<typename ImageType::SizeType::SizeValueType>

just after line 468 in mitkDicomSeriesReader.

I am not sure about the exact syntax on all platforms.

M

Sorry, I already fixed that in

905ff247b (T11106 , which introduced the error)