IDEA ibeat Tutorial Version 1.1, Feb 10, 2012
Navigation About ibeat Install ibeat Main Window Image Preprocessing Brain Extraction Tissue Segmentation Brain Labeling Others Acknowledgement
About ibeat ibeat is an Infant Brain Extraction and Analysis Toolbox with graphical user interfaces for processing infant brain MR images. The ibeat is developed by the IDEA group at the University of North Carolina at Chapel Hill, directed by Dr. Dinggang Shen (dinggang_shen@med.unc.edu).
About ibeat The Processing Pipeline of Infant Brain MR Images Processing Images Infant Brain MR Images Preprocessed Images Brain Images Tissue Images Infant Brain Labels Disk Disk Disk Disk Disk
About ibeat Overview of the Processing Modules 1. Image Preprocessing: Reorient original infant T1/T2/FA images interactively to the same orientation as a selected template image. Resampling (to the same size as the template) is applied to the reoriented images automatically. N3 correction is then performed on the reoriented and resampled images. 2. Brain Extraction: Strip the skull and remove the cerebellum from the preprocessed image automatically. The automatically extracted brain image can then be edited manually to obtain a more accurate brain image (optional). 3. Tissue Segmentation: Segment gray matter, white matter and CSF from the extracted brain images. Non-longitudinal T1/T2/FA images (single time point) are processed by coupled segmentation and a single tissue image is generated. Longitudinal T1/T2/FA images (multiple time points) are segmented together and a longitudinally segmented tissue image is generated at each time point. 4. Brain Labeling: Label the segmented brain tissues with assistance of the atlas of a selected template (HAMMER registration is used).
About ibeat Image modalities T1, T2, FA Arrangement of Subject Images File format analyze (.hdr with.img) Subject image files should be arranged as follows: The folder including subject images The folder including images of all time points for a subject. No blank space or - is allowed in the subject name. The folder including images at a time point for a subject. The folder name consists of the subject name and month (connected with - ) in each folder (each time point) NOTE: month must be integer. subject name, month and modality Month 0 indicates 0~30 days NOTE: T2 is required for month 0 ~ 5 T1 is required for month >= 6 FA is optional for each time point
ibeat Installation Linux operating system is required Installation steps: Download the ibeat package and unzip the ibeat.zip (e.g., the package is unzipped in /home/programs/ibeat). Setup environment for the ibeat as follows: Edit the shell resource file in the home directory of the user (cd ~) : a) Add the following two lines in the.cshrc file if csh/tcsh is used setenv IBEAT_HOME /home/programs/ibeat source $IBEAT_HOME/ibeatEnv.csh b) Add the following two lines in the.bashrc file if bash is used export IBEAT_HOME=/home/programs/ibeat source $IBEAT_HOME/ibeatEnv.bash Restart the shell to update the environment. Use command ibeat to start the software.
Main Window
Main Window
Image Preprocessing Functionality of the Image Preprocessing Module: Reorient original images interactively to the same orientation as the template image. Resampling (to the same size as the template) is applied to the reoriented images automatically. N3 correction is then performed on the reoriented and resampled images. Image Preprocessing Module
Image Preprocessing Functionality of the Image Preprocessing Module: It consists of four parts: Processing Flow: integrates functions in the pipeline of the image reorientation. Image Preprocessing Module Subject Images: lists all loaded images and the processed images Image View: windows for interactive inspection of the images. Processing Status: show hints for image reorientation steps and data processing status.
Image Preprocessing Step 1: Image Loading 1 2 Image Loading Module 3 4 select the subject folder subject images will be loaded automatically. 5
Image Preprocessing Functions in the Image Loading Module: 1. Load images of all subjects: select Automatic in A > D > select the folder including all the subjects. 2. Add all images of a subject: select Subject j in A and Automatic in B > D > select the j-th subject folder. 3. Add all images at a time point for a subject: select Subject j in A, Month i in B and Automatic in C > D > select the i-th time point folder in the j-th subject folder. 4. Add an image at a time point for a subject: select Subject j in A, Month i in B and T1,T2 or FA in C > D > select the T1, T2 or FA image in the i-th time point folder in the j-th subject folder. A B C D 5. Preview an image: left mouse click the image name to display three orthogonal slices of the image. NOTE: the displayed slices may not be consistent with the Axial, Coronal and Sagittal statement before reorientation. 6. Delete a selected (left mouse click) image: right mouse click in the image list window and press the Delete Images popup menu. Image List 7. Delete images at a time point: left mouse click a time point (e.g., Month 6) > right mouse click and press the Delete Images popup menu. 8. Delete all images of a subject: left mouse click a subject (e.g., Subject 1) > right mouse click and press the Delete Images popup menu. 9. Delete selected images: use Shift or Ctrl key and left mouse button to select images > right mouse click and press the Delete Images popup menu.
Image Preprocessing Step 2: Interactive Image Inspection After all longitudinal images are loaded, press Finish to return to the Image Preprocessing Module. The loaded images will be in the Subject Images list. Left mouse click an image in the Subject Images list to display three orthogonal 2D slices and 3D slices of the image. Right mouse click in the Subject Images list to view the property of the selected image, or delete the image. Review slices: mouse wheel over the 2D slices (in the Axial, Coronal and Sagittal windows), or use the slider. Zoom in/out 2D slices: right mouse button down (over the 2D slices) and move up/down. Pan 2D slices: left mouse button down (over the 2D slices) and drag. Cross: left mouse button down (over the 2D slices) Image Preprocessing Module
Image Preprocessing Step 2: Interactive Image Inspection (3D slices) Rotate 3D slices: press the toggled button R, then left mouse button down upon the 3D slices and move the mouse Zoom 3D slices: press the toggled button Z, then left mouse button down upon the 3D slices and move up/down Pan 3D slices: press the toggled button P, then left mouse button down upon the 3D slices and move the mouse NOTE: Click the toggled button R, Z and P to enable or disable the related manipulation functions. Rotate Zoom Pan Image Preprocessing Module
Image Preprocessing Step 3: Image Reorientation and Resampling The loaded images must be reoriented and resampled to the same orientation and size as the selected template. The template is used in the preprocessing and brain labeling steps. The standard orientation used in ibeat is shown in the left image and all the standard templates have the same volume size (256x256x198) and voxel size (1x1x1). Reorient and resample the loaded images by: 3 (determine the loaded images to be reoriented and resampled) -> 4 (set reorientation parameters, resampling is applied automatically) -> 5 (reorient and resample the related loaded images) The processed images will be saved as analyze format and stored with the original image files. 2 1 3 4 5 Image Preprocessing Module
Image Preprocessing Step 3: Image Reorientation and Resampling Preview reorientation and resampling result of a selected image: choose Selected option in 1 -> select a loaded image in 2 (subject images list) -> set reorientation parameters in 3 -> 4. Reorient and resample multiple loaded images: choose Selected option in 1 -> select multiple loaded images (use Ctrl/Shift and mouse) in 2 -> set reorientation parameters in 3 -> 4. Reorient and resample T1/T2/FA/All loaded images: choose T1/T2/FA/All option in 1 -> set reorientation parameters in 3 -> 4 1 3 4 Image Preprocessing Module 2
Image Preprocessing How to set the reorientation parameters? ( Method 1 ) Step 1: review all non-flip reorientation options by: 1 (select a loaded image) -> 2 (right click and choose Review Reorientation Options ). The selected image will be reoriented with all non-flip reorientation parameters, and the reoriented images with the parameters will be displayed. Step 2: review (use 3) and determine the correct reorientation parameters by comparing the reoriented images with the template image visually. Step 3: select the correct reorientation parameters (see 4), the parameters at 5 will be updated automatically. Image Preprocessing Module 5 3 4 1 2
Image Preprocessing How to set the reorientation parameters? ( Method 2 ) Step 1: find the sagittal, coronal and axial correspondences. e.g. preliminarily (xt, yt, zt) = (zo, xo, yo) Step 2: preview the reorientation result with the preliminary reorientation parameters. Template (xt, yt, zt) Template Image z Original (xo, yo, zo) A Selected Image x z x y y
Image Preprocessing How to set the reorientation parameters? ( Method 2 ) Step 3: check if the reoriented image is consistent with the template image (may flip). Step 4: set the correct reorientation parameters to reorient selected/t1/t2/fa/all images. (xt, yt, zt) = (-zo, -xo, yo) Template (xt, yt, zt) (xt, yt, zt) = (-xr, -yr, zr) Reoriented (xr, yr, zr) Anterior-Posterior Flip (in the y axis), and obey the right-hand rule) (xr, yr, zr) = (zo, xo, yo) Original (xo, yo, zo) z Template Image x z Reoriented Image x z The Original Image x y y y
Image Preprocessing Step 4: N3 Correction After all loaded images are reoriented and resampled to the same orientation and size as the selected template, N3 correction can be performed on the processed images by 1. NOTE: a processed image (M001-0-T1-reoriented) is named by appending -reoriented to the name of the original un-processed image (M001-0-T1). Image Preprocessing Module 1
Image Preprocessing Step 5: Start the Brain Extraction Module After all loaded images are preprocessed (reoriented, resampled, N3-corrected) in the Image Preprocessing Module, press Brain Extraction to start the Brain Extraction Module. All the preprocessed images will be transferred in the Subject Images list of the Brain Extraction Module automatically, and the Image Preprocessing Module will be closed automatically. Brain Extraction Module
Brain Extraction Step 1: Start the Brain Extraction Module Suppose preprocessed images are obtained by the Image Preprocessing Module, then the Brain Extraction Module can also be started from the main window. The preprocessed images (whose file names are ended with -reoriented, can be found where the original un-reoriented images are) can be loaded by 2 (the Image Loading Module will be started). 2 Brain Extraction Module 1
Brain Extraction Functionality of the Brain Extraction Module: To strip the skull and remove the cerebellum from the preprocessed image automatically. In addition, to edit the automatically extracted brain image manually to obtain a more accurate brain image (optional). The module structure is similar to the structure of the Image Preprocessing Module. Please refer to the image preprocessing for functions such as interactive image inspection. Brain Extraction Module
Brain Extraction Step 2: Extract Brain Images Firstly choose Selected/T1/T2/FA/All option by 1, then set parameters for brain extraction by 2, finally extract brains from the selected loaded images (preprocessed) by 3. Generally, the default parameters can be used. The extracted brain images will be saved as analyze format and stored with the original image files as well. If the loaded images are skull-stripped, please check the Cerebellum Removal only to remove the cerebellums without skull stripping. 1 Brain Extraction Module 2 3
Brain Extraction Step 3: Manually Edit the Extracted Brain Images Select the automatically extracted brain image > right mouse click and select the Manual Editing item on the popup menu. An overlay (red mask) from the automatically extracted brain image will be displayed with the un-extracted image (preprocessed image) in the Manual Image Editing Module. Manual Image Editing Module
Brain Extraction Step 3: Manually Edit the Extracted Brain Images 1. Click A (the Cross/Zoom/Pan/Slice toggled button) and then interactive inspect the image: Review slices: mouse wheel over the 2D slices (in the Axial, Coronal and Sagittal windows), or use the slider. Zoom in/out 2D slices: right mouse button down (over the 2D slices) and move up/down. Pan 2D slices: left mouse button down (over the 2D slices) and drag. Cross: left mouse button down (over the 2D slices). B D A C Manual Image Editing Module 2. Click B/C (the Painter / Eraser toggled button) and then paint/erase regions of interest to/from the overlay interactively. Painter/Eraser size: use the radius slider or just input the value (the radius size will be indicated in the slice windows, see the red circle under the cursor). 3D/2D Mask: select 3D/2D Mask to make the painting or erasing operation effective in 3D volume/2d slice space. 3. Overlay: Click Default, Clear and Undo in D to load default overlay, clear the current overlay and undo the last painting (or erasing) operation, respectively. E 4. Preview: Click E to preview the manually edited brain image obtained with the current overlay. Click Finish when the manually edited brain image is satisfactory.
Brain Extraction Step 4: Start the Tissue Segmentation Module After all brain images are extracted (cerebellum removal and manual image editing may be applied) from the loaded images (preprocessed) in the Brain Extraction Module, press Tissue Segmentation to start the Tissue Segmentation Module. All the extracted brain images will be transferred in the Subject Images list of the Tissue Segmentation Module automatically, and the Brain Extraction Module will be closed automatically. NOTE: an extracted brain image (M001-0-T1- reoriented-strip) is named by appending -strip to the name of the preprocessed image (M001-0-T1-reoriented). Tissue Segmentation Module
Tissue Segmentation Step 1: Start the Tissue Segmentation Module Suppose extracted brain images are obtained by the Brain Extraction Module, then the Tissue Segmentation Module can also be started from the main window. The extracted brain images (whose file names are ended with -strip, can be found where the original un-preprocessed and preprocessed images are) can be loaded by 2 (the Image Loading Module will be started). 2 Tissue Segmentation Module 1
Tissue Segmentation Functionality of the Tissue Segmentation Module: To perform longitudinal and coupled tissue segmentation across multiple time points and multiple modalities (T1/T2/FA) for each subject. Images of multiple modalities (T1/T2/FA) at each time point can be aligned automatically before longitudinal tissue segmentation (skip the alignment if the brain images have been aligned). The module structure is similar to the structure of the Image Reorientation Module. Please refer to the image preprocessing for functions such as interactive image inspection. Tissue Segmentation Module
Tissue Segmentation Step 2: Segment Tissues and Start the Brain Labeling Module All the loaded images (extracted brain) can be processed by 1. The segmented tissue images will be saved as analyze format and stored with the original image files as well. Note: only one coupled tissue image will be generated at each time point. A segmented tissue image is named as, e.g., M001-0-reoriented-strip-seg, which has a -seg postfix but without modality information. After all segmented tissue images are obtained in the Tissue Segmentation Module, press 2 ( Brain Labeling ) to start the Brain Labeling Module. All the segmented tissue images will be transferred to the Brain Labeling Module. Tissue Segmentation Module 1 2
Brain Labeling Step 1: Start the Brain Labeling Module Suppose segmented tissue images are obtained by the Tissue Segmentation Module, then the Brain Labeling Module can also be started from the main window. The segmented tissue images (whose file names are ended with -seg, can be found where the original un-preprocessed, preprocessed and extracted brain images are) can be loaded by 2 (the Image Loading Module will be started). 2 Brain Labeling Module 1
Brain Labeling Step 2: Label Brain Images A template can be selected for brain labeling. NOTE: All standard templates used in ibeat are in the template folder of the package. Please make the orientation, image size and file format of a custom template the same as the ones of the standard templates, and name the custom template similarly (refer to the template files). Firstly choose Selected/All option by 3, then set parameters (the default ones can be used generally) for hammer registration by 4, finally label brains for the selected loaded images (segmented tissue images) by 5. The brain labels will be saved as analyze format and stored with the original image files as well (ended with -aal ). 2 1 3 4 5 Brain Labeling Module
Brain Labeling Brain Labels The anatomical description of regions in -aal image is detailed in the following table. The definition is originally from N. Tzourio-Mazoyer et al, Neuroimage, 15: 273-289, 2002, but now it is warped into infant spaces.
Others Image file name regulation of the ibeat software: subject-month-modality -> subject-month-modality-reoriented -> subject-month-modality-reoriented-strip -> subject-month-reoriented-strip-seg -> subject-month-reoriented-strip-seg-aal The tool for the display of an image: To select and view an image of analyze format. The tool for interactive editing of the brain image: To select a preprocessed image file (reoriented and resampled) and edit the brain interactively. If the automatically extracted brain image is available in the same folder, it will be detected and used as the default brain overlay. If the automatically extracted brain image is not available, brain extraction can be performed firstly. The interactively edited brain image will be saved with the preprocessed image and named with a postfix -strip. Sample Data: M001 (month 0, 6, 9, 25) in the sample folder of the ibeat package
Others Programming languages: The graphical user interfaces and overall framework of the ibeat software were implemented in MATLAB. The image processing functions were implemented with the combination of C/C++, MATLAB, Perl and Shell languages. Parallel processing: Eight separate and parallel threads are used for image processing. In the preprocessing, brain extraction and brain labeling steps, all the images are processed by the separate threads in parallel. In the longitudinal tissue segmentation step, all time points are processed by separate threads in parallel. The parallel strategy accelerates the image processing largely. Image processing efficiency: The processing speed is mainly dependent on the number of subjects, number of time points, number of images, number of processor cores of the computer and the computing performance of each processor core. Provide the number of subjects is numsubject, number of images is numimage, size of each image is 256x256x198, and the number of processor cores is numcore (<=8). The rough estimated processing time is as follows: 1. Image reorientation and resampling: 1 x numimage x scale (second) 2. N3 correction: 1.7 x scale (minute) 3. Skull stripping and cerebellum removal: 17 x scale (minute) 4. Longitudinal tissue segmentation: 2.7 x scale (hour) 5. Brain labeling: 25 x scale (minute) where scale = ceil(numimage/numcore) for 1, 2, 3, 5 and scale = ceil(numsubject/numcore) for 4. ceil(x) is the nearest larger integer of x.
Acknowledgement ibeat is developed by the IDEA group at the University of North Carolina at Chapel Hill. Dinggang Shen initiated the project idea and direct the development of the software. Yakang Dai, Feng Shi, Li Wang implemented functions and wrote the codes. The development of the software is partially supported by NIH grants EB006733, EB008374, MH088520 and EB008760 to Dinggang Shen. The brain extraction function used the method proposed by Shi et al [1]. The tissue segmentation function used the method proposed by Wang et al [2,3]. The brain labeling used the HAMMER registration method proposed by Shen et al [4]. Portions of functions of the ibeat software were implemented based on the FSL library developed by the Analysis Group, FMRIB, Oxford, UK, the MINC package developed by the McConnell Brain Imaging Centre of the Montreal Neurological Institute, McGill University, and the ITK toolkit from the Kitware Inc. [1] Feng Shi, Li Wang, John H. Gilmore, Weili Lin and Dinggang Shen. Learning-based Meta-Algorithm for MRI Brain Extraction. MICCAI 2011, Toronto, Canada, Sep. 18-22, 2011. [2] Li Wang, Feng Shi, Pew Thian Yap, John H Gilmore, Weili Lin and Dinggang Shen. Accurate and Consistent 4D Segmentation of Serial Infant Brain MR Images. Multimodal Brain Image Analysis (MBIA 2011), Toronto, Canada, Sep. 18, 2011. [3] Li Wang, Feng Shi, Pew-Thian Yap, Weili Lin, John H. Gilmore, Dinggang Shen. Longitudinally guided level sets for consistent tissue segmentation of neonates. Hum Brain Mapp. 2011. [4] Dinggang Shen and Christos Davatzikos. HAMMER: Hierarchical Attribute Matching Mechanism for Elastic Registration. IEEE Transactions on Medical Imaging, 21(11):1421-1439, 2002.