Page MenuHomePhabricator

mitkBoundingObjectCutter behavior changed from 2012.12 to 2013.03
Closed, WontfixPublic

Assigned To
Authored By
morency
May 2 2013, 5:18 PM
Referenced Files
F991: toy_999.nrrd
May 2 2013, 5:20 PM
F990: 2013_03_move.png
May 2 2013, 5:19 PM
F989: 2013_03_orig.png
May 2 2013, 5:19 PM
F988: 2012_12_move.png
May 2 2013, 5:19 PM

Description

The mitkBoundingObjectCutter produces different results from 2012.12 to 2013.03 using the exact same bounding box and the same image (see attachements). IMO, the behavior of 2012.12 is correct and the behavior of 2013.03 is not.

2012_12_orig.png (875×949 px, 14 KB)

Event Timeline

Original test image

The bug seems resolved in 2013.06

Nevermind my previous comment, it's still there. The issue seems to come from the lines

mitk::SlicedData::IndexType  index=m_InputRequestedRegion.GetIndex(); //init times and channels
mitk::BoundingBox::PointType min = boBoxRelativeToImage->GetMinimum();
index[0] = (mitk::SlicedData::IndexType::IndexValueType)(std::ceil(min[0]));
index[1] = (mitk::SlicedData::IndexType::IndexValueType)(std::ceil(min[1]));
index[2] = (mitk::SlicedData::IndexType::IndexValueType)(std::ceil(min[2]));

mitk::SlicedData::SizeType   size = m_InputRequestedRegion.GetSize(); //init times and channels
mitk::BoundingBox::PointType max = boBoxRelativeToImage->GetMaximum();
size[0] = (mitk::SlicedData::SizeType::SizeValueType)(std::ceil(max[0])-index[0]);
size[1] = (mitk::SlicedData::SizeType::SizeValueType)(std::ceil(max[1])-index[1]);
size[2] = (mitk::SlicedData::SizeType::SizeValueType)(std::ceil(max[2])-index[2]);

Setting them as they were in 2012.12 seems to fix the problem

mitk::SlicedData::IndexType  index=m_InputRequestedRegion.GetIndex(); //init times and channels
mitk::BoundingBox::PointType min = boBoxRelativeToImage->GetMinimum();
index[0] = (mitk::SlicedData::IndexType::IndexValueType)((min[0]+0.5));
index[1] = (mitk::SlicedData::IndexType::IndexValueType)((min[1]+0.5));
index[2] = (mitk::SlicedData::IndexType::IndexValueType)((min[2]+0.5));

mitk::SlicedData::SizeType   size = m_InputRequestedRegion.GetSize(); //init times and channels
mitk::BoundingBox::PointType max = boBoxRelativeToImage->GetMaximum();
size[0] = (mitk::SlicedData::SizeType::SizeValueType)((max[0]+0.5)-index[0]);
size[1] = (mitk::SlicedData::SizeType::SizeValueType)((max[1]+0.5)-index[1]);
size[2] = (mitk::SlicedData::SizeType::SizeValueType)((max[2]+0.5)-index[2]);

This bug is relevant for the upcoming release

Current release is finished. Reseting target milestone...

kislinsk claimed this task.
kislinsk added a subscriber: kislinsk.
This task was automatically closed because it wasn't updated at least since July 2016 (over 2 years). Please re-open this task if you think that it is still relevant. This most probably means that you will resolve it.