# Cross-section area plot and transforms

**URL:** <https://discourse.slicer.org/t/cross-section-area-plot-and-transforms/20030>\
**Category:** Development\
**Created:** [October 6, 2021, 1:32am UTC](https://discourse.slicer.org/t/cross-section-area-plot-and-transforms/20030 "2021-10-06T01:32:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![hherhold](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hherhold/32/12199_2.png) [@hherhold](https://discourse.slicer.org/u/hherhold)\
**Post date:** [October 6, 2021, 1:32am UTC](https://discourse.slicer.org/t/cross-section-area-plot-and-transforms/20030/1 "2021-10-06T01:32:33Z")

</div>

Hey Andras, (@lassoan)

Quick question on your implementation of the cross-section area plot. I did a quick test on plotting the area of a segment, then I transformed the volume and segment (translation), and ran the same plot (row) again. I did harden the transform before re-running the plot, but I got the exact same plot, which is not what I would expect. I noticed some code to deal with transforms in the `run()` function - does this not deal with transforming the volume/segment via the transforms module?

Thanks!

-Hollister

---

<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:** [October 6, 2021, 1:46am UTC](https://discourse.slicer.org/t/cross-section-area-plot-and-transforms/20030/2 "2021-10-06T01:46:56Z")

</div>

Which module are you using for measuring cross-sectional area?

---

<div class="post-metadata">

**Author:** ![hherhold](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hherhold/32/12199_2.png) [@hherhold](https://discourse.slicer.org/u/hherhold)\
**Post date:** [October 6, 2021, 1:47am UTC](https://discourse.slicer.org/t/cross-section-area-plot-and-transforms/20030/3 "2021-10-06T01:47:51Z")

</div>

The one in the sandbox.

---

<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:** [October 6, 2021, 2:53am UTC](https://discourse.slicer.org/t/cross-section-area-plot-and-transforms/20030/4 "2021-10-06T02:53:47Z")

</div>

Translation should not change the plot, because the x axis of the cross-section plot is in voxels.

You may also try the new [Segment Geometry extension](https://github.com/jmhuie/Slicer-SegmentGeometry).

---

<div class="post-metadata">

**Author:** ![hherhold](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hherhold/32/12199_2.png) [@hherhold](https://discourse.slicer.org/u/hherhold)\
**Post date:** [October 6, 2021, 10:17am UTC](https://discourse.slicer.org/t/cross-section-area-plot-and-transforms/20030/5 "2021-10-06T10:17:40Z")

</div>

I tried both translation and rotation, but didn’t see a difference in the plot. I thought translation might be easier to tell a difference because the start slice should change.

I’ll take a look at that extension - thanks!

---

<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:** [October 6, 2021, 11:59am UTC](https://discourse.slicer.org/t/cross-section-area-plot-and-transforms/20030/6 "2021-10-06T11:59:22Z")

</div>

If you apply any rigid transform to the segmentation or will not change the cross-sectional area computed but the module in the sandbox. That module computes the cross-sectional area in the internal labelmap axis directions and if you apply a rigid (translarion, rotation) transform then the entire labelmap is transformed (along with the axes). You can change the segmentation node’s geometry using specify geometry button or use the Segment Geometry extension to get cross-sectional area along an arbitrary direction.

---

<div class="post-metadata">

**Author:** ![hherhold](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hherhold/32/12199_2.png) [@hherhold](https://discourse.slicer.org/u/hherhold)\
**Post date:** [October 6, 2021, 2:13pm UTC](https://discourse.slicer.org/t/cross-section-area-plot-and-transforms/20030/7 "2021-10-06T14:13:29Z")

</div>

Got it.

The Segment Geometry extension is excellent - thanks for the info!!
