Skip to content

Commit

Permalink
BUG: Fix ImageGeom::computeCellIndex, RotateSampleRefFrame,and SIMPLA…
Browse files Browse the repository at this point in the history
…rray::operator*

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
  • Loading branch information
imikejackson committed Mar 6, 2023
1 parent b7748ea commit d26b133
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Source/SIMPLib/Common/SIMPLArray.hpp
Expand Up @@ -505,7 +505,7 @@ class IVec3 : public SIMPLArray<T, 3>
}
inline IVec3 operator*(const IVec3& v) const
{
return IVec3(X_VAL * v.x, Y_VAL * v.y, Z_VAL * v.z);
return IVec3(X_VAL * v[0], Y_VAL * v[1], Z_VAL * v[2]);
}
inline T dotProduct(const IVec3<T>& v) const
{
Expand Down
10 changes: 5 additions & 5 deletions Source/SIMPLib/CoreFilters/RotateSampleRefFrame.cpp
Expand Up @@ -459,15 +459,15 @@ class RotateSampleRefFrameImpl
RotateSampleRefFrame::RotateSampleRefFrame()
: p_Impl(std::make_unique<Impl>())
{
std::vector<std::vector<double>> defaultTable{{1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0}};
std::vector<std::vector<double>> defaultTable{{1.0, 0.0, 0.0, 0.0}, {0.0, 1.0, 0.0, 0.0}, {0.0, 0.0, 1.0, 0.0}, {0.0, 0.0, 0.0, 1.0}};

m_RotationTable.setTableData(defaultTable);
m_RotationTable.setDynamicRows(false);
m_RotationTable.setDynamicCols(false);
m_RotationTable.setDefaultColCount(3);
m_RotationTable.setDefaultRowCount(3);
m_RotationTable.setMinCols(3);
m_RotationTable.setMinRows(3);
m_RotationTable.setDefaultColCount(4);
m_RotationTable.setDefaultRowCount(4);
m_RotationTable.setMinCols(4);
m_RotationTable.setMinRows(4);
}

// -----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion Source/SIMPLib/Geometry/ImageGeom.cpp
Expand Up @@ -1234,7 +1234,7 @@ ImageGeom::ErrorType ImageGeom::computeCellIndex(const float coords[3], size_t i
return static_cast<ImageGeom::ErrorType>(i * 2 + 1);
}
index[i] = static_cast<size_t>((coords[i] - m_Origin[i]) / m_Spacing[i]);
if(index[i] > m_Dimensions[i])
if(index[i] >= m_Dimensions[i])
{
return static_cast<ImageGeom::ErrorType>(i * 2 + 1);
}
Expand Down

0 comments on commit d26b133

Please sign in to comment.