open-discussion > RE: use the package of MRIcroGL in common python coding and problem about remove haze in scripting
Jun 26, 2020  03:06 PM | Chris Rorden
RE: use the package of MRIcroGL in common python coding and problem about remove haze in scripting
I am assuming you are using the latest version (1.2.20200331). The extract function will remove haze. A minimal script might look like this: 
import gl
gl.loadimage('myBrain.nii')
gl.extract(1,1,3)

The help for this function describes the arguments:
extract (built-in function):
extract(|b,s,t) -> Remove haze from background image. Blur edges (b: 0=no, 1=yes, default), single object (s: 0=no, 1=yes, default), threshold (t: 1..5=high threshold, 5 is default, higher values yield larger objects)

You can see all the in-built functions and their usage by running the Scripting/Templates/Help menu item. The other scripts in the Scripting/Templates menu describe the functions in more detail. The NITRC wiki also provides a brief introduction to scripting. Feel free to contribute to the Wiki if you want to improve it for others.

Threaded View

TitleAuthorDate
Lance Liu Jun 26, 2020
RE: use the package of MRIcroGL in common python coding and problem about remove haze in scripting
Chris Rorden Jun 26, 2020
Lance Liu Jun 28, 2020
Chris Rorden Jun 28, 2020
Lance Liu Aug 2, 2020
Chris Rorden Aug 2, 2020
Lance Liu Aug 3, 2020
Chris Rorden Aug 3, 2020
Chris Rorden Jun 28, 2020