# Can't modify a table in "Tables" module after using "Landmark Registration" module

**URL:** <https://discourse.slicer.org/t/cant-modify-a-table-in-tables-module-after-using-landmark-registration-module/16069>\
**Category:** Development\
**Created:** [February 18, 2021, 10:16pm UTC](https://discourse.slicer.org/t/cant-modify-a-table-in-tables-module-after-using-landmark-registration-module/16069 "2021-02-18T22:16:51Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![giovform](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/giovform/32/4687_2.png) [@giovform](https://discourse.slicer.org/u/giovform)\
**Post date:** [February 18, 2021, 10:16pm UTC](https://discourse.slicer.org/t/cant-modify-a-table-in-tables-module-after-using-landmark-registration-module/16069/1 "2021-02-18T22:16:51Z")

</div>

To reproduce:

- Use the “Landmark Registration” module to register any pair of RGB images (I used ThinPlate Registration type);

- Go to the “Tables” module, create a new table, and try to add columns or rows using the interface. It will be irresponsive;

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [February 18, 2021, 11:51pm UTC](https://discourse.slicer.org/t/cant-modify-a-table-in-tables-module-after-using-landmark-registration-module/16069/2 "2021-02-18T23:51:58Z")

</div>

Can you share with us a scene with that you can reproduce this? Have you tried with the latest Slicer Preview Release?

---

<div class="post-metadata">

**Author:** ![giovform](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/giovform/32/4687_2.png) [@giovform](https://discourse.slicer.org/u/giovform)\
**Post date:** [February 19, 2021, 10:26am UTC](https://discourse.slicer.org/t/cant-modify-a-table-in-tables-module-after-using-landmark-registration-module/16069/3 "2021-02-19T10:26:43Z")

</div>

I have tried with the latest preview, and had the same problem.

Sending a scene won’t do much since the problem only happens when you acess the Landmark Registration module (you don’t even need to finish a registration, just add and select two plain jpg images to register and click apply to start the registration), and then access the Tables module, create a table and try to add columns and rows.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [February 19, 2021, 3:54pm UTC](https://discourse.slicer.org/t/cant-modify-a-table-in-tables-module-after-using-landmark-registration-module/16069/4 "2021-02-19T15:54:35Z")

</div>

Yes, I was able to replicate this behavior. After using LandmarkRegistration the `qMRMLTableView` gets into a bad state somehow. I have no idea why at this point.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [February 19, 2021, 3:56pm UTC](https://discourse.slicer.org/t/cant-modify-a-table-in-tables-module-after-using-landmark-registration-module/16069/5 "2021-02-19T15:56:03Z")

</div>

I could reproduce the issue, too. I’ll submit a fix today.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [February 19, 2021, 5:10pm UTC](https://discourse.slicer.org/t/cant-modify-a-table-in-tables-module-after-using-landmark-registration-module/16069/6 "2021-02-19T17:10:23Z")

</div>

The problem is caused by incorrect handling of batch processing in qMRMLTableView. I’ve pushed a [fix](https://github.com/Slicer/Slicer/pull/5475).

It is related to Landmark Registration module, which uses batch processing mode excessively. Probably the original intent was to speed up things, but switching to batch processing mode is a very expensive operation by itself, because it invalidates contents of widgets, so they need to rebuild themselves from scratch. Doing it for simple operations can cause very significant performance hit, especially when the scene has many nodes. Instead of scene-level batch processing, node-level start/end-modified and pause/resume-render should be used for performance optimization.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [February 19, 2021, 6:21pm UTC](https://discourse.slicer.org/t/cant-modify-a-table-in-tables-module-after-using-landmark-registration-module/16069/7 "2021-02-19T18:21:26Z")

</div>

Thanks for the fix @lassoan 👍

I suppose LandmarkRegistration could change, but I’ve never notice any performance issues related to batch processing mode, even in scenes with dozens of volumes and other things loaded (there are lots of other things that have _do_ need fixing in Landmark Registration though to make it more useful).

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [February 19, 2021, 6:53pm UTC](https://discourse.slicer.org/t/cant-modify-a-table-in-tables-module-after-using-landmark-registration-module/16069/8 "2021-02-19T18:53:28Z")

</div>

Each node selector, subject hierarchy view, etc. widget contain a scene model, which may take significant amount of time to rebuild from scratch after batch processing. If you load the brain atlas scene (it contains 1200 nodes) then each node selector adds about 5 ms, each subject hierarchy tree view adds about 15 ms to the time to get out of batch processing, which can easily add up to hundreds of ms. It may still be hardly noticeable, but if modules started to use batch processing to try to speed up simple operations then it would actually slow down the application.

I fully agree, though, that there are much more important things to improve in landmark registration.

---

<div class="post-metadata">

**Author:** ![giovform](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/giovform/32/4687_2.png) [@giovform](https://discourse.slicer.org/u/giovform)\
**Post date:** [February 19, 2021, 7:56pm UTC](https://discourse.slicer.org/t/cant-modify-a-table-in-tables-module-after-using-landmark-registration-module/16069/9 "2021-02-19T19:56:23Z")

</div>

Thank you @lassoan and @pieper. 👍
