Commit 222dce71 authored by Andrew Cohen's avatar Andrew Cohen

rebuilt agains cuda 9.1

parent 32d38de7
% Closure - This kernel will dilate follow by an erosion.
% arrayOut = HIP.Cuda.Closure(arrayIn,kernel,[numIterations],[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial.
% The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block.
%
% kernel = This is a one to three dimensional array that will be used to determine neighborhood operations.
% In this case, the positions in the kernel that do not equal zeros will be evaluated.
% In other words, this can be viewed as a structuring element for the max neighborhood.
%
% numIterations (optional) = This is the number of iterations to run the max filter for a given position.
% This is useful for growing regions by the shape of the structuring element or for very large neighborhoods.
% Can be empty an array [].
%
% device (optional) = Use this if you have multiple devices and want to select one explicitly.
% Setting this to [] allows the algorithm to either pick the best device and/or will try to split
% the data across multiple devices.
%
% imageOut = This will be an array of the same type and shape as the input array.
function arrayOut = Closure(arrayIn,kernel,numIterations,device)
[arrayOut] = HIP.Cuda.Mex('Closure',arrayIn,kernel,numIterations,device);
end
% Closure - This kernel will dilate follow by an erosion.
% arrayOut = HIP.Cuda.Closure(arrayIn,kernel,[numIterations],[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial.
% The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block.
%
% kernel = This is a one to three dimensional array that will be used to determine neighborhood operations.
% In this case, the positions in the kernel that do not equal zeros will be evaluated.
% In other words, this can be viewed as a structuring element for the max neighborhood.
%
% numIterations (optional) = This is the number of iterations to run the max filter for a given position.
% This is useful for growing regions by the shape of the structuring element or for very large neighborhoods.
% Can be empty an array [].
%
% device (optional) = Use this if you have multiple devices and want to select one explicitly.
% Setting this to [] allows the algorithm to either pick the best device and/or will try to split
% the data across multiple devices.
%
% imageOut = This will be an array of the same type and shape as the input array.
function arrayOut = Closure(arrayIn,kernel,numIterations,device)
[arrayOut] = HIP.Cuda.Mex('Closure',arrayIn,kernel,numIterations,device);
end
classdef (Abstract,Sealed) Cuda
methods (Static)
commandInfo = Info()
Help(command)
[numCudaDevices,memoryStats] = DeviceCount()
deviceStatsArray = DeviceStats()
arrayOut = Closure(arrayIn,kernel,numIterations,device)
arrayOut = ElementWiseDifference(array1In,array2In,device)
arrayOut = EntropyFilter(arrayIn,kernel,device)
arrayOut = Gaussian(arrayIn,sigmas,numIterations,device)
[minValue,maxValue] = GetMinMax(arrayIn,device)
arrayOut = HighPassFilter(arrayIn,sigmas,device)
arrayOut = LoG(arrayIn,sigmas,device)
arrayOut = MaxFilter(arrayIn,kernel,numIterations,device)
arrayOut = MeanFilter(arrayIn,kernel,numIterations,device)
arrayOut = MedianFilter(arrayIn,kernel,numIterations,device)
arrayOut = MinFilter(arrayIn,kernel,numIterations,device)
[minOut,maxOut] = MinMax(arrayIn,device)
arrayOut = MultiplySum(arrayIn,kernel,numIterations,device)
arrayOut = Opener(arrayIn,kernel,numIterations,device)
arrayOut = StdFilter(arrayIn,kernel,numIterations,device)
valueOut = Sum(arrayIn,device)
arrayOut = VarFilter(arrayIn,kernel,numIterations,device)
arrayOut = WienerFilter(arrayIn,kernel,noiseVariance,device)
end
methods (Static, Access = private)
varargout = Mex(command, varargin)
end
end
classdef (Abstract,Sealed) Cuda
methods (Static)
commandInfo = Info()
Help(command)
[numCudaDevices,memoryStats] = DeviceCount()
deviceStatsArray = DeviceStats()
arrayOut = Closure(arrayIn,kernel,numIterations,device)
arrayOut = ElementWiseDifference(array1In,array2In,device)
arrayOut = EntropyFilter(arrayIn,kernel,device)
arrayOut = Gaussian(arrayIn,sigmas,numIterations,device)
[minValue,maxValue] = GetMinMax(arrayIn,device)
arrayOut = HighPassFilter(arrayIn,sigmas,device)
arrayOut = LoG(arrayIn,sigmas,device)
arrayOut = MaxFilter(arrayIn,kernel,numIterations,device)
arrayOut = MeanFilter(arrayIn,kernel,numIterations,device)
arrayOut = MedianFilter(arrayIn,kernel,numIterations,device)
arrayOut = MinFilter(arrayIn,kernel,numIterations,device)
[minOut,maxOut] = MinMax(arrayIn,device)
arrayOut = MultiplySum(arrayIn,kernel,numIterations,device)
arrayOut = Opener(arrayIn,kernel,numIterations,device)
arrayOut = StdFilter(arrayIn,kernel,numIterations,device)
valueOut = Sum(arrayIn,device)
arrayOut = VarFilter(arrayIn,kernel,numIterations,device)
arrayOut = WienerFilter(arrayIn,kernel,noiseVariance,device)
end
methods (Static, Access = private)
varargout = Mex(command, varargin)
end
end
% DeviceCount - This will return the number of Cuda devices available, and their memory.
% [numCudaDevices,memoryStats] = HIP.Cuda.DeviceCount()
% NumCudaDevices -- this is the number of Cuda devices available.
% MemoryStats -- this is an array of structures where each entry corresponds to a Cuda device.
% The memory structure contains the total memory on the device and the memory available for a Cuda call.
function [numCudaDevices,memoryStats] = DeviceCount()
[numCudaDevices,memoryStats] = HIP.Cuda.Mex('DeviceCount');
end
% DeviceCount - This will return the number of Cuda devices available, and their memory.
% [numCudaDevices,memoryStats] = HIP.Cuda.DeviceCount()
% NumCudaDevices -- this is the number of Cuda devices available.
% MemoryStats -- this is an array of structures where each entry corresponds to a Cuda device.
% The memory structure contains the total memory on the device and the memory available for a Cuda call.
function [numCudaDevices,memoryStats] = DeviceCount()
[numCudaDevices,memoryStats] = HIP.Cuda.Mex('DeviceCount');
end
% DeviceStats - This will return the statistics of each Cuda capable device installed.
% deviceStatsArray = HIP.Cuda.DeviceStats()
% DeviceStatsArray -- this is an array of structs, one struct per device.
% The struct has these fields: name, major, minor, constMem, sharedMem, totalMem, tccDriver, mpCount, threadsPerMP, warpSize, maxThreads.
function deviceStatsArray = DeviceStats()
[deviceStatsArray] = HIP.Cuda.Mex('DeviceStats');
end
% DeviceStats - This will return the statistics of each Cuda capable device installed.
% deviceStatsArray = HIP.Cuda.DeviceStats()
% DeviceStatsArray -- this is an array of structs, one struct per device.
% The struct has these fields: name, major, minor, constMem, sharedMem, totalMem, tccDriver, mpCount, threadsPerMP, warpSize, maxThreads.
function deviceStatsArray = DeviceStats()
[deviceStatsArray] = HIP.Cuda.Mex('DeviceStats');
end
% ElementWiseDifference - This subtracts the second array from the first, element by element (A-B).
% arrayOut = HIP.Cuda.ElementWiseDifference(array1In,array2In,[device])
% image1In = This is a one to five dimensional array. The first three dimensions are treated as spatial.
% The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block.
%
% image2In = This is a one to five dimensional array. The first three dimensions are treated as spatial.
% The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block.
%
% device (optional) = Use this if you have multiple devices and want to select one explicitly.
% Setting this to [] allows the algorithm to either pick the best device and/or will try to split
% the data across multiple devices.
%
% imageOut = This will be an array of the same type and shape as the input array.
function arrayOut = ElementWiseDifference(array1In,array2In,device)
[arrayOut] = HIP.Cuda.Mex('ElementWiseDifference',array1In,array2In,device);
end
% ElementWiseDifference - This subtracts the second array from the first, element by element (A-B).
% arrayOut = HIP.Cuda.ElementWiseDifference(array1In,array2In,[device])
% image1In = This is a one to five dimensional array. The first three dimensions are treated as spatial.
% The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block.
%
% image2In = This is a one to five dimensional array. The first three dimensions are treated as spatial.
% The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block.
%
% device (optional) = Use this if you have multiple devices and want to select one explicitly.
% Setting this to [] allows the algorithm to either pick the best device and/or will try to split
% the data across multiple devices.
%
% imageOut = This will be an array of the same type and shape as the input array.
function arrayOut = ElementWiseDifference(array1In,array2In,device)
[arrayOut] = HIP.Cuda.Mex('ElementWiseDifference',array1In,array2In,device);
end
% EntropyFilter - This calculates the entropy within the neighborhood given by the kernel.
% arrayOut = HIP.Cuda.EntropyFilter(arrayIn,kernel,[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial.
% The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block.
%
% kernel = This is a one to three dimensional array that will be used to determine neighborhood operations.
% In this case, the positions in the kernel that do not equal zeros will be evaluated.
% In other words, this can be viewed as a structuring element for the max neighborhood.
%
% device (optional) = Use this if you have multiple devices and want to select one explicitly.
% Setting this to [] allows the algorithm to either pick the best device and/or will try to split
% the data across multiple devices.
%
% imageOut = This will be an array of the same type and shape as the input array.
function arrayOut = EntropyFilter(arrayIn,kernel,device)
[arrayOut] = HIP.Cuda.Mex('EntropyFilter',arrayIn,kernel,device);
end
% EntropyFilter - This calculates the entropy within the neighborhood given by the kernel.
% arrayOut = HIP.Cuda.EntropyFilter(arrayIn,kernel,[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial.
% The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block.
%
% kernel = This is a one to three dimensional array that will be used to determine neighborhood operations.
% In this case, the positions in the kernel that do not equal zeros will be evaluated.
% In other words, this can be viewed as a structuring element for the max neighborhood.
%
% device (optional) = Use this if you have multiple devices and want to select one explicitly.
% Setting this to [] allows the algorithm to either pick the best device and/or will try to split
% the data across multiple devices.
%
% imageOut = This will be an array of the same type and shape as the input array.
function arrayOut = EntropyFilter(arrayIn,kernel,device)
[arrayOut] = HIP.Cuda.Mex('EntropyFilter',arrayIn,kernel,device);
end
% Gaussian - Gaussian smoothing.
% arrayOut = HIP.Cuda.Gaussian(arrayIn,sigmas,[numIterations],[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial.
% The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block.
%
% Sigmas = This should be an array of three positive values that represent the standard deviation of a Gaussian curve.
% Zeros (0) in this array will not smooth in that direction.
%
% numIterations (optional) = This is the number of iterations to run the max filter for a given position.
% This is useful for growing regions by the shape of the structuring element or for very large neighborhoods.
% Can be empty an array [].
%
% device (optional) = Use this if you have multiple devices and want to select one explicitly.
% Setting this to [] allows the algorithm to either pick the best device and/or will try to split
% the data across multiple devices.
%
% imageOut = This will be an array of the same type and shape as the input array.
function arrayOut = Gaussian(arrayIn,sigmas,numIterations,device)
[arrayOut] = HIP.Cuda.Mex('Gaussian',arrayIn,sigmas,numIterations,device);
end
% Gaussian - Gaussian smoothing.
% arrayOut = HIP.Cuda.Gaussian(arrayIn,sigmas,[numIterations],[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial.
% The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block.
%
% Sigmas = This should be an array of three positive values that represent the standard deviation of a Gaussian curve.
% Zeros (0) in this array will not smooth in that direction.
%
% numIterations (optional) = This is the number of iterations to run the max filter for a given position.
% This is useful for growing regions by the shape of the structuring element or for very large neighborhoods.
% Can be empty an array [].
%
% device (optional) = Use this if you have multiple devices and want to select one explicitly.
% Setting this to [] allows the algorithm to either pick the best device and/or will try to split
% the data across multiple devices.
%
% imageOut = This will be an array of the same type and shape as the input array.
function arrayOut = Gaussian(arrayIn,sigmas,numIterations,device)
[arrayOut] = HIP.Cuda.Mex('Gaussian',arrayIn,sigmas,numIterations,device);
end
% GetMinMax - This function finds the lowest and highest value in the array that is passed in.
% [minValue,maxValue] = HIP.Cuda.GetMinMax(arrayIn,[device])
% imageIn = This is a one to five dimensional array.
%
% device (optional) = Use this if you have multiple devices and want to select one explicitly.
% Setting this to [] allows the algorithm to either pick the best device and/or will try to split
% the data across multiple devices.
%
% minValue = This is the lowest value found in the array.
% maxValue = This is the highest value found in the array.
function [minValue,maxValue] = GetMinMax(arrayIn,device)
[minValue,maxValue] = HIP.Cuda.Mex('GetMinMax',arrayIn,device);
end
% GetMinMax - This function finds the lowest and highest value in the array that is passed in.
% [minValue,maxValue] = HIP.Cuda.GetMinMax(arrayIn,[device])
% imageIn = This is a one to five dimensional array.
%
% device (optional) = Use this if you have multiple devices and want to select one explicitly.
% Setting this to [] allows the algorithm to either pick the best device and/or will try to split
% the data across multiple devices.
%
% minValue = This is the lowest value found in the array.
% maxValue = This is the highest value found in the array.
function [minValue,maxValue] = GetMinMax(arrayIn,device)
[minValue,maxValue] = HIP.Cuda.Mex('GetMinMax',arrayIn,device);
end
% Help - Help on a specified command.
% HIP.Cuda.Help(command)
% Print detailed usage information for the specified command.
function Help(command)
HIP.Cuda.Mex('Help',command);
end
% Help - Help on a specified command.
% HIP.Cuda.Help(command)
% Print detailed usage information for the specified command.
function Help(command)
HIP.Cuda.Mex('Help',command);
end
% HighPassFilter - Filters out low frequency by subtracting a Gaussian blurred version of the input based on the sigmas provided.
% arrayOut = HIP.Cuda.HighPassFilter(arrayIn,sigmas,[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial.
% The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block.
%
% Sigmas = This should be an array of three positive values that represent the standard deviation of a Gaussian curve.
% Zeros (0) in this array will not smooth in that direction.
%
% device (optional) = Use this if you have multiple devices and want to select one explicitly.
% Setting this to [] allows the algorithm to either pick the best device and/or will try to split
% the data across multiple devices.
%
% imageOut = This will be an array of the same type and shape as the input array.
function arrayOut = HighPassFilter(arrayIn,sigmas,device)
[arrayOut] = HIP.Cuda.Mex('HighPassFilter',arrayIn,sigmas,device);
end
% HighPassFilter - Filters out low frequency by subtracting a Gaussian blurred version of the input based on the sigmas provided.
% arrayOut = HIP.Cuda.HighPassFilter(arrayIn,sigmas,[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial.
% The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block.
%
% Sigmas = This should be an array of three positive values that represent the standard deviation of a Gaussian curve.
% Zeros (0) in this array will not smooth in that direction.
%
% device (optional) = Use this if you have multiple devices and want to select one explicitly.
% Setting this to [] allows the algorithm to either pick the best device and/or will try to split
% the data across multiple devices.
%
% imageOut = This will be an array of the same type and shape as the input array.
function arrayOut = HighPassFilter(arrayIn,sigmas,device)
[arrayOut] = HIP.Cuda.Mex('HighPassFilter',arrayIn,sigmas,device);
end
% Info - Get information on all available mex commands.
% commandInfo = HIP.Cuda.Info()
% Returns commandInfo structure array containing information on all mex commands.
% commandInfo.command - Command string
% commandInfo.outArgs - Cell array of output arguments
% commandInfo.inArgs - Cell array of input arguments
% commandInfo.helpLines - Cell array of input arguments
function commandInfo = Info()
[commandInfo] = HIP.Cuda.Mex('Info');
end
% Info - Get information on all available mex commands.
% commandInfo = HIP.Cuda.Info()
% Returns commandInfo structure array containing information on all mex commands.
% commandInfo.command - Command string
% commandInfo.outArgs - Cell array of output arguments
% commandInfo.inArgs - Cell array of input arguments
% commandInfo.helpLines - Cell array of input arguments
function commandInfo = Info()
[commandInfo] = HIP.Cuda.Mex('Info');
end
% LoG - Apply a Lapplacian of Gaussian filter with the given sigmas.
% arrayOut = HIP.Cuda.LoG(arrayIn,sigmas,[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial.
% The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block.
%
% Sigmas = This should be an array of three positive values that represent the standard deviation of a Gaussian curve.
% Zeros (0) in this array will not smooth in that direction.
%
% device (optional) = Use this if you have multiple devices and want to select one explicitly.
% Setting this to [] allows the algorithm to either pick the best device and/or will try to split
% the data across multiple devices.
%
% imageOut = This will be an array of the same type and shape as the input array.
function arrayOut = LoG(arrayIn,sigmas,device)
[arrayOut] = HIP.Cuda.Mex('LoG',arrayIn,sigmas,device);
end
% LoG - Apply a Lapplacian of Gaussian filter with the given sigmas.
% arrayOut = HIP.Cuda.LoG(arrayIn,sigmas,[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial.
% The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block.
%
% Sigmas = This should be an array of three positive values that represent the standard deviation of a Gaussian curve.
% Zeros (0) in this array will not smooth in that direction.
%
% device (optional) = Use this if you have multiple devices and want to select one explicitly.
% Setting this to [] allows the algorithm to either pick the best device and/or will try to split
% the data across multiple devices.
%
% imageOut = This will be an array of the same type and shape as the input array.
function arrayOut = LoG(arrayIn,sigmas,device)
[arrayOut] = HIP.Cuda.Mex('LoG',arrayIn,sigmas,device);
end
% MaxFilter - This will set each pixel/voxel to the max value of the neighborhood defined by the given kernel.
% arrayOut = HIP.Cuda.MaxFilter(arrayIn,kernel,[numIterations],[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial.
% The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block.
%
% kernel = This is a one to three dimensional array that will be used to determine neighborhood operations.
% In this case, the positions in the kernel that do not equal zeros will be evaluated.
% In other words, this can be viewed as a structuring element for the max neighborhood.
%
% numIterations (optional) = This is the number of iterations to run the max filter for a given position.
% This is useful for growing regions by the shape of the structuring element or for very large neighborhoods.
% Can be empty an array [].
%
% device (optional) = Use this if you have multiple devices and want to select one explicitly.
% Setting this to [] allows the algorithm to either pick the best device and/or will try to split
% the data across multiple devices.
%
% imageOut = This will be an array of the same type and shape as the input array.
function arrayOut = MaxFilter(arrayIn,kernel,numIterations,device)
[arrayOut] = HIP.Cuda.Mex('MaxFilter',arrayIn,kernel,numIterations,device);
end
% MaxFilter - This will set each pixel/voxel to the max value of the neighborhood defined by the given kernel.
% arrayOut = HIP.Cuda.MaxFilter(arrayIn,kernel,[numIterations],[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial.
% The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block.
%
% kernel = This is a one to three dimensional array that will be used to determine neighborhood operations.
% In this case, the positions in the kernel that do not equal zeros will be evaluated.
% In other words, this can be viewed as a structuring element for the max neighborhood.
%
% numIterations (optional) = This is the number of iterations to run the max filter for a given position.
% This is useful for growing regions by the shape of the structuring element or for very large neighborhoods.
% Can be empty an array [].
%
% device (optional) = Use this if you have multiple devices and want to select one explicitly.
% Setting this to [] allows the algorithm to either pick the best device and/or will try to split
% the data across multiple devices.
%
% imageOut = This will be an array of the same type and shape as the input array.
function arrayOut = MaxFilter(arrayIn,kernel,numIterations,device)
[arrayOut] = HIP.Cuda.Mex('MaxFilter',arrayIn,kernel,numIterations,device);
end
% MeanFilter - This will take the mean of the given neighborhood.
% arrayOut = HIP.Cuda.MeanFilter(arrayIn,kernel,[numIterations],[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial.
% The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block.
%
% kernel = This is a one to three dimensional array that will be used to determine neighborhood operations.
% In this case, the positions in the kernel that do not equal zeros will be evaluated.
% In other words, this can be viewed as a structuring element for the max neighborhood.
%
% numIterations (optional) = This is the number of iterations to run the max filter for a given position.
% This is useful for growing regions by the shape of the structuring element or for very large neighborhoods.
% Can be empty an array [].
%
% device (optional) = Use this if you have multiple devices and want to select one explicitly.
% Setting this to [] allows the algorithm to either pick the best device and/or will try to split
% the data across multiple devices.
%
% imageOut = This will be an array of the same type and shape as the input array.
function arrayOut = MeanFilter(arrayIn,kernel,numIterations,device)
[arrayOut] = HIP.Cuda.Mex('MeanFilter',arrayIn,kernel,numIterations,device);
end
% MeanFilter - This will take the mean of the given neighborhood.
% arrayOut = HIP.Cuda.MeanFilter(arrayIn,kernel,[numIterations],[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial.
% The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block.
%
% kernel = This is a one to three dimensional array that will be used to determine neighborhood operations.
% In this case, the positions in the kernel that do not equal zeros will be evaluated.
% In other words, this can be viewed as a structuring element for the max neighborhood.
%
% numIterations (optional) = This is the number of iterations to run the max filter for a given position.
% This is useful for growing regions by the shape of the structuring element or for very large neighborhoods.
% Can be empty an array [].
%
% device (optional) = Use this if you have multiple devices and want to select one explicitly.
% Setting this to [] allows the algorithm to either pick the best device and/or will try to split
% the data across multiple devices.
%
% imageOut = This will be an array of the same type and shape as the input array.
function arrayOut = MeanFilter(arrayIn,kernel,numIterations,device)
[arrayOut] = HIP.Cuda.Mex('MeanFilter',arrayIn,kernel,numIterations,device);
end
% MedianFilter - This will calculate the median for each neighborhood defined by the kernel.
% arrayOut = HIP.Cuda.MedianFilter(arrayIn,kernel,[numIterations],[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial.
% The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block.
%
% kernel = This is a one to three dimensional array that will be used to determine neighborhood operations.
% In this case, the positions in the kernel that do not equal zeros will be evaluated.
% In other words, this can be viewed as a structuring element for the max neighborhood.
%
% numIterations (optional) = This is the number of iterations to run the max filter for a given position.
% This is useful for growing regions by the shape of the structuring element or for very large neighborhoods.
% Can be empty an array [].
%
% device (optional) = Use this if you have multiple devices and want to select one explicitly.
% Setting this to [] allows the algorithm to either pick the best device and/or will try to split
% the data across multiple devices.
%
% imageOut = This will be an array of the same type and shape as the input array.
function arrayOut = MedianFilter(arrayIn,kernel,numIterations,device)
[arrayOut] = HIP.Cuda.Mex('MedianFilter',arrayIn,kernel,numIterations,device);
end
% MedianFilter - This will calculate the median for each neighborhood defined by the kernel.
% arrayOut = HIP.Cuda.MedianFilter(arrayIn,kernel,[numIterations],[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial.
% The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block.
%
% kernel = This is a one to three dimensional array that will be used to determine neighborhood operations.
% In this case, the positions in the kernel that do not equal zeros will be evaluated.
% In other words, this can be viewed as a structuring element for the max neighborhood.
%
% numIterations (optional) = This is the number of iterations to run the max filter for a given position.
% This is useful for growing regions by the shape of the structuring element or for very large neighborhoods.
% Can be empty an array [].
%
% device (optional) = Use this if you have multiple devices and want to select one explicitly.
% Setting this to [] allows the algorithm to either pick the best device and/or will try to split
% the data across multiple devices.
%
% imageOut = This will be an array of the same type and shape as the input array.
function arrayOut = MedianFilter(arrayIn,kernel,numIterations,device)
[arrayOut] = HIP.Cuda.Mex('MedianFilter',arrayIn,kernel,numIterations,device);
end
% MinFilter - This will set each pixel/voxel to the max value of the neighborhood defined by the given kernel.
% arrayOut = HIP.Cuda.MinFilter(arrayIn,kernel,[numIterations],[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial.
% The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block.
%
% kernel = This is a one to three dimensional array that will be used to determine neighborhood operations.
% In this case, the positions in the kernel that do not equal zeros will be evaluated.
% In other words, this can be viewed as a structuring element for the max neighborhood.
%
% numIterations (optional) = This is the number of iterations to run the max filter for a given position.
% This is useful for growing regions by the shape of the structuring element or for very large neighborhoods.
% Can be empty an array [].
%
% device (optional) = Use this if you have multiple devices and want to select one explicitly.
% Setting this to [] allows the algorithm to either pick the best device and/or will try to split
% the data across multiple devices.
%
% imageOut = This will be an array of the same type and shape as the input array.
function arrayOut = MinFilter(arrayIn,kernel,numIterations,device)
[arrayOut] = HIP.Cuda.Mex('MinFilter',arrayIn,kernel,numIterations,device);
end
% MinFilter - This will set each pixel/voxel to the max value of the neighborhood defined by the given kernel.
% arrayOut = HIP.Cuda.MinFilter(arrayIn,kernel,[numIterations],[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial.
% The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block.
%
% kernel = This is a one to three dimensional array that will be used to determine neighborhood operations.
% In this case, the positions in the kernel that do not equal zeros will be evaluated.
% In other words, this can be viewed as a structuring element for the max neighborhood.
%
% numIterations (optional) = This is the number of iterations to run the max filter for a given position.
% This is useful for growing regions by the shape of the structuring element or for very large neighborhoods.
% Can be empty an array [].
%
% device (optional) = Use this if you have multiple devices and want to select one explicitly.
% Setting this to [] allows the algorithm to either pick the best device and/or will try to split
% the data across multiple devices.
%
% imageOut = This will be an array of the same type and shape as the input array.
function arrayOut = MinFilter(arrayIn,kernel,numIterations,device)
[arrayOut] = HIP.Cuda.Mex('MinFilter',arrayIn,kernel,numIterations,device);
end
% MinMax - This returns the global min and max values.
% [minOut,maxOut] = HIP.Cuda.MinMax(arrayIn,[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial.
% The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block.
%
% device (optional) = Use this if you have multiple devices and want to select one explicitly.
% Setting this to [] allows the algorithm to either pick the best device and/or will try to split
% the data across multiple devices.
%
% minOut = This is the minimum value found in the input.
% maxOut = This is the maximum value found in the input.
function [minOut,maxOut] = MinMax(arrayIn,device)
[minOut,maxOut] = HIP.Cuda.Mex('MinMax',arrayIn,device);
end
% MinMax - This returns the global min and max values.
% [minOut,maxOut] = HIP.Cuda.MinMax(arrayIn,[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial.
% The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block.
%
% device (optional) = Use this if you have multiple devices and want to select one explicitly.
% Setting this to [] allows the algorithm to either pick the best device and/or will try to split
% the data across multiple devices.
%
% minOut = This is the minimum value found in the input.
% maxOut = This is the maximum value found in the input.
function [minOut,maxOut] = MinMax(arrayIn,device)
[minOut,maxOut] = HIP.Cuda.Mex('MinMax',arrayIn,device);
end
% MultiplySum - Multiplies the kernel with the neighboring values and sums these new values.
% arrayOut = HIP.Cuda.MultiplySum(arrayIn,kernel,[numIterations],[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial.
% The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block.
%
% kernel = This is a one to three dimensional array that will be used to determine neighborhood operations.
% In this case, the positions in the kernel that do not equal zeros will be evaluated.
% In other words, this can be viewed as a structuring element for the max neighborhood.
%
% numIterations (optional) = This is the number of iterations to run the max filter for a given position.
% This is useful for growing regions by the shape of the structuring element or for very large neighborhoods.
% Can be empty an array [].
%
% device (optional) = Use this if you have multiple devices and want to select one explicitly.
% Setting this to [] allows the algorithm to either pick the best device and/or will try to split
% the data across multiple devices.
%
% imageOut = This will be an array of the same type and shape as the input array.
function arrayOut = MultiplySum(arrayIn,kernel,numIterations,device)
[arrayOut] = HIP.Cuda.Mex('MultiplySum',arrayIn,kernel,numIterations,device);
end
% MultiplySum - Multiplies the kernel with the neighboring values and sums these new values.
% arrayOut = HIP.Cuda.MultiplySum(arrayIn,kernel,[numIterations],[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial.
% The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block.
%
% kernel = This is a one to three dimensional array that will be used to determine neighborhood operations.
% In this case, the positions in the kernel that do not equal zeros will be evaluated.
% In other words, this can be viewed as a structuring element for the max neighborhood.
%
% numIterations (optional) = This is the number of iterations to run the max filter for a given position.
% This is useful for growing regions by the shape of the structuring element or for very large neighborhoods.
% Can be empty an array [].
%
% device (optional) = Use this if you have multiple devices and want to select one explicitly.
% Setting this to [] allows the algorithm to either pick the best device and/or will try to split
% the data across multiple devices.
%
% imageOut = This will be an array of the same type and shape as the input array.
function arrayOut = MultiplySum(arrayIn,kernel,numIterations,device)
[arrayOut] = HIP.Cuda.Mex('MultiplySum',arrayIn,kernel,numIterations,device);
end
% Opener - This kernel will erode follow by a dilation.
% arrayOut = HIP.Cuda.Opener(arrayIn,kernel,[numIterations],[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial.
% The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block.
%
% kernel = This is a one to three dimensional array that will be used to determine neighborhood operations.
% In this case, the positions in the kernel that do not equal zeros will be evaluated.
% In other words, this can be viewed as a structuring element for the max neighborhood.
%
% numIterations (optional) = This is the number of iterations to run the max filter for a given position.
% This is useful for growing regions by the shape of the structuring element or for very large neighborhoods.
% Can be empty an array [].
%
% device (optional) = Use this if you have multiple devices and want to select one explicitly.
% Setting this to [] allows the algorithm to either pick the best device and/or will try to split
% the data across multiple devices.
%
% imageOut = This will be an array of the same type and shape as the input array.
function arrayOut = Opener(arrayIn,kernel,numIterations,device)
[arrayOut] = HIP.Cuda.Mex('Opener',arrayIn,kernel,numIterations,device);
end
% Opener - This kernel will erode follow by a dilation.
% arrayOut = HIP.Cuda.Opener(arrayIn,kernel,[numIterations],[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial.
% The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block.
%
% kernel = This is a one to three dimensional array that will be used to determine neighborhood operations.
% In this case, the positions in the kernel that do not equal zeros will be evaluated.
% In other words, this can be viewed as a structuring element for the max neighborhood.
%
% numIterations (optional) = This is the number of iterations to run the max filter for a given position.
% This is useful for growing regions by the shape of the structuring element or for very large neighborhoods.
% Can be empty an array [].
%
% device (optional) = Use this if you have multiple devices and want to select one explicitly.
% Setting this to [] allows the algorithm to either pick the best device and/or will try to split
% the data across multiple devices.
%
% imageOut = This will be an array of the same type and shape as the input array.
function arrayOut = Opener(arrayIn,kernel,numIterations,device)
[arrayOut] = HIP.Cuda.Mex('Opener',arrayIn,kernel,numIterations,device);