With a image with a non-null direction matrix, it failed during min/max computation
Set direction matrix to output and mask copying the input direction matrix to solve the problem
mask->SetRegions(input->GetLargestPossibleRegion());
mask->SetOrigin(input->GetOrigin());
mask->SetSpacing(input->GetSpacing());
+ mask->SetDirection(input->GetDirection());
mask->Allocate();
mask->FillBuffer(1);
}
outputImage->SetRegions(input->GetLargestPossibleRegion());
outputImage->SetOrigin(input->GetOrigin());
outputImage->SetSpacing(input->GetSpacing());
+ outputImage->SetDirection(input->GetDirection());
outputImage->Allocate();
outputImage->FillBuffer(0.0);
// Set output iterator