File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -337,9 +337,8 @@ CreateMosaic(itk::ants::CommandLineParser * parser)
337337 {
338338 if (d != direction)
339339 {
340- croppedSliceSize[count] = std::min (
341- size[d] - (itk::Math::abs (lowerBoundVector[count]) + itk::Math::abs (upperBoundVector[count])),
342- size[d]);
340+ croppedSliceSize[count] =
341+ size[d] - (itk::Math::abs (lowerBoundVector[count]) + itk::Math::abs (upperBoundVector[count]));
343342
344343 croppedSliceIndex[count] = itk::Math::abs (lowerBoundVector[count]);
345344 count++;
@@ -390,6 +389,7 @@ CreateMosaic(itk::ants::CommandLineParser * parser)
390389 {
391390 std::string offsetString = padWidthString.substr (padWidthString.find (std::string (" -" )) + 1 );
392391 offset = parser->Convert <int >(offsetString);
392+ // make offset negative because the minus sign in the string is the delimiter
393393 offset *= -1 ;
394394 }
395395
@@ -400,7 +400,7 @@ CreateMosaic(itk::ants::CommandLineParser * parser)
400400 if (d != direction)
401401 {
402402 croppedSliceSize[count] = std::min (maskRegion.GetSize ()[d] + 2 * offset, size[d]);
403- croppedSliceIndex[count] = maskRegion.GetIndex ()[d] - offset;
403+ croppedSliceIndex[count] = std::max ( 0 , static_cast < int >( maskRegion.GetIndex ()[d] - offset)) ;
404404 count++;
405405 }
406406 }
You can’t perform that action at this time.
0 commit comments