File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Source/Plugins/Generic/GenericFilters Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -331,23 +331,32 @@ void FindBoundingBoxFeatures::find_boundingboxfeatures2D()
331331 int32_t xPoints = 0 , yPoints = 0 ;
332332 FloatVec3Type spacing;
333333
334+ size_t centroidShift0 = 0 ;
335+ size_t centroidShift1 = 1 ;
336+
334337 if (imageGeom->getXPoints () == 1 )
335338 {
336339 xPoints = imageGeom->getYPoints ();
337340 yPoints = imageGeom->getZPoints ();
338341 spacing = imageGeom->getSpacing ();
342+ centroidShift0 = 1 ;
343+ centroidShift1 = 2 ;
339344 }
340345 if (imageGeom->getYPoints () == 1 )
341346 {
342347 xPoints = imageGeom->getXPoints ();
343348 yPoints = imageGeom->getZPoints ();
344349 spacing = imageGeom->getSpacing ();
350+ centroidShift0 = 0 ;
351+ centroidShift1 = 2 ;
345352 }
346353 if (imageGeom->getZPoints () == 1 )
347354 {
348355 xPoints = imageGeom->getXPoints ();
349356 yPoints = imageGeom->getYPoints ();
350357 spacing = imageGeom->getSpacing ();
358+ centroidShift0 = 0 ;
359+ centroidShift1 = 1 ;
351360 }
352361
353362 boundbox[0 ] = xOrigin;
@@ -362,8 +371,8 @@ void FindBoundingBoxFeatures::find_boundingboxfeatures2D()
362371 sidetomove = 0 ;
363372 move = 1 ;
364373 mindist = std::numeric_limits<float >::max ();
365- x = m_Centroids[3 * i];
366- y = m_Centroids[3 * i + 1 ];
374+ x = m_Centroids[3 * i + centroidShift0 ];
375+ y = m_Centroids[3 * i + centroidShift1 ];
367376 coords[0 ] = x;
368377 coords[1 ] = x;
369378 coords[2 ] = y;
You can’t perform that action at this time.
0 commit comments