# How can I configure Slicer to open automatically with my preferred settings for the View Controllers module?

**URL:** <https://discourse.slicer.org/t/how-can-i-configure-slicer-to-open-automatically-with-my-preferred-settings-for-the-view-controllers-module/20233>\
**Category:** Support\
**Tags:** views\
**Created:** [October 19, 2021, 11:49am UTC](https://discourse.slicer.org/t/how-can-i-configure-slicer-to-open-automatically-with-my-preferred-settings-for-the-view-controllers-module/20233 "2021-10-19T11:49:35Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![DIV](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/div/32/12816_2.png) [@DIV](https://discourse.slicer.org/u/DIV)\
**Post date:** [October 19, 2021, 11:49am UTC](https://discourse.slicer.org/t/how-can-i-configure-slicer-to-open-automatically-with-my-preferred-settings-for-the-view-controllers-module/20233/1 "2021-10-19T11:49:35Z")

</div>

There are certain repeated actions that I do repeatedly that are becoming repetitious…

For instance, adding yellow rulers to each of the three slice viewers requires _many mouse clicks_. (This is true no matter whether it’s done through the View Controllers module or the equivalent drop-down toolbars in, say, the four-up view port.)

- Assuming that I want these always to **appear by default** when I launch 3D Slicer, is there a convenient way to **configure** that? (And similar things such as no interpolation of background, preferred display of orientation marker, …) [_I have no idea._]
- If the settings are desired, say, 50% of the time, is there a convenient way to write a **script** for this in Python, so that the user-defined display settings can be implemented collectively with just a couple of mouse clicks? [_I guess that it may be possible, given the existence of the Python Interactor — which I’ve never used._]

—DIV

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [October 19, 2021, 12:42pm UTC](https://discourse.slicer.org/t/how-can-i-configure-slicer-to-open-automatically-with-my-preferred-settings-for-the-view-controllers-module/20233/2 "2021-10-19T12:42:04Z")

</div>

A series of tasks such as adding yellow rulers to the slice views can be performed using the slicerrc file discussed at [Application settings — 3D Slicer documentation](https://slicer.readthedocs.io/en/latest/user_guide/settings.html#application-startup-file).

Pretty much everything can be automated through python coding. See the [Slicer script repository](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html) for some examples. There also other posts on the forum that have answered the coding type questions you have asked.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [October 19, 2021, 2:24pm UTC](https://discourse.slicer.org/t/how-can-i-configure-slicer-to-open-automatically-with-my-preferred-settings-for-the-view-controllers-module/20233/3 "2021-10-19T14:24:09Z")

</div>

> [@DIV](#):
>
> Assuming that I want these always to **appear by default** when I launch 3D Slicer, is there a convenient way to **configure** that?

Edit-\>application settings-\>view  
The choose your ruler type.

---

<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 20, 2021, 4:58am UTC](https://discourse.slicer.org/t/how-can-i-configure-slicer-to-open-automatically-with-my-preferred-settings-for-the-view-controllers-module/20233/4 "2021-10-20T04:58:20Z")

</div>

> [@DIV](#):
>
> no interpolation of background

I would strongly recommend not doing this. It introduces staircases in the image signal that are not present in the original continuous signal. See details in this discussion:

> [@Volume display - Interpolate turned off by default in newest stable?](https://discourse.slicer.org/t/volume-display-interpolate-turned-off-by-default-in-newest-stable/13918/10):
>
> Interpolated image shows you the faithfully reconstructed continuous signal from the discrete samples. This reconstruction is lossless if sample-rate criterion is satisfied (see more details [here](https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem)). The criterion is not always satisfied - that’s when you see staircase artifacts in the reconstructed image (in both slice views, volume rendering, and reconstructed surfaces): Interpolation is still about the best thing you can do, and definitely provides much more faithful reconstruction …

---

<div class="post-metadata">

**Author:** ![DIV](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/div/32/12816_2.png) [@DIV](https://discourse.slicer.org/u/DIV)\
**Post date:** [October 20, 2021, 7:14am UTC](https://discourse.slicer.org/t/how-can-i-configure-slicer-to-open-automatically-with-my-preferred-settings-for-the-view-controllers-module/20233/5 "2021-10-20T07:14:37Z")

</div>

Thanks, muratmaga.  
Indeed it is helpful to set _a few key view settings_ through  
Edit-\>application settings-\>view

However it doesn’t allow _every_ option to be pre-configured there (and nor should it). For instance, the colour of the ruler cannot be specified there.

---

<div class="post-metadata">

**Author:** ![DIV](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/div/32/12816_2.png) [@DIV](https://discourse.slicer.org/u/DIV)\
**Post date:** [October 20, 2021, 7:34am UTC](https://discourse.slicer.org/t/how-can-i-configure-slicer-to-open-automatically-with-my-preferred-settings-for-the-view-controllers-module/20233/6 "2021-10-20T07:34:33Z")

</div>

Hello, Andras.  
From your cited discussion I found:

> [@Volume display - Interpolate turned off by default in newest stable?](https://discourse.slicer.org/t/volume-display-interpolate-turned-off-by-default-in-newest-stable/13918/10):
>
> I agree that it can be useful to show the voxel grid during segmentation so that you know how fine details you can paint and where. Note that this is the grid of the binary labelmap representation of the segmentation and not the grid of the background scalar volume.

So this is interesting for two reasons.  
Firstly, I am mainly interested in this for segmentation.  
Secondly, I am not sure of what is being used to define the grid of a segment if not the grid of a scalar volume.

On the latter point, so far I had found the segments (e.g. from the **Threshold** effect) rather jagged for small features, so recently I have been creating new _scaled_ cropped volumes from these small objects (through the **Crop Volume** module, with **Spacing scale** set to, say, 0.50x or 0.20x and with the **Interpolator** set to “B-spline”).  
So I suspect — correct me if I’m wrong — that this would avoid some of the staircase issues you’re talking about, because interpolation is still performed somewhere along the way.  
On the other hand, perhaps I’m overlooking a clever feature in Slicer whereby I can use a refined grid for the segment, different from any extant volume??

—DIV

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [October 20, 2021, 3:17pm UTC](https://discourse.slicer.org/t/how-can-i-configure-slicer-to-open-automatically-with-my-preferred-settings-for-the-view-controllers-module/20233/7 "2021-10-20T15:17:20Z")

</div>

> [@DIV](#):
>
> However it doesn’t allow _every_ option to be pre-configured there (and nor should it). For instance, the colour of the ruler cannot be specified there.

There are simply too many ways people want to configure things. Preferences are only allows a a small subset of common things.  
That’s why there is a startup script (.slicerrc.py) that you can configure not exposed options in the UI in the way you want.

---

<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 21, 2021, 2:25am UTC](https://discourse.slicer.org/t/how-can-i-configure-slicer-to-open-automatically-with-my-preferred-settings-for-the-view-controllers-module/20233/8 "2021-10-21T02:25:54Z")

</div>

> [@DIV](#):
>
> So this is interesting for two reasons.  
> Firstly, I am mainly interested in this for segmentation.  
> Secondly, I am not sure of what is being used to define the grid of a segment if not the grid of a scalar volume.

You can use many volumes to create the segments and not all of them have the same size and resolution. Also, you typically want the segmentation to be isotropic and sometimes you want it to be somewhat finer resolution than the input volume (to be able to represent small details that are actually not visible in the image, but the clinician knows that they are there and may want to define them with higher precision than the input image).

> [@DIV](#):
>
> So I suspect — correct me if I’m wrong — that this would avoid some of the staircase issues you’re talking about, because interpolation is still performed somewhere along the way.

Staircase effect is mostly due to anisotropic spacing. Using Crop volume with isotropic spacing option eliminates this artifact. You can set the segment’s geometry using the “Specify geometry” button, then the user does not need to resample the volume (the segment editor module resamples it internally). However, typically it is simpler, more clear, and more memory efficient if the user crops and resamples the input volume before segmentation.

---

<div class="post-metadata">

**Author:** ![DIV](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/div/32/12816_2.png) [@DIV](https://discourse.slicer.org/u/DIV)\
**Post date:** [October 22, 2021, 4:09am UTC](https://discourse.slicer.org/t/how-can-i-configure-slicer-to-open-automatically-with-my-preferred-settings-for-the-view-controllers-module/20233/9 "2021-10-22T04:09:24Z")

</div>

> [@muratmaga](#):
>
> > [@DIV](#):
> >
> > However it doesn’t allow _every_ option to be pre-configured there (and **nor should it** ).  
> > […]
> 
> […]That’s why there is […] not exposed options in the UI in the way you want.

Thanks, Muratmaga, but I did not express the preference for _all_ options to be able to be set individually through the settings menu — actually, I expressed the opposite view (emphasis added above).  
—DIV

P.S. Another alternative (which I haven’t raised before) is for Slicer to simply ‘remember’ _(almost) all settings from the previous session_ automatically (e.g. ruler colour, but not the zoom). This could get complicated if multiple instances of Slicer are launched with different viewport settings, and some users mightn’t like it, so if implemented there could be a tickbox in the settings menu to enable/disable it.

---

<div class="post-metadata">

**Author:** ![DIV](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/div/32/12816_2.png) [@DIV](https://discourse.slicer.org/u/DIV)\
**Post date:** [October 22, 2021, 4:42am UTC](https://discourse.slicer.org/t/how-can-i-configure-slicer-to-open-automatically-with-my-preferred-settings-for-the-view-controllers-module/20233/10 "2021-10-22T04:42:55Z")

</div>

> [@lassoan](#):
>
> You can use many volumes to create the segments and not all of them have the same size and resolution. Also, you typically want the segmentation to be isotropic and sometimes you want it to be somewhat finer resolution than the input volume […].  
> […]  
> You can set the segment’s geometry using the “Specify geometry” button, then the user does not need to resample the volume (the segment editor module resamples it internally).

So then from your comments and the documentation at [Segment editor — 3D Slicer documentation](https://slicer.readthedocs.io/en/latest/user_guide/modules/segmenteditor.html) I think I understand now.

- Each Segmentation must be associated with a Volume (providing radiodensity) and a Geometry (providing the grid) at any given moment.
- The Geometry of the Segmentation can be identical to the geometry of its Master Volume, or it can be a modified version of that (_e.g_. forced to be isotropic), or it can be based on a totally different source (possibly a Volume, with prespecified geometry, or perhaps a ROI with a customisable user-specified geometry).
- From time to time the Volume and/or Geometry on which a Segmentation is based can be changed.

> [@lassoan](#):
>
> Staircase effect is mostly due to anisotropic spacing. Using Crop volume with isotropic spacing option eliminates this artifact. […] [T]ypically it is simpler, more clear, and more memory efficient if the user crops and resamples the input volume before segmentation.

Thank-you, Andras, I appreciate your advice, and will be aware of the benefits of applying isotropic sampling in future. I had avoided this until now because I naïvely assumed that applying _more transformations_ would likely introduce _more artefacts_!  
I am glad to hear that cropping the volume is considered an efficient approach — at least for my purposes, where the individual features of interest might occupy less than 1% of the whole original scan volume.  
—DIV

---

<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 22, 2021, 7:06pm UTC](https://discourse.slicer.org/t/how-can-i-configure-slicer-to-open-automatically-with-my-preferred-settings-for-the-view-controllers-module/20233/11 "2021-10-22T19:06:27Z")

</div>

> [@DIV](#):
>
> Each Segmentation must be associated with a Volume (providing radiodensity) and a Geometry (providing the grid) at any given moment.

You only need a volume for editing segmentations. Some Segment Editor effects would not need it, but it was easier to just make this a prerequisite for segmentation.

> [@DIV](#):
>
> The Geometry of the Segmentation can be identical to the geometry of its Master Volume, or it can be a modified version of that ( _e.g_ . forced to be isotropic), or it can be based on a totally different source (possibly a Volume, with prespecified geometry, or perhaps a ROI with a customisable user-specified geometry).

Correct.

> [@DIV](#):
>
> From time to time the Volume and/or Geometry on which a Segmentation is based can be changed.

Correct. Since image resampling is a lossy operation, and it is particularly bad for binary images, it is better to avoid changing geometry of existing segmentations. However, a one-time cropping and resampling to isotropic spacing before starting segmentation is usually beneficial.
