# Help on customizing synchronization behavior for linked views of different volumes

**URL:** <https://discourse.slicer.org/t/help-on-customizing-synchronization-behavior-for-linked-views-of-different-volumes/26712>\
**Category:** Development\
**Created:** [December 13, 2022, 2:55pm UTC](https://discourse.slicer.org/t/help-on-customizing-synchronization-behavior-for-linked-views-of-different-volumes/26712 "2022-12-13T14:55:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Long\_Zhang](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/long_zhang/32/13519_2.png) [@Long\_Zhang](https://discourse.slicer.org/u/Long_Zhang)\
**Post date:** [December 13, 2022, 2:55pm UTC](https://discourse.slicer.org/t/help-on-customizing-synchronization-behavior-for-linked-views-of-different-volumes/26712/1 "2022-12-13T14:55:31Z")

</div>

Hi,

When comparing two volumes of the same patient but different studies, it would be good to overlay the same portion together. Thus, I wondering how to customize the default behavior of scrolling, moving, scalling operations, such that they are not simple broad casting physical position through different sliceviews, but with a specified offset to overlay the same part together.

An example looks like this:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/6/b68e78bdeec7772fe947e5ffa8458afc813d0ada.jpeg)

Thanks in advance!

All the best,  
Long

---

<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:** [December 14, 2022, 6:56am UTC](https://discourse.slicer.org/t/help-on-customizing-synchronization-behavior-for-linked-views-of-different-volumes/26712/2 "2022-12-14T06:56:46Z")

</div>

This is already supported: you can apply a the “offset” as a transform using Transforms module.

You can compute the correct alignment transform by [automatic or semi-automatic image registration](https://slicer.readthedocs.io/en/latest/user_guide/registration.html).

---

<div class="post-metadata">

**Author:** ![Long\_Zhang](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/long_zhang/32/13519_2.png) [@Long\_Zhang](https://discourse.slicer.org/u/Long_Zhang)\
**Post date:** [December 15, 2022, 8:50am UTC](https://discourse.slicer.org/t/help-on-customizing-synchronization-behavior-for-linked-views-of-different-volumes/26712/5 "2022-12-15T08:50:36Z")

</div>

We already know the offset for each voxels for the two volumes. But we donot know how to customize the default behavior of scrolling, scaling, zooming, etc. to apply such values. In this way, the two volumes can be displayed in a way where the locations under the cursor are aligned. The transform is not nessary in this case as the two volumes are original DICOM volumes, and the offsets are manipulated.

---

<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:** [December 15, 2022, 2:35pm UTC](https://discourse.slicer.org/t/help-on-customizing-synchronization-behavior-for-linked-views-of-different-volumes/26712/6 "2022-12-15T14:35:05Z")

</div>

> [@Long\_Zhang](#):
>
> But we donot know how to customize the default behavior of scrolling, scaling, zooming, etc. to apply such values.

Linking of views sets the slice views to the same physical location. To make the content consistently aligned in all views I would recommend applying the known transform.

Of course, you can do everything in 3D Slicer, and if you want you can browse slices with arbitrary offset/rotation between them. There are many ways to achieve this. To recommend the most suitable method, could you describe your clinical end goal?

In the meantime, here is a simple method for offset slice browsing without any custom scripting:

- create a linear transforms `ReslicingTransform` and `OffsetTransform
- set `ReslicingTransform` be a parent of `OffsetTransform`

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/9/39e2b7371738f93098668ab2c9cb27fbb67dc48d.png)

- use `Volume Reslice Driver` module to move the green and yellow slices with these transforms in `Transverse` mode

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/1/715467b3e87ee4561343add32b1f7bb9237d35d8.png)

- browse slices by adjusting the `ReslicingTransform`
- adjust offset between slices using `OffsetTransform`
