Page MenuHomePhabricator

Image cropper takes really long to crop a volume.
Closed, ResolvedPublic

Description

In order to reproduce it, open a volume (Pic3D for example), select a volume with the yellow box, press crop and wait 20 minutes.

Related Objects

StatusAssignedTask
ResolvedNone
ResolvedNone

Event Timeline

patch (dashboard is red...)patch (dashboard is red...)

Call "is point inside" the box is the cause for the long processing time.

Removing it works fine (realtime) as long as the boundingbox was not rotated.

Fix so far:

check if box was rotated
if not, no inside testing
if yes, old code. (slow)

Fix idea for next bug party:
if yes, calculate intersection primitives ("pyramides") and set outside value for this volume

Thiago, you said that you committed something. Is it only trunk commit 17706 or is there more?

Ok, looks like it. I submitted these changes and some recent GUI changes in Qt4 with revision 17707 to the 0.12.2 branch.

Reopend this bug. It is fixed only for cases where the bounding box is NOT rotated. Otherwise the cropping still takes way too much time. Should be fixed, but not for the 0.12.2 release.

Original version must be restored because of a mistake. We incorrectly assumed that the bounding object could only be a cuboid. For the faster version using cuboid, a new class is being implemented (CuboidObjectCutter), and the bundle (ImageCropper) will be modified to use this new class.

c18042

ImageCropper was modified to use new itkCuboidObjectCutter, which implements a faster version of volume cropping for cuboids. At the moment, it only works fast for cuboid which are not rotated.

c18636

Variable not fund bug resolved with commit c18637

[SVN revision 21890]
ENH (#2125): A user complained in the MITK list that the image cropper was still taking long to crop. I asked for a test image, in which he was having trouble. We found out that it was a vector parallelity checking error, for which we gave now a tolerance.

The issue of repositioning of the image geometry after cropping was also fixed. Now the cropped image stays in the same place.

[SVN revision 21893]
FIX (#2125): The problem lied on the IsInside method of the Cuboid. It used the WorldToIndex transform of its geometry, which computed at every single call the inverse of the transformation. The inverse was then computed for every single voxel. It was modified to use the VTK transform, which caches the inverse.

Merging "applicazion modules" component with "ExtApp plugins"