User interface of an iteration

The iterative mode enables you to sequentially run the same process on several input data. This is very similar to a batch mode, with a user-friendly interface. This means that, for each input file selected, you can adjust the parameters as required. For example, if you are converting several DICOM volumes, some can be converted to GIS format (.ima and .dim), and others can be converted to NIFTI format (.nii). This a very practical mode as it makes it possible to repeat the same process using different parameters (or not), on a group of input files. For instance, you can apply exactly the same process to all the brain images in a given protocol.

To use the iterative mode, follow the instructions below:

  1. Open the process or if you don't need to change a parameter for all processes, you can use the contextual menu Iterate and go directly to step 4.

  2. If necessary, modify a parameter, which will remain the same for all the repeated processes.

  3. Press the Iterate button on the bottom right. A new window opens.

  4. In the new window, select the input files with or . When you select the files in the filesystem with an additionnal interface appears enabling to select the files in several steps wich is useful when the files are in different directories. This list editor is also available from the icon through a right-click on the button. The list editor also enables to add, remove items and change their order in the list.

  5. If necessary, modify the process parameters of each iteration using . Note that the number of iterations with a given parameter should be equal to the number of input files. But if you set only one value, BrainVISA will use this value for all iterations.

  6. Once the input files and the parameters have been configured, press Ok.

  7. A new window appear, it is a pipeline composed of n iterations of the process. Via this new interface, you can view each process individually. You can also check or modify parameters.

  8. You can deselect processes if you do not want them to be run. See the paragraph about pipelines user interface for more details about the possible actions.

  9. All you have to do now is press Run to run all the processes. You can monitor the sequence of processes in the bottom part of the window. If an error occurs during a process, the iterative mode will go on to the next process.

Note

If Soma-workflow is available in your version of Brainvisa, a new button Run in parallel may be available. This feature enables to execute the processes of the iteration faster than before using available computing resources. More information about this feature in the chapter Parallel computing with Soma-Workflow.

Parameter values

Parameters can be modified at 3 levels:

  • Via the general interface of the process that you wish to iterate: this modification will then be applied to each instances.

  • Via the iteration dialog: use . As mentioned above, the number of iterations for a parameter must be equal to the number of input files, if you select only one value, this value will be used for each instances. Each parameter value will be applied to the process, depending on the input files order.

  • Via the iteration process window: you can modify the process parameters individually. The modification will only be applied to the current process.

Example: converting several files

In this example, we wish to convert 6 GIS images (.ima and .dim) in a database to NIFTI format (.nii).

  1. Select the conversion process: Tools -> converters -> Aims Converter.

  2. Select the preferredFormat parameter (NIFTI-1 image).

    Figure 3.18. Window 1: Process to be iterated

    Window 1: Process to be iterated
  3. Start up the iterative mode by clicking Iterate button.

  4. A new window is displayed:

    Figure 3.19. Window 2: Iteration dialog

    Window 2: Iteration dialog
  5. Select the volumes on which you want to run the process by clicking . A database file selector is displayed. Select 6 Raw T1 MRI (filter on the type). To select several files, use the Ctrl + left click combination.

    Figure 3.20. Window 3: Selecting files to iterate

    Window 3: Selecting files to iterate
  6. Click the Ok buttons in windows 3 and 2. A new window, containing all the processes appears.

    Figure 3.21. Window 4: Iteration window

    Window 4: Iteration window
  7. If you want, you can still modify the process parameters if necessary.

  8. To start the iteration, click Run

  9. When the iteration is finished, the following window is displayed:

    Figure 3.22. Window 5: Iteration completed

    Window 5: Iteration completed

Selecting a different value for each iteration

To select the value of a parameter in relation to the input values (i.e. value of preferredFormat in relation to value of read), you can proceed this way :

  1. After the fifth step, click on Ok button to return to window 2 :

    Figure 3.23. Window 3.1 : After selection of read parameters

    Window 3.1 : After selection of read parameters

  2. Click on of preferredFormat parameter

    Figure 3.24. Window 3.2 : Selection of preferredFormat parameters

    Window 3.2 : Selection of preferredFormat parameters

  3. Select the nth preferredFormat parameter in relation to nth read parameter with the menu:

    Figure 3.25. Window 3.3 : Selection of preferredFormat parameter

    Window 3.3 : Selection of preferredFormat parameter

    Figure 3.26. Window 3.4 : Selection of preferredFormat parameter

    Window 3.4 : Selection of preferredFormat parameter

  4. Click on Add (this selection of preferredFormat parameter corresponds to the first read parameter) :

    Figure 3.27. Window 3.5 : Validation of the first preferredFormat parameter

    Window 3.5 : Validation of the first preferredFormat parameter

  5. Do the same to select the value of the parameter in each iterations.

  6. Click on Ok button in windows 3.5 to return to the 6th steps :

    Figure 3.28. Window 3.6 : preferredFormat parameters selection

    Window 3.6 : preferredFormat parameters selection

  7. Click on Ok button in windows 3.6 to return to step 6