Atlas

src.atlas.extractRoiFromAtlas(varargin)

Outputs a ROI image and side car json for a given atlas, roi name (as defined in the look up table of that atlas) and a hemisphere

USAGE:

roiImage = extractRoiFromAtlas(outputDir, atlasName, roiName, hemisphere)
Parameters:
  • outputDir (string) –

  • atlasName (string) – 'wang', 'visfatlas', 'neuromorphometrics', 'hcpex', 'glasser'

  • roiName (string) – run getLookUpTable(atlasName) to get a list of ROI names to choose from

  • hemisphere (string) – L or R

EXAMPLE:

outputDir = pwd;
atlasName = 'neuromorphometrics';
roiName = 'PCu precuneus';
hemisphere = 'R';

extractRoiFromAtlas(outputDir, atlasName, roiName, hemisphere)
src.atlas.extractRoiByLabel(sourceImage, labelStruct)

Given a discrete segmentation source image fullpath and a look up table label structure this creates a mask for that ROI and returns the fullpath to its BIDS name. This will also create a JSON side car file for that image.

USAGE:

outputImage = extractRoiByLabel(sourceImage, labelStruct)
Parameters:
  • sourceImage (string) – discrete segmentation source image fullpath

  • labelStruct (structure) – 1x1 structure with fields ROI for the ROI name and label for the corresponding label

src.atlas.labelClusters(varargin)

Returns a binary mask for an image after applying voxel wise threshold and an optional cluster size threshold

USAGE:

outputImage = thresholdToMask(inputImage, peakThreshold, clusterSize)
Parameters:
  • inputImage (path) –

  • peakThreshold (float) –

  • clusterSize (integer >= 0 (Default: 0)) –

Returns:

  • outputImage:

    (string)

See also getClusters, sortAndLabelClusters

Adapted from: https://en.wikibooks.org/wiki/SPM/How-to#How_to_remove_clusters_under_a_certain_size_in_a_binary_mask?

src.atlas.copyAtlasToSpmDir(varargin)

Copies a given atlas to the SPM atlas directory.

USAGE:

copyAtlasToSpmDir(atlas, 'verbose', false)
Parameters:
  • atlas (char) – Any of {'aal', 'hcpex', 'glasser', 'visfatlas', 'wang'}. Defaults to 'AAL'

  • verbose (boolean) – Defaults to false