NIFTIPeak finds local maxima in a 3D NIFTI image file. It is not compatible with 3D+time images. NIFTIPeak reads an image file, identified by its name within a SAM subdirectory and outputs a text file list of maxima with the suffix ".max" after stripping the ".nii" suffix from the image file name.
NIFTIPeak works by first scanning the image to determine the rms value of all non-zero voxels. It then rescans the image to find maximia, as follows. For each voxel, NIFTIPeak examines all neighboring voxels within a search radius (the default is twice the voxel step size). If all neighboring voxels have a smaller absolute value, then that voxel is tested against the threshold (default is the rms value of the non-zero voxels). If it is greater than the threshold, this is a potential maximum that is saved internally to a list, together with its value. After all voxels have been rescanned, the list is scanned to extract the top (i.e., with the largest absolute value) maxima are written out to the .max file in the descending order of magnitude. The default maximum number of maxima in the output list is 10, but this can be altered by the optional -n flag.
Normal usage:
NIFTIPeak -r <dataset_name> -i < image_file_name> -v
where -r designates the dataset name (with or without the .ds suffix), -i designates the image file name without the .nii suffix, and -v is "verbose" mode. Without -v, NIFTIPeak works silently, except for error messages.
Optional flags:
-t <value> over-rides the default rms threshold value for the filtering maxima.<\p>
-s <radius (cm)> over-rides the default search radius for finding local maxima.
-n <number of maxima> over-rides the default number of maxima in the output list.
-p appends the value of each maximum to the output list. This list format is not compatible with use as a "target" file.
When invoked without the -p flag, the first line of the output .max file gives the number of maxima and successive lines give the x, y, z coordinates (cm) in the MEG head frame. This list is compatible as a "target" list when using SAMwts or SAMwts to generate SAM coefficients for viewing virtual sensor in DataEditor (CTF/VSM systems, only).