Skip to content
Snippets Groups Projects
Commit 460be60a authored by Manuel Grizonnet's avatar Manuel Grizonnet
Browse files

ENH: crop user defined box region with the LargestPossibleRegion

parent c47b9558
Branches
Tags
No related merge requests found
......@@ -478,6 +478,20 @@ ImageFileWriter<TInputImage>
{
inputRegion = m_FilenameHelper->GetBox();
otbMsgDevMacro(<< "inputRegion " << inputRegion);
if (!inputRegion.Crop(inputPtr->GetLargestPossibleRegion()))
{
// Couldn't crop the region (requested region is outside the largest
// possible region). Throw an exception.
// build an exception
itk::InvalidRequestedRegionError e(__FILE__, __LINE__);
e.SetLocation(ITK_LOCATION);
e.SetDescription("Requested box region is (at least partially) outside the largest possible region.");
e.SetDataObject(inputPtr);
throw e;
}
otbMsgDevMacro(<< "inputRegion " << inputRegion);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment