Initialization Files

Updated for release version: 1.0.3-alpha

This page introduces the initialization process utilized my mgui; in particular, the use of initialization files ("init files") to set up the environment at launch time. It explains where to find an init file, how to specify it when launching mgui, and the various commands used to set up the environment.


ModelGUI uses an init file to set up the session environment (which is implemented by the static class InterfaceEnvironment). This includes a specification of the version, locale, and look-and-feel of the mgui session, as well as all the interface panels, possible interface graphics windows, and possible input/output (I/O) types. Objects such as session files, shape models, graphics window instances, etc., can also be specified in this file. Such a setup allows a highly customizable session for modelGUI; a user can choose from a variety of session types (e.g., one that is customized strictly for processing a specific fMRI project versus one for general purposes), and these session types can also be shared between users (e.g., if you wanted a colleague to view a particular session as-it-is, without requiring them to set it up themselves).

What follows is a description of how init files accomplish these tasks. At present, init files must be specified manually (i.e., by editing the text file in a text editor). In the future, a GUI will be provided to simplify this process.

File locations

In a standard installation of mgui, the init files will be located in the directory "resources/init". The default init file that comes with the installation is called "mgui.model.init". It is recommended to put all custom init files in this location as well, which is expected by the launch process.

Init file commands

Init file commands are processed sequentially, which means that order is potentially important. For instance, it is important to specify a database driver class before attempting to load a data source which depends on that driver. This is discussed further below. What follows is a list of the commands interpreted by mgui and a description of their syntax and how they function.

Default init file

This is the default init file for mgui-1.0.0-alpha. Comments (starting with "#") are added to explain the parts in better detail.

# set version
setVersion 1.0.21 [dev]
# set locale
setLocale en CA
# set units
addUnit spatial millimeter mm 0.001
addUnit spatial centimeter cm 0.01
addUnit spatial kilometer km 1000
addUnit spatial micrometer μm 0.000001
addUnit spatial mile mi 1609.344
# set logging
setLogFileAndConsole mgui_session
setLoggingType debug
# colour maps
# This command loads all the colour maps found in the specified directory
loadColourMaps cmaps
# node shapes
# This command loads all the graph node shapes found in the specified directory
loadGraphNodeShapes node_shapes
# set data source key file
# This command sets the current private key for password encryption from the specified file/URL.
# The command is optional; if not specified, a generic key will be used. Note that this file/URL should be
# stored in a trusted environment; it is the responsibility of the user to set permissions properly. A
# file can be generated using the generate_db_key script; see the README file for more.
# URLs which do not specify a protocol will be treated as files. Files which do not start with "/" will
# be treated as relative to the mgui home directory. 
setDataSourceKey data_sources/.dbkey
# jdbc drivers
# This command tells the environment to register the given classes as JDBC drivers, and make them available for use
# in the session. The optional third argument specifies an instance of DataSourceDialogPanel, which will be
# used to provide a specialized set up of the data source (if not specified, the default panel is used).
#addKnownDataSourceDriver mysql.driver mgui.interfaces.datasources.DataSourceListDialogPanel
#addKnownDataSourceDriver jdbc_odbc.driver
#addKnownDataSourceDriver tinysql.driver
#addKnownDataSourceDriver postgresql.driver mgui.interfaces.datasources.DataSourceListDialogPanel
# set look and feel
# Java uses a "look-and-feel" concept to provide customized GUI rendering for Swing components. Such libraries
# are available online, and can be used with mgui by setting them here. This command sets the look-and-feel
# to "NimROD" (see
# setLookAndFeel native
# setLookAndFeel java
setLookAndFeel com.nilo.plaf.nimrod.NimRODLookAndFeel
# preloaded data sources
# This command loads all datasources in the specified directory from parameters specified in a text files. 
# If the specified driver has not already been loaded using addKnownDataSourceDriver, mgui attempts to add a 
# new driver to the environment as well.
loadDataSources data_sources
# load graphic window classes (can also do this explicitly for efficiency)
# This command loads the various interface graphics types, which specifies which graphics windows are available
# in the session.
loadInterfaceGraphicClass Graphic3D
loadInterfaceGraphicClass Graphic2D
loadInterfaceGraphicClass Graph mgui.interfaces.graphs.InterfaceGraphDisplay
loadInterfaceGraphicClass "Data Table" mgui.interfaces.tables.InterfaceDataTable
loadInterfaceGraphicClass Console mgui.interfaces.console.InterfaceConsoleDisplay
loadInterfaceGraphicClass Plot mgui.interfaces.plots.InterfacePlotDisplay
# load interface panel classes
# This command loads the various interface panels into the session, which will show up as selections in the
# interface combo box.
loadInterfacePanelClass "Windows Panel"
loadInterfacePanelClass "Section Set Panel" mgui.interfaces.shapes.InterfaceSectionSetPanel
loadInterfacePanelClass "File Panel"
loadInterfacePanelClass "Datasource Panel" mgui.interfaces.datasources.InterfaceDatasourcePanel
loadInterfacePanelClass "Volume Panel" mgui.interfaces.shapes.volume.InterfaceVolumePanel
loadInterfacePanelClass "Mesh Panel" mgui.interfaces.shapes.mesh.InterfaceMeshPanel
loadInterfacePanelClass "Maps Panel" mgui.interfaces.maps.InterfaceMapPanel
loadInterfacePanelClass "Cortical Thickness Panel" mgui.interfaces.neuro.InterfaceCorticalThicknessPanel
loadInterfacePanelClass "Selection Panel" mgui.interfaces.InterfaceSelectionPanel
loadInterfacePanelClass "Queries Panel" mgui.interfaces.queries.InterfaceQueryPanel
loadInterfacePanelClass "Tools Panel"
loadInterfacePanelClass "Shapes Panel" mgui.interfaces.shapes.InterfaceShapesPanel
loadInterfacePanelClass "Shape Stats Panel" mgui.interfaces.shapes.ShapeStatsPanel
loadInterfacePanelClass "Pipelines Panel" mgui.interfaces.pipelines.InterfacePipelinesPanel
# load plot classes
loadInterfacePlotClass "Multiline Plot" mgui.interfaces.plots.sgt.SgtMultilinePlot
loadInterfacePlotClass "XY Scatter Plot" mgui.interfaces.plots.sgt.SgtScatterplot
# load video task classes
# This command loads video task types (instances of VideoTask) available for video processes
loadVideoTaskType SetView3D
loadVideoTaskType RotateView3D
loadVideoTaskType AttributeUpdate
# initial windows
# This command adds a graphic window to the display panel on launch
addGraphicsWindow Graphic3D "3D Window"
# load IO types: name, type (input or output), class (instance of InterfaceIO), dialog class, options class, file description, file extension filters
# This command loads the available I/O classes (instances of FileLoader or FileWriter) available in the session.
# These classes determine the type of data that can be input or output in the session. The command also specifies
# which dialog and options classes are associated with the I/O class; mgui uses these to provide user interaction.
# If no such class is available, the string "null" is used. Finally, the file description and associated extensions 
# are provided, which are used by the file browser.
loadIOType Workspace_out output null "Mgui Workspaces (*.workspace)" workspace
loadIOType ShapeModel3D_out output "Mgui shape models (*.smod, *.smod.gz, *.xml)" smod smod.gz xml
loadIOType ShapeModel3D_in input "Mgui Shape models (*.smod, *.smod.gz, *.xml)" smod smod.gz xml
loadIOType Minc_surf_in input "Minc surfaces (*.obj)" obj
loadIOType Minc_surf_out output "Minc surfaces (*.obj)" obj
loadIOType Minc_surf_data_out output "Minc surface data (*.txt)" txt
loadIOType Minc_surf_data_in input "Minc surface data (*.txt)" txt
loadIOType Caret_surf_paint_in input "Caret paint data (*.paint)" paint
loadIOType Caret_surf_paint_out output "Caret paint data (*.paint)" paint
loadIOType Caret_surf_metric_in input "Caret metric data (*.metric)" metric
loadIOType Caret_surf_out output "Caret surfaces (*.topo, *.coord)" topo coord
loadIOType Caret_surf_in input "Caret surfaces (*.topo, *.coord)" topo coord
loadIOType Caret_area_colour_in input "Caret area colour files (*.areacolor)" areacolor
loadIOType Caret_area_colour_out output "Caret area colour files (*.areacolor)" areacolor
loadIOType NameMap_in input null "Name maps (*.txt, *.nmap)" txt nmap
loadIOType NameMap_out output "Name maps (*.txt, *.nmap)" txt nmap
loadIOType MricroLut_in input "Mricro LUT (*.lut)" lut
loadIOType Network_in input "Network matrix files (*.net, *.txt)" net txt
loadIOType Mesh3D_in input "Tri surfaces (*.tri)" tri
loadIOType Mesh3D_out output "Tri surfaces (*.tri)" tri
loadIOType Duff_surface_in input "Duff surfaces (*.dfs)" dfs
loadIOType Nifti_volume_in input "Nifti volumes (*.hdr, *.nii, *.gz)" hdr nii gz
loadIOType Nifti_volume_out output "Nifti volumes (*.hdr, *.nii, *.gz)" hdr nii gz
loadIOType FSL_surface_in input "FSL surfaces (*.off)" off
loadIOType Freesurfer_surface_in input "Freesurfer surfaces (*.*)" *
loadIOType Freesurfer_surface_out output "Freesurfer surfaces (*.*)" *
loadIOType Freesurfer_surface_data_in input "Freesurfer surface data (*.curv, *.annot, *.label)" *
loadIOType Pajek_graph_in input "Pajek graphs (*.net)" net
loadIOType Discrete_cmap_out output "Discrete colour maps (*.cmap)" cmap
loadIOType Discrete_cmap_in input "Discrete colour maps (*.cmap)" cmap
loadIOType TrackVis_tracts_in input "TrackVis tract files (*.trk)" trk
loadIOType Point_set_3D_in input "PointSet 3D file (*.txt, *.pset3d)" txt pset3d
loadIOType Point_set_3D_data_in input "PointSet 3D data file (*.txt)" txt
loadIOType Point_set_2D_in input "PointSet 2D file (*.txt, *.pset2d)" txt pset2d
loadIOType Polygon_set_3D_in input "PolygonSet 3D files (*.txt *.poly3d)" txt poly3d
loadIOType Vector_set_3D_in input "VectorSet 3D files (*.txt *.vect3d)" txt vect3d
loadIOType Matrix_in input "Matrix files (*.txt, *.matrix)" txt matrix
loadIOType Matrix_out output null null "Matrix files (*.txt, *.matrix)" txt matrix
loadIOType Shape_3D_data_in input "Shape data files (*.txt *.sdata)" txt sdata
loadIOType Wunil_volume_in input "Wunil volumes (*.ifh)" ifh
loadIOType View3D_out output "View3Ds (*.view3d)" view3d
loadIOType View3D_in input null "View3Ds (*.view3d)" view3d
loadIOType ImportDataTableText input "Delimited Text (*.txt, *.csv)" txt csv
loadIOType ExportDataTableText output "Delimited Text (*.txt, *.csv)" txt csv
loadIOType String_vector_in input null "String vector (*.txt, *.svector)" txt svector
loadIOType Shape_xml_out output "Mgui Shape (*.xml, *.shape)" xml shape
loadIOType Gifti_in input "Gifti Surface (*.gii)" gii
loadIOType Gifti_out output "Gifti Surface (*.gii)" gii
loadIOType FSL_volume_in input "FSL volumes (*.mgz, *.mgh)" mgz mgh
loadIOType Minc_volume_in input "Minc volumes (*.mnc)" mnc
# Pipeline Process Libraries
loadPipelineProcessLibraries pipeline_process_libraries
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License