[mitk-users] Segmentation shift

2017-06-20 Thread Nil Goyette

Hi all,

My boss asked me to let the users decide if they want to reinit or not. 
They will live with the consequence of not being aligned if they don't. 
Of course I found this http://i.imgur.com/GKGKwmV.png I know this is a 
well-known bug and it has been repaired in 
https://phabricator.mitk.org/T22619 but I have a question about this bug.


Does anyone know why there's a shift and/or how it could be repaired? I 
mean, without a reinit, of course. I plan to fix it myself and it would 
help me if someone gives me some hints. Thank you for your time.


Nil


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users


[mitk-users] Special reinit

2017-06-20 Thread Nil Goyette

Hi all,

Lets start by saying that I know "Reinit" is not the right choice of 
word in this case! A reinit would reset the axis, as it should. Lets 
say, for the sake of the discussion, that I want a reinit that simply 
update the scene's bounding box, nothing else, like  [1] to [2] (made by 
hand, so not exact!):

- No camera modification, so everything is still at the same place
- Keep the axis rotated if they were
- Resize the scene if an object was added/deleted

I tried adding this snippet in RenderingManager::InitializeViews. In 
clear english: reuse the old geometry for the current plane, but update 
it with the new offset and bounds that we just calculated.


auto newGeo = timeGeometry->GetGeometryForTimeStep(0);
auto oldTimeGeo = nc->GetCreatedWorldGeometry();
auto oldGeo = oldTimeGeo->GetGeometryForTimeStep(0);

oldGeo->GetIndexToWorldTransform()->SetOffset(
  newGeo->GetIndexToWorldTransform()->GetOffset());
oldGeo->SetBounds(newGeo->GetBounds());

nc->SendCreatedWorldGeometryUpdate();

nc->SetInputWorldTimeGeometry(oldTimeGeo);
nc->Update();
...

This doesn't work; it throws the planes in strange places [3], probably 
because I broke their affine matrix. I tried many things but my biggest 
success was to remove the call to SetInputWorldTimeGeometry [4]. I 
checked in DisplayInteractor::Rotate to see if there was a way to find 
the old rotation applied to the plane but it doesn't seem to be possible.


Anyway, I'm mostly wondering how YOU, the mitk experts :), would do it. 
Thank you for your time.


Nil

[1] http://i.imgur.com/krzBvJV.png
[2] http://i.imgur.com/NWDQQqg.png
[3] http://i.imgur.com/7wwWczy.png
[4] http://i.imgur.com/m9jwrpE.png

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users