This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % Convert FMR to NII for files converted from FMR to NII before. | |
| % | |
| % Requires Neuroelf <http://neuroelf.net/>. | |
| clc; clear all; | |
| PATH_OUT = '/patt/to/output_folder'; | |
| SUFFIX = 'converted' | |
| % set nii names created after spm or fsl manipulation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % Convert FMR to NII | |
| % | |
| % Requires Neuroelf <http://neuroelf.net/>. | |
| clear all; | |
| % Set path with nii files | |
| PATH_OUT = '/patt/to/output_folder'; | |
| % Set fmr names |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Test GL volume tool with MRI data.""" | |
| from pyqtgraph.Qt import QtCore, QtGui | |
| import pyqtgraph.opengl as gl | |
| import numpy as np | |
| from nibabel import load | |
| FILENAME = "/path/to/file.nii.gz" | |
| RENDER_TYPE = "translucent" | |
| THR_MIN = 100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % Nifti to vmr Brainvoyager (2.8.4) conversion orientation fix. | |
| % This scripts requires neuroelf. | |
| % | |
| % Use Brainvoyager nifti to vmr converter with default optionss then use | |
| % this script to reorient the data. | |
| clc; clear all; close all; | |
| in_file = '/path/to/converted_nifti.vmr'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| in='/path/to/image.nii.gz' | |
| ref='/path/to/reference_image.nii.gz' | |
| command="${FSLDIR}/bin/fnirt " | |
| command+="--ref=$ref " | |
| command+="--in=$in " | |
| command+="--cout=${in%.nii*}_cout.nii " | |
| command+="--iout=${in%.nii*}_iout " | |
| command+="--fout=${in%.nii*}_fout " | |
| command+="--subsamp=2,2,1,1 " # sub-sampling scheme [default 4,2,1,1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Extract a smaller volume from a bigger volume. | |
| NOTE: The affine matrix is not manipulated. Therefore, the extracted volume | |
| cannot be positioned properly in the initial volume (e.g. in ITKSNAP). | |
| """ | |
| import os | |
| import numpy as np | |
| from nibabel import load, Nifti1Image, save |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % Compute vertex to veretx euclidean distance in two different meshes. | |
| % | |
| % Note: This script will become slower as the angle threshold and search | |
| % window increase. | |
| clear all; | |
| % surface | |
| srf_name_1 = '/path/to/mesh1.srf'; | |
| % vessel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| clear all; | |
| % Inputs | |
| poi_file = '/path/to/file.poi'; | |
| srf_file = '/path/to/mesh.srf'; | |
| suffix = 'borders'; | |
| blackened_borders = true; | |
| % Load files | |
| poi = xff(poi_file); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| clear all; | |
| srf_path ='/path/to/mesh.srf'; | |
| srf = xff(srf_path); | |
| out = [srf_path(1:end-4), '_POIcut.srf']; | |
| poi = xff('/path/ro/areas.poi'); | |
| poi_idx = 1; | |
| % (optional) cut smp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % Convert nifti to fmr and change the orientations. | |
| % This scripts requires neuroelf. | |
| % | |
| % NOTES | |
| % ----- | |
| % If you are getting erro about `Dyn3DToFMR`: | |
| % 1. Clone the recent neuroelf version from <https://github.com/neuroelf/neuroelf-matlab> (this is written on 2020/04/28). | |
| % 2. Copy `hdr_Dyn3DToFMR.m` file from neuroelf/_todo/@xff/private/ directory and paste in into neuroelf/@xff/private/ directory. | |
| % 3. Comment out the following line fmrc.FirstDataSourceFile = hdrs.F; because otherwise it produces an error. | |
| % 4. Add this modified neuroelf's path to your MATLAB. |