1
0
mirror of synced 2024-11-09 22:48:55 +01:00
TheChymera-overlay/sci-libs/simpleitk/files/simpleitk-1.2.4-int-cast.patch
Horea Christian c4bd5412c8
sci-libs/simpleitk: cmake runs, python not really :-/
Package-Manager: Portage-3.0.17, Repoman-3.0.2
Signed-off-by: Horea Christian <chr@chymera.eu>
2021-05-06 05:28:21 -04:00

65 lines
2.6 KiB
Diff

From 73caeaa545859cffd68f9aebe1e8b66de5ab812d Mon Sep 17 00:00:00 2001
From: Bradley Lowekamp <blowekamp@mail.nih.gov>
Date: Fri, 14 Feb 2020 09:35:29 -0500
Subject: [PATCH] Explicitly cast int to ITK strongly typed enums
---
Code/IO/src/sitkImageReaderBase.cxx | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/Code/IO/src/sitkImageReaderBase.cxx b/Code/IO/src/sitkImageReaderBase.cxx
index b8c93a2ac..a5e6d9cd9 100644
--- a/Code/IO/src/sitkImageReaderBase.cxx
+++ b/Code/IO/src/sitkImageReaderBase.cxx
@@ -214,7 +214,7 @@ ::GetPixelIDFromImageIO( const ImageIOBase *iobase,
if (numberOfComponents == 1 &&
( pixelType == itk::ImageIOBase::SCALAR || pixelType == itk::ImageIOBase::COMPLEX ) )
{
- outPixelType = this->ExecuteInternalReadScalar( componentType );
+ outPixelType = this->ExecuteInternalReadScalar( static_cast<int>(componentType) );
return;
}
// we try to load anything else into a VectorImage
@@ -226,12 +226,12 @@ ::GetPixelIDFromImageIO( const ImageIOBase *iobase,
pixelType == itk::ImageIOBase::POINT ||
pixelType == itk::ImageIOBase::OFFSET )
{
- outPixelType = this->ExecuteInternalReadVector( componentType );
+ outPixelType = this->ExecuteInternalReadVector( static_cast<int>(componentType) );
return;
}
else if ( pixelType == itk::ImageIOBase::COMPLEX )
{
- outPixelType = this->ExecuteInternalReadComplex( componentType );
+ outPixelType = this->ExecuteInternalReadComplex( static_cast<int>(componentType) );
return;
}
else
@@ -268,7 +268,7 @@ ::ExecuteInternalReadScalar( int componentType )
{
const unsigned int UnusedDimension = 2;
- switch(componentType)
+ switch(static_cast<ImageIOBase::IOComponentType>(componentType))
{
case itk::ImageIOBase::CHAR:
return ImageTypeToPixelIDValue< itk::Image<int8_t, UnusedDimension> >::Result;
@@ -326,7 +326,7 @@ ::ExecuteInternalReadComplex( int componentType )
{
const unsigned int UnusedDimension = 2;
- switch(componentType)
+ switch(static_cast<ImageIOBase::IOComponentType>(componentType))
{
case itk::ImageIOBase::FLOAT:
return ImageTypeToPixelIDValue< itk::Image<std::complex<float>, UnusedDimension> >::Result;
@@ -346,7 +346,7 @@ ::ExecuteInternalReadVector( int componentType )
{
const unsigned int UnusedDimension = 2;
- switch(componentType)
+ switch(static_cast<ImageIOBase::IOComponentType>(componentType))
{
case itk::ImageIOBase::CHAR:
return ImageTypeToPixelIDValue< itk::VectorImage<int8_t, UnusedDimension> >::Result;