Reproduce:
- Load US4DCyl from MITK Data
- Change timestep
- Create new Segmentation
- Choose static = Crash!
Reproduce:
Status | Assigned | Task | ||
---|---|---|---|---|
Resolved | kalali | T27476 [Segmentation] Crash if new segmentation is created with timestep different than 0 | ||
Resolved | floca | T27490 Correct handling of time points selected by SliceNavigator |
mitk::ProportionalTimeGeometry::GetGeometryForTimeStep returns nullptr during
mitk::Vector3D spacing = workingNode->GetData()->GetGeometry(time_position)->GetSpacing() inside QmitkSlicesInterpolator::SetCurrentContourListID().
Obviously because IsValidTimeStep(timeStep)) for e.g. timestep = 2 is false.
A static mask is generated in QmitkSegmentationView::CreateNewSegmentation() with
const auto refTimeGeometry = image->GetTimeGeometry(); auto newTimeGeometry = mitk::ProportionalTimeGeometry::New(); newTimeGeometry->SetFirstTimePoint(refTimeGeometry->GetMinimumTimePoint()); newTimeGeometry->SetStepDuration(refTimeGeometry->GetMaximumTimePoint() - refTimeGeometry->GetMinimumTimePoint()); mitk::Image::Pointer newImage = selector->GetOutput(); newTimeGeometry->SetTimeStepGeometry(image->GetGeometry(), 0); newImage->SetTimeGeometry(newTimeGeometry);
So a static mask contains only a single timestep with duration 4ms in this case. It is not possible to select timestep = 2.
We could add a check in QmitkSlicesInterpolator::SetCurrentContourListID()
before / inside
// In case the time is not valid use 0 to access the time geometry of the working node unsigned int time_position = 0; if (m_LastSNC->GetTime() != nullptr) time_position = m_LastSNC->GetTime()->GetPos();
to either always use time_position = 0 or to check for 4D-data.
Please check if problem still persists as soon as T27490 is merged into develop or directly with D329 (is open for review by the way ;)
Seems to be resolved because D329 changed
// In case the time is not valid use 0 to access the time geometry of the working node unsigned int time_position = 0; if (m_LastSNC->GetTime() != nullptr) time_position = m_LastSNC->GetTime()->GetPos();
to
const auto timePoint = m_LastSNC->GetSelectedTimePoint(); // In case the time is not valid use 0 to access the time geometry of the working node unsigned int time_position = 0; if (!workingNode->GetData()->GetTimeGeometry()->IsValidTimePoint(timePoint)) { MITK_WARN << "Cannot accept interpolation. Time point selected by SliceNavigationController is not within the time bounds of WorkingImage. Time point: " << timePoint; } time_position = workingNode->GetData()->GetTimeGeometry()->TimePointToTimeStep(timePoint);
Needs to be verified when D329 has been landed and merged.
As D329 is now landed. I think this is an low hanging fruit to check if the problem still exists ;)