BARSTOOL Brain Extraction - dwong263/MAGIQ GitHub Wiki

Overview

This tab allows you to skull-strip your reference anatomical images. It functions as a graphical user interface wrapper to the bet command that is part of FSL.

Note that it's not necessary to use this interface or even FSL BET to skull-strip your images. You can use any method of skull-stripping.

Prepare Images

First select the non-skull-stripped image files you'd like to process. Click the Select Image Files button and select your images. Note that the images should be in the compressed NIFTI (*.nii.gz*) format. Next, click the Reorient Images (fslreorient2std) button. This will run the command fslreorient2std on all selected images.

The reoriented images will be located within the folder containing your non-skull-stripped image files and will carry the same names plus the _std suffix.

Identify Brain Isocenter

The next step is to identify the location of the brain isocenter for the currently loaded image file. You will know which file is currently loaded by checking the Console Output panel on the right-hand side of the interface. There will be a message saying --- Processing Image 1 of <n> ---, with <n> being the total number of images you selected.

Click the Launch FSLEyes button to load the image file into FSLEyes. Use the cursor in FSLEyes to find the brain isocenter.

Note down the voxel location that corresponds to your cursor ... ... and copy the values into the BARSTOOL.

You can now close FSLEyes and click the Confirm Brain Isocenter button.

Identify Intensity Threshold

After having identified the brain isocenter, you must now specify a comma-delimited list of desired test thresholds. These are fractional intensity thresholds (equivalent to setting the -f option in FSL's bet command); smaller values give larger brain outline estimates.

Click the Run Test FSL BET Using Above Thresholds button to produce bet results with the listed thresholds. These "test images" will be saved in the folder containing your non-skull-stripped image filess and will have the suffix _std_brain_f<threshold>.nii.gz.

Clicking the Check Test Thresholds button will open FSLEyes with all the "test images" loaded as overlays on the original non-skull-stripped image. Select an overlay in the Overlay List panel ...

... and slide the Opacity bar ( ) to visualize how well the corresponding test threshold performed.

Note down the best performing test threshold, and select it in the Select Best Threshold: drop down menu in BARSTOOL. Hit Confirm Intensity Threshold to confirm your selection.

Run Brain Extraction

Run bet with your selected fractional intensity threshold on the currently loaded image by clicking the Run Brain Extraction (FSL BET) button. This produces two files:

  1. A brain extracted image with the suffix _std_brain.nii.gz
  2. The corresponding mask with the suffix _std_brain_mask.nii.gz

It will also delete all of the test images generated in the previous step.

After this operation is complete, the application will load the next image (e.g. --- Processing Image 2 of <n> --- and re-enable the Launch FSLEyes button in the Identify Brain Isocenter panel. Process the next image starting from the Identify Brain Isocenter step.

Once all images are processed, the Select Image Files in the Prepare Images panel will be re-enabled allowing you to select and process your next set of images.

⚠️ **GitHub.com Fallback** ⚠️