Anatomical Automatic Labeling Manual Woodworkers

1,2, David L. Chang 1,2, 1,2 and Edward F. Chang 1,2 * • 1Department of Neurosurgery, University of California, San Francisco, San Francisco, CA, United States • 2Center for Integrative Neuroscience, University of California, San Francisco, San Francisco, CA, United States In this article, we introduce img_pipe, our open source python package for preprocessing of imaging data for use in intracranial electrocorticography (ECoG) and intracranial stereo-EEG analyses. The process of electrode localization, labeling, and warping for use in ECoG currently varies widely across laboratories, and it is usually performed with custom, lab-specific code. This python package aims to provide a standardized interface for these procedures, as well as code to plot and display results on 3D cortical surface meshes.
It gives the user an easy interface to create anatomically labeled electrodes that can also be warped to an atlas brain, starting with only a preoperative T1 MRI scan and a postoperative CT scan. We describe the full capabilities of our imaging pipeline and present a step-by-step protocol for users. Introduction High-density electrocorticography (ECoG) is an invasive method where recordings are obtained directly from the surface of the brain in patients with medically intractable epilepsy.
This approach provides millimeter spatial and millisecond temporal resolution neurophysiological data from awake, behaving humans, which complements the information obtained from noninvasive approaches such as, fMRI, EEG, and MEG (). Programs Like Visual Logic Puzzle. Preprocessing of ECoG data typically relies on aligning a preoperative MRI scan to a postoperative CT scan or postoperative MRI, then electrodes are localized either manually or in a semi-automated fashion (;;;;;;;; ). Once electrodes are localized in the MRI, they are assigned anatomical labels, and then potentially warped to a common MNI atlas space for comparisons across subjects.
While many labs that perform ECoG research have their own methods for performing these steps, to our knowledge there exists no software package that incorporates all steps of image processing necessary for ECoG electrode localization and warping from start to finish. Here, we present a protocol to perform all of these steps, from pial surface reconstruction to CT coregistration, electrode identification and anatomical labeling, and warping to a common atlas space. We take advantage of tools provided in the nipy software package (), dural surface reconstruction from ielu (), 3D plotting in mayavi (; ), and extend on functions available in the MATLAB-based CTMR package ().
This protocol has been used to localize and label electrodes in our previously published work (;;;;; ). In an effort to promote open and affordable access to these tools, all requirements to run the pipeline (aside from physical hardware) are freely available for download at no cost to the user. We hope that this software will facilitate more efficient workflows within ECoG research labs and will aid in reproducibility across studies. Materials and Methods Subjects Here, we present electrode localizations from human subjects undergoing surgical treatment for intractable epilepsy. Subjects were implanted with high-density subdural intracranial electrode grids (AdTech 256 channels, 4 mm center-to-center spacing and 1.17 mm diameter), subdural electrode strips (1 cm spacing), and/or depth electrodes (5 mm spacing) as part of their clinical evaluation for epilepsy surgery. This study was carried out in accordance with the recommendations of the University of California, San Francisco Institutional Review Board with written informed consent from all subjects.
Knife Anatomy, names, components, parts, descriptions, definitions, terms. For the obverse side view, the text labeling the photo should clearly state that it is the. Step Up To Usmle Step 2 2nd Edition Free Download on this page. Find all the manufacturers of automatic labeler and contact them directly on DirectIndustry.
All subjects gave written informed consent in accordance with the Declaration of Helsinki. This protocol was approved by the University of California, San Francisco Institutional Review Board.
Example Data We include sample data for use with this pipeline so that the user may follow along with each of these steps and check their results. Sample data is available at and includes an AC-PC aligned T1 MRI scan, CT scan, and all intermediate and final files from the execution of img_pipe. This subject's data is shown in Figure. Other figures include data from this subject and others to illustrate a wide variety of scenarios that could be encountered when using our software.

We suggest that users who wish to follow along download this data set, then copy the files from the acpc and CT directories to a new Freesurfer subject directory. The user can then start from the prep_recon() step. The montage and electrode device details are specified in the dataset README file and accompanying montage file. Operating System Requirements 1. Computer running Linux or Mac OS X.
(Windows users should run this code on a virtual machine running Linux—plotting code will work natively on Windows, but freesurfer will not.) 2. Processor speed: at least 2 GHz 3.
RAM: 8 GB or higher recommended 4. Graphics card (optional): 3D graphics card and accelerated OpenGL drivers Installation and Third-Party Software Requirements In order to use the software described in this paper, the user will need to install the following third-party software packages: 1. Gcc compiler (for Apple, can be downloaded through Apple Developer Command Line tools in XCode) or C++ compiler (available for Windows at ) 2. Anaconda Python 2.7 or 3.5 (we recommend Anaconda python for ease of installation ). Python 3.6 is not currently supported. Conda installer (included with Anaconda python installation) 4.
Freesurfer (). Be sure to register and copy the license.txt file to the appropriate directory. If the user is running Windows, they will have to run Freesurfer through a virtual machine running Linux (see ). For warping depth electrodes, libboost C++ libraries (v1.41) (). Optional: If using an NVIDIA graphics card, some computations can be sped up by downloading and installing the CUDA libraries (we have found that CUDA v5.5 works with Freesurfer) 7.
For converting dicom to niftii, either use SPM12 or use dcm2nii binary (). After installing the software above, the img_pipe module is installed by running the following commands at the terminal.
We also suggest installing packages in a conda environment to avoid conflicts with any other installed software. Setting up the Directory Structure and Paths • Set up the paths. If using the bash shell, edit ~ /.bashrc, ~ /.bash_profile to add the following lines: $ export FREESURFER_HOME='/path/to/ freesurfer' $ source $FREESURFER_HOME/ SetUpFreeSurfer.sh $ export SUBJECTS_DIR='/path/to/ freesurfer/subjects' $ export DYLD_FALLBACK_LIBRARY_PATH='/usr/ lib:$DYLD_LIBRARY_PATH' For example FREESURFER_HOME might be /Applications/freesurfer/ or /usr/local/freesurfer; SUBJECTS_DIR is a directory of the user's choosing but is often /usr/local/freesurfer/subjects or /Applications/freesurfer/subjects. • After adding these lines to ~ /.bashrc or ~ /.bash_profile and saving the file, be sure to run: $ source ~/.bash_profile in the terminal. This will run these commands to set the appropriate environmental variables for use by img_pipe and Freesurfer. • Running img_pipe requires a good quality, high resolution (preferably 1 mm isotropic) pre-operative T1 structural scan and a post-operative CT scan for the patient, both in nifti format.
For specific requirements regarding T1 pulse sequences that work best, consult the Freesurfer beginners guide (). In general, a Siemens MPRAGE or GE SPGR sequence with excellent gray/white matter contrast will work well. • After downloading and installing the packages described above, create a new subject directory with the patient ID (for this paper, we will use the example ‘test_subj') in the freesurfer subjects directory (for example /usr/local/freesurfer/subjects/test_subj). In a terminal, run: $ mkdir $SUBJECTS_DIR/test_subj • In this directory, create the directories acpc and CT: $ mkdir $SUBJECTS_DIR/test_subj/acpc $ mkdir $SUBJECTS_DIR/test_subj/CT • Place the niftii format T1 scan in the acpc directory, and the niftii format CT scan in the CT directory. The T1 scan should be named T1_orig.nii and the CT scan should be named CT.nii.
Alignment of T1 Scan to AC-PC Axis It is recommended that the user align T1 scans to the anterior commissure-posterior commissure axis before processing in Freesurfer. This will provide better initial conditions for later warping steps, and will result in the creation of meshes in a standard orientation. While some programs are able to perform this alignment automatically (e.g., the Automatic Registration Toolbox, available as a linux command line tool: ), here we describe how to perform this process manually. Note: it is also possible to perform this alignment on the final surfaces and electrode files using Freesurfer's talairach.xfm file—see Section Other Notes for how to do this. • Alignment of the T1 scan to the anterior commissure-posterior commissure axis is performed in Freeview (Figure ). Open Freeview and load the unaligned T1 scan in the Volumes tab.
To aid in axis alignment, change the cursor style “long” in Preferences Cursor style “Long.” The color may also be changed if desired. • To adjust the rotation and translation of the image, select Tools Transform Volume. Adjust the roll (with Y (P-A)) and yaw (with Z (I-S)) as necessary to make sure the head is aligned. Check the axial view to make sure the eyes show equally in the same slice (see Figure vs. Figure, second panel for unaligned and aligned examples). Make sure the midsagittal line is vertical in the axial view (see Figure vs. Figure, first and third panels) and in the coronal view.
Choose Sample method “Cubic”. • Select the anterior commissure and adjust the pitch of the head so that it is in line with the posterior commissure on the horizontal axis (Figures, last panel). • Finally, move to the (0, 0, 0) RAS coordinate (not TkReg RAS, just RAS). In the Transform Volume tool, translate the image until the cursor is at the anterior commissure. • Once the brain is in a good orientation, click “Save Reg” and save the transformation matrix in the acpc directory as T1_reorient.lta.
Then, click “Save as” and save the reoriented T1 file as T1.nii in the acpc directory (e.g. (A) Unaligned T1 scan. From left to right: axial view shows vertical crosshair unaligned with longitudinal fissure, which can be corrected by adjusting yaw.
Next, another axial view depicts unequal size in eyes, which can be corrected by adjusting roll. Coronal view shows vertical crosshair unaligned with longitudinal fissure, which can also be corrected by adjusting roll. Lastly, the sagittal view shows that the horizontal crosshair is not aligned with the anterior commissure (AC) and posterior commissure (PC), which can be fixed by adjusting pitch. (B) Reoriented, ACPC aligned T1 scan with corrections in yaw, roll, and pitch.
From left to right: axial view shows crosshairs aligned with longitudinal fissure. Another axial view shows equal sized eyes. Next, coronal view shows vertical crosshair aligned with longitudinal fissure. Finally, sagittal view shows the anterior commissure (AC) and posterior commissure (PC) aligned on the horizontal axis. The origin (0, 0, 0) is set to the anterior commissure.
Overview of the Class FreeCoG • The img_pipe.py python module centers around the use of the class freeCoG, which is first initialized to contain information about a specific patient's data and has a number of methods that can be called to perform image coregistration, pial surface extraction, electrode anatomical labeling, and warping of electrodes into common space. • The freeCoG class contains the following attributes that should be specified during initialization: ◦ subj: [string] the name of the subject ID. In this protocol, we will use 'test_subj' as the subject ID.
◦ hem: [string], 'lh', 'rh', or 'stereo'. The hemisphere of implantation (can also be stereo for bilateral coverage) ◦ zero_indexed_electrodes: [boolean, default = True], if False, will use one-indexed numbering for electrodes.
This is important to note if your montage starts with electrode channel 1 vs. Electrode channel 0 (since zero-indexing is the python default). • The following should be specified during initialization if not already in the user's path. By default they will be set to the value in the environmental variables defined previously. ◦ subj_dir: [string]: specify the location of the freesurfer $SUBJECTS_DIR ◦ fs_dir [string]: the directory containing the Freesurfer executables, e.g., ‘/Applications/freesurfer’ • The class freeCoG also contains the following methods: ◦ prep_recon() ■ This method sets up the directory structure before running the Freesurfer pipeline.
◦ get_recon() ■ This method starts the Freesurfer recon-all pipeline, which takes a T1 scan and performs automatic extraction of the pial surface. ◦ convert_fsmesh2mlab() ■ This method converts the Freesurfer pial surfaces to triangle-mesh format for use/visualization in MATLAB and python. ◦ reg_img() ■ This method registers the CT to the T1 MRI. ◦ get_surface_warp() ■ This method performs the sulcal-based cortical surface warping for surface electrode warping to MNI atlas space. ◦ get_subcort() ■ This method performs automatic parcellation of the subcortical structures (from freesurfer's atlas-based parcellation), and saves them to triangle-mesh.mat files for use in MATLAB or python. ◦ get_cvsWarp() ■ This method performs a combined surface-based, volumetric, and elastic warping of single subject brains to an atlas space for accurate warping of depth electrodes into common space. ◦ apply_cvsWarp() ■ This method applies the resulting warp from get_cvsWarp() to the electrode coordinates.
◦ checkDepthWarps() ■ This method produces a PDF of each depth electrode in the subject's native space and in the common atlas space for error checking of warps. ◦ label_elecs() ■ This method automatically labels electrodes based on the freesurfer atlas parcellation. ◦ plot_recon_anatomy() ■ This method plots the anatomically labeled electrodes on a surface reconstruction. ◦ warp_all() ■ This method is a wrapper method for warping the electrodes and creating pdfs for quality checking. ◦ plot_brain() ■ This method is a wrapper function for plotting the surface reconstruction and electrodes. Running Surface Reconstructions in img_pipe Pial surface meshes are created in freesurfer, but freesurfer code is called from within img_pipe for ease of use.
First we must initialize the patient object, after which we may call the appropriate methods to execute surface reconstructions. Initializing the Patient in img_pipe • After AC-PC alignment as described above, start an ipython session and initialize the patient object. (Note: this process may be started in a Unix “screen” or “tmux” session if running on a remote server to avoid processes stopping after logout).
» import img_pipe » subj = 'test_subj' » hem = 'rh' » patient = img_pipe.freeCoG(subj = subj, hem = hem) Creating Pial Surface Reconstructions in Freesurfer • Next, prepare the directory structure for running Freesurfer by running the following command in an ipython session: » patient.prep_recon() This will create the directories elecs, mri, and mri/orig, and will copy the acpc-aligned T1.nii to mri/orig and convert it to Freesurfer mgz format. • Next, run the following step, which will call freesurfer's recon-all script. » patient.get_recon() This will create the directories bem, label, mri, scripts, src, stats, surf, tmp, touch, and trash and will run through the entire Freesurfer pipeline, which will produce a skull-stripped MRI, left and right hemisphere pial surfaces (as well as white matter and inflated surfaces), and anatomical labels for the surface and MRI files.
More information on this process is provided in the Freesurfer documentation () and is not discussed here. • The Freesurfer pial surfaces will be in the surf directory ( surf/lh.pial for left hemisphere, surf/rh.pial for right hemisphere), and the skull-stripped MRI will be in mri/brain.mgz • Pause point: Check the pial surfaces in freeview (Figure ) to assure that there is good correspondence between the pial surface and the gray/CSF boundary.
To check the pial surfaces, call patient.check_pial(), which will open a Freeview window with the MRI and pial surface loaded. Scroll through the slices and check whether the pial surface accurately corresponds to the MRI. Figure shows an example of a poor correspondence in the temporal lobe due to anatomical lesion – this pial surface would need to be corrected using edits to the white matter surface (). Figure shows good correspondence between the pial surface (yellow) and the underlying MRI. Figure shows how this surface appears in the 3D view.
Given a high quality T1 scan with minimal motion, the user should be able to extract a good quality pial surface that looks relatively smooth (without spiky artifacts) and that follows the underlying anatomy. • Note for those running code on a cluster: The user may change the call to recon-all in get_recon() to use a queue submission procedure of choice. For example, the call to recon-all can be specified in a ‘qsub’ command to send the command to an SGE cluster computing system. Converting Freesurfer Meshes to Triangle/Vertex Meshes for Use in MATLAB/Python • The lh.pial and rh.pial surfaces in freesurfer contain the data for plotting a triangle/vertex mesh, which can be used later in any 3D program (for example mayavi in python, Blender, Unity, or MATLAB). • To convert the freesurfer format to arrays of vertex coordinates (in surface RAS) and triangle indices, call the following method.
By default, this will create the pial surfaces for both the left and right hemisphere. » patient.convert_fsmesh2mlab() • This method can also be called with the optional keyword argument, which can also convert lh.white, rh.white, lh.inflated, and rh.inflated to triangle/vertex files. » patient.convert_fsmesh2mlab(mesh_name = 'inflated') • The surface meshes created will be available as the mat files /your/Freesurfer/subjects_dir/test_subj/ Meshes/lh_pial_trivert.mat and /your/Free surfer/subjects_dir/test_subj/ Meshes/ rh_pial_trivert.mat, can now be plotted with the following command, which plots the pial meshes of both hemispheres: » patient.plot_brain() Creation of Subcortical Meshes • In addition to the cortical pial surface meshes, the user can create surface meshes for the subcortical structures identified in freesurfer.
These surface meshes are created using a script created by Anderson M. Winkler (), which takes freesurfer labels (e.g., the voxels labeled as hippocampus, Figure ), and creates a 3D triangle mesh from these labels (Figure ). This method will create meshes for all subcortical structures labeled in Freesurfer (Figure ), including the left and right nucleus accumbens, amygdala, brain stem, caudate nucleus, ventricles (lateral, inferior lateral, third, and fourth), globus pallidus, hippocampus, putamen, thalamus, and ventral diencephalon. » patient.get_subcort() • The meshes will be stored in the subjects directory within Meshes/subcortical/. These meshes can also now be viewed with the following commands: >>>subcort_roi = patient.roi (name='your_subcortical_roi') >>>patient.plot_brain(rois=[subcort_roi]) • To show these ROIs in conjunction with the pial surface, they can be plotted simultaneously, while controlling color and opacity. >>>subcort_roi = patient.roi (name = 'your_subcortical_roi', color=(1.0, 0.0, 0.0)) >>>pial_roi = patient.roi (name = 'lh_pial', opacity=0.5) >>>patient.plot_brain(rois=[pial_roi, subcort_roi]). Subcortical mesh generation.
(A) Subcortical meshes are generated from parcellating the aseg.mgz file, which assigns a numeric value to each region of interest. Labels of interest are extracted from the aseg volume, and a marching cubes algorithm is run to generate a surface mesh. In this case, the volume label for the hippocampus (yellow, number value = 17) is shown in yellow. (B) The resulting 3D hippocampal mesh after marching cubes, shown with a bisecting coronal slice of the medial temporal lobe.
(C) Subcortical meshes on the template brain, cvs_avg35_inMNI152. 23 subcortical meshes in the left and right hemisphere cortical meshes are shown.
Subcortical meshes are colored to match the FreeSurferColorLUT (look up table). Co-registration of CT and MRI Scans In order to identify electrodes on the pial surface, we must transform the posteroperative CT scan into the same space as the T1 MRI. We use the normalized mutual information cost function () to perform this cross-modal registration in nipy.
» patient.reg_img() ◦ The user may also choose to specify the CT and MRI scans to align explicitly, using keyword arguments, though this is not necessary if the directory structure is set up as described. The CT scan is assumed to be in the CT directory, and the MRI scan is assumed to be in the mri directory. » patient.reg_img(source= 'CT.nii', target= 'orig.mgz') • Check the coregistration of the CT and MRI in freeview (Figure ). One way to do this is to load the CT on top of the MRI in the Volumes tab, then decrease the opacity of the CT to inspect the alignment of the bones in the skull. We recommend using the ‘heat’ colormap for the CT and grayscale for the MRI.
Check sagittal, coronal, and axial views to ensure that the bones of the skull are aligned properly in both images. When plotting the maximum intensity projection of the CT (Figure ), the user should also verify that the grids and strips are in roughly the right place. • Note: It is common that when the CT is aligned to the pre-op MRI, lateral grids may appear as though they are underneath the brain's surface.
This is common because the placement of these grids results in a deformation of the brain surface (). We solve this by later projecting these electrodes to the pial surface. • Quality check step: If the CT alignment fails, the user may need to change the initial alignment of the CT scan. Often, poor registrations can be traced back to poor initial conditions [T1 is not aligned to the AC-PC, or the CT scan's original position is at a very different orientation from the desired registered output (Figure )].
The user may need to manually align the CT for an initial placement, then rerun the coregistration to get a precise alignment between CT and MRI). This can be done in freeview, SPM, or other neuroimaging programs. (A) Transverse view in Freeview of a CT and an MRI that have been co-registered- the electrodes are the orange points in the left hemisphere.
Note how the skull in both the CT and MRI are aligned after registration. (B) An intensity projection view. (C) CT and T1 scan in original native space before alignment. The CT shown here (in “heat” colormap) was unable to be aligned to the T1 scan (grayscale image) because of poor initial conditions. To align, the CT was translated and rotated to be in rough alignment with the T1 scan, and then reregistered in img_pipe. Manual Identification of Electrodes While other methods have been developed to automatically determine the 3D spatial location of electrodes in a CT scan (), in practice it is often difficult to fully automate the process given the limited resolution of most clinical CT scans, especially for high-density grids with.
Example of identification of electrode coordinates using electrode picker. (A) Demonstrates the process of picking the coordinate for the most posterior inferior grid corner. On the left, the GUI is shown with the electrode selected. The pial surface, rCT, and skull stripped MRI are displayed.
The upper left shows the electrode selected in the sagittal view. The upper right shows the coronal view. The bottom left shows an axial view. The lower right displays the intensity projection map of the CT, which is useful for visualizing the entire grid.
To save the coordinate, press “n” to name a new device. With the center of the electrode artifact localized by the crosshairs in the axial, sagittal, and coronal views, press “e” to add a point. The coordinates are automatically saved to the “elecs” folder. The location of these points in 3D can be viewed by launching a separate 3D viewer by pressing “3.” This plot can be seen in the right panel. If the coordinates appear buried in the Mesh due to post-operative brain shift, additional steps can be taken to project the electrode to the surface, shown in Figure. (B) Example of identification of an electrode that is part of a subtemporal strip. The strip can be seen in the rCT.nii intensity projection map in the lower right panel.
The coordinate is recorded from the center of the electrode artifact, seen in sagittal, coronal, and axial views. This coordinate can then be visualized on the 3D surface mesh, seen in the right panel, by typing “3.”.
Grid Interpolation for High-Density ECoG Grids • When using high-density (>>grid_elecs =patient.get_elecs (elecfile_prefix='hd_grid')['elecmatrix'] >>>patient.plot_brain(elecs=grid_ elecs). (A) The grid's corner electrodes are manually located. We interpolate the locations of the rest of the grid electrodes using these corner coordinates, giving us the electrode grid shown in red. The green arrows are the four normal vectors calculated from the corners, and the black arrow is the mean of those normal vectors and will act as our projection direction. (B) Projection of the interpolated grid (red) to the convex hull of the pial surface (blue) using the mean normal vector (black arrow).
The final projected electrode grid is shown in blue. (C) Axial and (D) coronal views of the co-registered CT overlaid on the T1 MRI, showing the location of the electrodes prior to surface projection. Creation of the Elecs_all.mat File • The elecs_all.mat file combines the individual device coordinates to represent the electrodes in the recording montage order. Elecs_all.mat contains elecmatrix and eleclabels. Elecmatrix contains the x, y, z coordinates of each device, combined in the appropriate montage order. Eleclabels contains device descriptors corresponding to these devices, shortened device ID (e.g.
G1) in column 1, long device ID (e.g. L256GridElectrode1) in column 2, and device type (e.g. Grid) in column 3. The possible values for “device type” should be ‘grid’, ‘strip’, or ‘depth’. Short and long device ID names should be unique.
For an example of what this will look like, see Table. • After creating the.mat files for each electrode device in patient.mark_electrodes(), initialize ‘elecs_all.mat’ by calling patient.make_elecs_all(), which will prompt the user for the information mentioned above, and automatically create the ‘elecs_all.mat’ file. Warping Surface and Depth Electrodes to a Common Atlas To warp electrodes from the native space to a common atlas space, call patient.warp_all(elecfile_prefix = 'elecs_all'), which will by default warp the subject brain to the cvs_avg35_inMNI152 brain, and generate the warped coordinates for both surface and depth electrodes in elecs_all.mat. Options passed into this method may be changed if the user wishes to warp a subset of electrodes, such as only surface or only depth electrodes, or if they wish to use a different template brain. The surface warps are generated by projecting the pial surfaces of the subject and template brains into a spherical coordinate space, and aligning the surfaces in that space – this is shown in Figures.
Depth warping is performed using a combination of volumetric and surface warping (). We have found that surface warping the strip and grids results in more accurate placement of the warped electrodes on the same gyri as in the native space, whereas for depth electrodes a volumetric and surface warping is necessary. Surface warping procedure. (A) Electrodes on native brain. Gyri are colored according to anatomical designation by Freesurfer. An example electrode localized to the native STG can be seen circled.
Electrodes are warped from the subject's native brain to the cvs_avg35_inMNI152 average brain in spherical surface space. The native lh.sphere is shown in (B), with the location of the same STG electrode marked in red.
Lh.sphere is shown with curvature and anatomical color coding. Warping occurs when the native lh.sphere is warped to match the lh.sphere for the cvs_avg35_inMNI152 average brain, shown in (C). The same STG electrode is now shown in red on the average brain. Finally, the localization in spherical space is used to localize the electrode on the pial surface of the cvs_avg35_inMNI152 average brain, shown in (D). Note that warping depth electrodes takes significantly longer than warping surface electrodes.
Pause Point: Quality Checking Warps • patient.warp_all() will have generated PDFs in the subject's elecs directory (* _recon_anatomy.pdf and * _warped_recon_anatomy.pdf) of the electrodes and their warps. To check the warp interactively, use patient.plot_recon_anatomy_compare_warped(template = 'cvs_avg35_inMNI152', elecfile_prefix = TDT_elecs_all).
Pause Point: Quality Checking Depth Electrode Warping • patient.check_depth_warps() will generate a pdf in the subject's elecs directory, depthWarpsQC.pdf comparing an electrode's original location in the subject brain compared to its warped location in the template brain. Figures shows an accurate warp, and Figures shows an inaccurate warp. If an electrode's warped location is inaccurate, either remove the electrode from the warped electrode coordinate matrix, or manually choose the location in the template brain.
Examples of accurate depth warp (A,B) and inaccurate depth warp (C,D). Colors correspond to anatomical label, and the red circle marks electrode in single subject brain (A,B) and the location it is warped to in the CVS brain (C,D). The electrode of interest in (A) retains its anatomical label, left hippocampus, when warped to the CVS brain in (B).
However, the electrode of interest in (C) is incorrectly warped from right hippocampus in the single subject brain to cerebellar cortex in the CVS brain (D). Plotting Electrodes and Activity on the Pial Surface • patient.plot_recon_anatomy() plots anatomically labeled electrodes on the brain.
• Warped electrodes can be plotted on a template brain by calling patient.plot_recon_anatomy(elecfile_prefix = 'warped_elecs_file', template = your_template). • To plot electrode activity on the brain's surface, use the method plot_brain(). The user can control the opacity of the brain mesh, wireframe/surface representation, electrode colors, and colormap. Other Notes • It is possible to launch specific sub-methods of img_pipe in separate python sessions.
For example, the user may wish to launch patient.get_recon() 1 day, then open another python session later for patient.mark_electrodes(). To do this, simply reinitialize the patient according to instructions in section Initializing the Patient in img_pipe, and then continue with the next step. • If the user prefers not to AC-PC orient the images to start (and assuming that this does not affect the quality of the warping step), it is possible to reorient the final surface and electrode.mat files using Freesurfer's talairach.xfm file, which will put them into a common orientation.
Reviewed by:, University of Southern California, United States, Baylor College of Medicine, United States Copyright © 2017 Hamilton, Chang, Lee and Chang. This is an open-access article distributed under the terms of the. The use, distribution or reproduction in other forums is permitted, provided the original author(s) or licensor are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms. *Correspondence: Edward F.
1 • • Topic • Voices • Posts • Freshness • • Started by: Jess • 2 • 9 • Chris • Started by: • 2 • 35 • Deborah Thomas • Started by: CS48 • 1 • 1 • • Started by: Sointu • 1 • 1 • • Started by: Hursti • 1 • 1 • • Started by: Armas • 1 • 1 • • Started by: Hongisto • 1 • 1 • • Started by: Noora • 1 • 1 • • Started by: Kemi • 1 • 1 • • Started by: Samuel Munday • 1 • 1 • • Started by: Samuel Munday • 1 • 1 • • Started by: Samuel Munday • 1 • 1 • • Started by: mssssaksa • 1 • 1 • • Started by: Sarah • 1 • 5 • Timyra • Started by: Anna • 1 • 1 • Anna • Started by: Jamie • 1 • 1 • Jamie •.