Skip to content
Snippets Groups Projects
Commit f0aca516 authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

ENH: proper computation of output size

parent 8ff77020
No related branches found
No related tags found
No related merge requests found
...@@ -253,10 +253,8 @@ void Multi3DMapToDEMFilter<T3DImage, TMaskImage, TOutputDEMImage>::SetOutputPara ...@@ -253,10 +253,8 @@ void Multi3DMapToDEMFilter<T3DImage, TMaskImage, TOutputDEMImage>::SetOutputPara
typename TOutputDEMImage::RegionType outRegion; typename TOutputDEMImage::RegionType outRegion;
outRegion.SetIndex(0, 0); outRegion.SetIndex(0, 0);
outRegion.SetIndex(1, 0); outRegion.SetIndex(1, 0);
outRegion.SetSize(0, static_cast<unsigned int> ((box_xmax - box_xmin) / vcl_abs(outSpacing[0]) + 1)); outRegion.SetSize(0, static_cast<unsigned int>(vcl_floor((box_xmax - box_xmin) / vcl_abs(outSpacing[0]) + 0.5)));
//TODO JGT check the size outRegion.SetSize(1, static_cast<unsigned int>(vcl_floor((box_ymax - box_ymin) / vcl_abs(outSpacing[1]) + 0.5)));
//outRegion.SetSize(1, static_cast<unsigned int> ((box_ymax - box_ymin) / vcl_abs(outSpacing[1])+1));
outRegion.SetSize(1, static_cast<unsigned int> ((box_ymax - box_ymin) / vcl_abs(outSpacing[1])));
outputPtr->SetLargestPossibleRegion(outRegion); outputPtr->SetLargestPossibleRegion(outRegion);
outputPtr->SetNumberOfComponentsPerPixel(1); outputPtr->SetNumberOfComponentsPerPixel(1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment