Page MenuHomePhabricator

MRI Perfusion crashes (sometimes) when using signal to concentration conversion
Closed, ResolvedPublic

Description

OS: Win, MacOS, Linux

The MRI perfusion view crashes (often, but not always) if data is fitted with a signal conversion.

Some information / clues:

  • The crashes do not happen if "no conversion" is activated
  • The crashes do not happen if conversion was done before hand with the conversion view and then is directly selected for the fitting (also using "no conversion"). So the conversion itself is not the problem.
  • It seems to be a regression within the last 5-6 Months, because the problem was not known in the MITKModelFit paper version.
  • The crashes seem to more likely if the data sets has more time points (e.g. the unit test data set for 2CXM is likely to have it)

Revisions and Commits

rMITK MITK

Event Timeline

floca triaged this task as High priority.Apr 18 2019, 4:40 PM
floca created this task.

Narrowed down the point where it crashes.

Its in mitk::PixelBasedParameterFitImageGenerator::DoParameterFit line 111 (mitk::CastToItkImage(frameMITKImage, frameImage))

for (unsigned int i = 0; i < this->m_DynamicImage->GetTimeSteps(); ++i)
{
  typename InputFrameImageType::Pointer frameImage;
  imageTimeSelector->SetTimeNr(i);
  imageTimeSelector->UpdateLargestPossibleRegion();

  Image::Pointer frameMITKImage = imageTimeSelector->GetOutput();
  frameCache.push_back(frameMITKImage);
  mitk::CastToItkImage(frameMITKImage, frameImage);
  fitFilter->SetInput(i,frameImage);
}

The time step that crashes seems to be random, but is valid. The crash itself is down in come itk::BoundingBox checks.

Stack trace of the crash:

MitkCore.dll!itk::ObjectFactory<itk::BoundingBox<unsigned long,3,double,itk::VectorContainer<unsigned long,itk::Point<double,3> > > >::Create() Zeile 60
MitkCore.dll!itk::BoundingBox<unsigned long,3,double,itk::VectorContainer<unsigned long,itk::Point<double,3> > >::New() Zeile 90
MitkCore.dll!mitk::BaseGeometry::SetBounds(const itk::FixedArray<double,6> & bounds) Zeile 148
MitkCore.dll!mitk::BaseGeometry::SetFloatBounds(const float * bounds) Zeile 112
MitkCore.dll!mitk::BaseGeometry::Initialize() Zeile 97
MitkCore.dll!mitk::BaseGeometry::BaseGeometry() Zeile 45
MitkCore.dll!mitk::SlicedGeometry3D::SlicedGeometry3D() Zeile 33
MitkCore.dll!mitk::SlicedGeometry3D::New() Zeile 72
MitkCore.dll!mitk::Image::Initialize(const mitk::PixelType & type, unsigned int dimension, const unsigned int * dimensions, unsigned int channels) Zeile 897
MitkCore.dll!mitk::ImageTimeSelector::GenerateOutputInformation() Zeile 35
ITKCommon-4.13d.dll!itk::ProcessObject::UpdateOutputInformation() Zeile 1577
ITKCommon-4.13d.dll!itk::ProcessObject::UpdateLargestPossibleRegion() Zeile 1897
MitkModelFit.dll!mitk::PixelBasedParameterFitImageGenerator::DoParameterFit<double,4>(itk::Image<double,4> * __formal) Zeile 109

It seems to beeing correlated with the addition of the generated concentration node to the data storage. If the nodes are not added to the datastorage, I cannot provoke a crash. This is at least concistent to the finding that there is also no proplem if we calculate the concentration beforehand.

The reason why a node has problems in the processing and with casting time point images when it is added to the storage is unclear to me. Maybe it is some racing condition between some observers triggered by the storage addition and the code used in the fitting thread.

I would like to understand the problem better, but due to the fact, that I have not the time to dig deep into it and want to get the crash be fixed as fast as possible, I will just cure the symptoms for now and only add the concentration image after the fit was produced.