Unverified Commit 4efc2076 authored by Rémi Cresson's avatar Rémi Cresson Committed by GitHub
Browse files

Merge pull request #44 from remicres/43-more_supported_numeric_types

ENH: add uint8, uint16, int16, uint32, int64
Showing with 13 additions and 3 deletions
+13 -3
...@@ -97,13 +97,23 @@ void RecopyImageRegionToTensorWithCast(const typename TImage::Pointer inputPtr, ...@@ -97,13 +97,23 @@ void RecopyImageRegionToTensorWithCast(const typename TImage::Pointer inputPtr,
{ {
tensorflow::DataType dt = tensor.dtype(); tensorflow::DataType dt = tensor.dtype();
if (dt == tensorflow::DT_FLOAT) if (dt == tensorflow::DT_FLOAT)
RecopyImageRegionToTensor<TImage, float> (inputPtr, region, tensor, elemIdx); RecopyImageRegionToTensor<TImage, float>(inputPtr, region, tensor, elemIdx);
else if (dt == tensorflow::DT_DOUBLE) else if (dt == tensorflow::DT_DOUBLE)
RecopyImageRegionToTensor<TImage, double> (inputPtr, region, tensor, elemIdx); RecopyImageRegionToTensor<TImage, double>(inputPtr, region, tensor, elemIdx);
else if (dt == tensorflow::DT_UINT64)
RecopyImageRegionToTensor<TImage, unsigned long long int>(inputPtr, region, tensor, elemIdx);
else if (dt == tensorflow::DT_INT64) else if (dt == tensorflow::DT_INT64)
RecopyImageRegionToTensor<TImage, long long int>(inputPtr, region, tensor, elemIdx); RecopyImageRegionToTensor<TImage, long long int>(inputPtr, region, tensor, elemIdx);
else if (dt == tensorflow::DT_UINT32)
RecopyImageRegionToTensor<TImage, unsigned int>(inputPtr, region, tensor, elemIdx);
else if (dt == tensorflow::DT_INT32) else if (dt == tensorflow::DT_INT32)
RecopyImageRegionToTensor<TImage, int> (inputPtr, region, tensor, elemIdx); RecopyImageRegionToTensor<TImage, int>(inputPtr, region, tensor, elemIdx);
else if (dt == tensorflow::DT_UINT16)
RecopyImageRegionToTensor<TImage, unsigned short int> (inputPtr, region, tensor, elemIdx);
else if (dt == tensorflow::DT_INT16)
RecopyImageRegionToTensor<TImage, short int>(inputPtr, region, tensor, elemIdx);
else if (dt == tensorflow::DT_UINT8)
RecopyImageRegionToTensor<TImage, unsigned char> (inputPtr, region, tensor, elemIdx);
else else
itkGenericExceptionMacro("TF DataType "<< dt << " not currently implemented !"); itkGenericExceptionMacro("TF DataType "<< dt << " not currently implemented !");
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment