help > Autoscaling of Darkest/Lightest values and find max voxel in overlay
Showing 1-4 of 4 posts
Display:
Results per page:
Apr 17, 2026  12:04 AM | Christopher Hyatt - Olin Neuropsychiatry Research Center
Autoscaling of Darkest/Lightest values and find max voxel in overlay

I often scroll through 4-D nifti overlays (ICA components, maps, etc) and I created a volume_select Python script to move quickly to a different overlay. However, every time I move to a new overlay volume, the Darkest and Brightest values do some sort of autoscaling. 


A great option would be to turn off autoscaling and retain the values I set for the Darkest and Brightest values (e.g., for z-scored overlays, Darkest at 1.0 and Brightest at say 4.0 or 5.0). I created another Python script called minmax to set these values, but it doesn't appear that I can keep both volume_select and minmax open for running at the same time, but I don't want to have unload and load the two python scripts. 


I have the Lazarus source code and the Lazarus compiler, and can compile/link source to binary successfully. I haven't coded in Pascal though since the 1980's, but I do know C/C++. Is there some source code I could change/add to the code to add a button box to turn autoscaling on/off?


Also, is there a way to python script finding the max (or min) voxel value in the current overlay? I see there are cluster options, but I'm not sure how to use this to find max or min peak voxel values in an overlay.


Thanks so much,


Chris

  Edited (Apr 17, 2026  12:04 AM)
Apr 17, 2026  11:04 AM | Chris Rorden
RE: Autoscaling of Darkest/Lightest values and find max voxel in overlay

I will see if I can extend MRIcroGL. Note that we already have this feature in NiiVue, as shown by the "per-volume contrast" check box in this live demo:

https://niivue.com/demos/features/timeseries2.html

Apr 18, 2026  12:04 AM | Christopher Hyatt - Olin Neuropsychiatry Research Center
RE: Autoscaling of Darkest/Lightest values and find max voxel in overlay

Chris, thanks for the help.


I'm not sure how to use niivue. It looks promising, but seems like one needs to know javascript to make it work. Is there a tutorial?

Apr 18, 2026  10:04 PM | Christopher Hyatt - Olin Neuropsychiatry Research Center
RE: Autoscaling of Darkest/Lightest values and find max voxel in overlay

Chris, I used Codex and added the option to turn Darkest/Lightest autoscaling off. Seems to work fine. See attached for Options menu item. So need to add this feature. 


Is there a python script that I could write to find the max (or min/most neg) voxel in an overlay? 

Attachment: autoscale.png