Commit c5a752c4 authored by Sreekanth Arikatla's avatar Sreekanth Arikatla
Browse files

Merge branch 'fix/check-sdf-type' into 'master'

BUG: abort processing in SignedDistanceField if cast fails

See merge request iMSTK/iMSTK!604
parents 74845b1d 40dcb2d8
......@@ -88,14 +88,11 @@ SignedDistanceField::SignedDistanceField(std::shared_ptr<ImageData> imageData, s
m_bounds = m_imageDataSdf->getBounds();
m_shift = m_imageDataSdf->getOrigin() - m_imageDataSdf->getSpacing() * 0.5;
if (m_imageDataSdf->getScalarType() != IMSTK_DOUBLE)
LOG(WARNING) << "SignedDistanceField requires double input image";
m_scalars = std::dynamic_pointer_cast<DataArray<double>>(m_imageDataSdf->getScalars());
CHECK(m_scalars != nullptr)
<< "SignedDistanceField requires doubles in the input image";
// \todo: Verify the SDF distances
Markdown is supported
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