Hi,
I have built Slicer and wanted to change the view orientation of the application’s slices. I did what was said here, where the .ini config file is modified. This is the relevant part of my .config file :-
My application is still in radiological convention and I don’t know why. The only other things I am doing programatically is modifying the layout to be in the “FourUpView“, “ThreeOverThreeView“ and jumping slices to certain points in space. I don’t know if there is something else I might be doing which could be resetting the view orientation to the radiological convention. Any ideas or suggestions would be really helpful.
Make sure you modify the correct .ini file. You can get the path by typing this into the Python console:
slicer.app.userSettings().fileName()
You can confirm that you modified the file correctly by going to the menu → Edit / Application Settings / Views section and check “View orientation” option.
I have checked, and the modification of the option has been made. The “View orientation” option has the value “patient right is screen right”. Yet the slice view is coming with the “patient right is screen left” behaviour.
Would you have any suggestions on what might be something I am doing that could cause such behaviour?
I have built Slicer from source on a version a few commits ahead of 5.10 using SlicerCustomAppTemplate. Because I used the template(as it fetches the latest commit), I am on this version. I used the MRHead sample data on this built version, and the same behaviour is seen.
The pre-built, packaged slicer binary(5.10) is working properly on my machine. The pre-built application shifts to Neurological convention when I am modifying the “View orientation“ option or the appropriate .ini file.
I suspect that something I might be doing programmatically is unintentionally causing this. Would you have any suggestions on what I might be doing that is flipping the view?
Probably in your custom application you disabled the ViewControllers module, which initializes the orientation presets based on the application settings:
You can enable this module or add the relevant lines to one of your modules.
Hi @lassoan,
Thanks for directing me to the code snippet used to set the default slice orientation. I haven’t modified the view controller. Yet I used the same call in the code you directed me to, in my startup .slicerrc.py script :-
That makes sense, I only searched my source code and couldn’t find any ViewController code, I forgot to search the entire directory for the possible CMake configurations. I made the modification to the CMake file and was able to view it in neurological view without the startup code. Thanks a lot once again!
Out of curiosity, I wanted to ask why you have submitted the PR on SlicerCAT and not on SlicerCustomAppTemplate?