The application will crash when cropping 4D dataset. The problem comes from the line
unitSpacingImageFilter->SetInput(input->GetVtkImageData(m_TimeStep));
in mitkExtractSliceFilter.cpp. At some point, the volume spacing of the VtkImageData is zero which cause the application to crash. A simple fix is to set the volume spacing before calling GetVtkImageData()
mitk::Image::ImageDataItemPointer volume = input->GetVolumeData(m_TimeStep); const float* spacing = input->GetSlicedGeometry(m_TimeStep)->GetFloatSpacing(); double dspacing[3] = {spacing[0], spacing[1], spacing[2]}; volume->GetVtkImageData(input)->SetSpacing(dspacing); unitSpacingImageFilter->SetInput(input->GetVtkImageData(m_TimeStep));
Te code above is also located in the GetVtkImageData() method. I don't know why (yet!) the spacing is not set properly the first time.