Skip to content

Commit

Permalink
ITKArrayHelper: Quiet more implicit conversion warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Jackson <[email protected]>
  • Loading branch information
imikejackson committed Aug 10, 2024
1 parent 0f8dbe2 commit 09cbbf0
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,8 @@ DataStore<UnderlyingType_t<PixelT>> ConvertImageToDataStore(itk::Image<PixelT, D
}

template <typename T>
concept NotBoolT = !std::is_same_v<T, bool>;
concept NotBoolT = !

Check failure on line 387 in src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Common/ITKArrayHelper.hpp

View workflow job for this annotation

GitHub Actions / clang_format_pr

code should be clang-formatted [-Wclang-format-violations]
std::is_same_v<T, bool>;

template <NotBoolT NewStoreT, class PixelT, uint32 Dimension>
Result<> ConvertImageToDataStore(DataStore<NewStoreT>& dataStore, itk::Image<PixelT, Dimension>& image)
Expand Down Expand Up @@ -414,7 +415,7 @@ Result<> ConvertImageToDataStore(DataStore<NewStoreT>& dataStore, itk::Image<Pix
constexpr auto destMaxV = static_cast<float64>(std::numeric_limits<NewStoreT>::max());
constexpr auto originMaxV = std::numeric_limits<T>::max();
std::transform(rawBufferPtr, rawBufferPtr + pixelContainer->Size(), dataStore.data(), [](auto value) {
float64 ratio = static_cast<float64>(value) / originMaxV;
float64 ratio = static_cast<float64>(value) / static_cast<float64>(originMaxV);
return static_cast<NewStoreT>(ratio * destMaxV);
});
}
Expand Down

0 comments on commit 09cbbf0

Please sign in to comment.