Skip to content
Snippets Groups Projects
Commit db7ff032 authored by Eric Wait's avatar Eric Wait
Browse files

Name changed to Hydra Image Processor (HIP)

parent 45167174
No related branches found
No related tags found
No related merge requests found
Showing
with 49 additions and 49 deletions
% MedianFilter - This will calculate the median for each neighborhood defined by the kernel. % MedianFilter - This will calculate the median for each neighborhood defined by the kernel.
% arrayOut = HSP.MedianFilter(arrayIn,kernel,[numIterations],[device]) % arrayOut = HIP.MedianFilter(arrayIn,kernel,[numIterations],[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial. % 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 % The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block. % how to stride or jump to the next spatial block.
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
function arrayOut = MedianFilter(arrayIn,kernel,numIterations,device) function arrayOut = MedianFilter(arrayIn,kernel,numIterations,device)
try try
arrayOut = HSP.Cuda.MedianFilter(arrayIn,kernel,numIterations,device); arrayOut = HIP.Cuda.MedianFilter(arrayIn,kernel,numIterations,device);
catch errMsg catch errMsg
warning(errMsg.message); warning(errMsg.message);
arrayOut = HSP.Local.MedianFilter(arrayIn,kernel,numIterations,device); arrayOut = HIP.Local.MedianFilter(arrayIn,kernel,numIterations,device);
end end
end end
% MinFilter - This will set each pixel/voxel to the max value of the neighborhood defined by the given kernel. % MinFilter - This will set each pixel/voxel to the max value of the neighborhood defined by the given kernel.
% arrayOut = HSP.MinFilter(arrayIn,kernel,[numIterations],[device]) % arrayOut = HIP.MinFilter(arrayIn,kernel,[numIterations],[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial. % 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 % The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block. % how to stride or jump to the next spatial block.
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
function arrayOut = MinFilter(arrayIn,kernel,numIterations,device) function arrayOut = MinFilter(arrayIn,kernel,numIterations,device)
try try
arrayOut = HSP.Cuda.MinFilter(arrayIn,kernel,numIterations,device); arrayOut = HIP.Cuda.MinFilter(arrayIn,kernel,numIterations,device);
catch errMsg catch errMsg
warning(errMsg.message); warning(errMsg.message);
arrayOut = HSP.Local.MinFilter(arrayIn,kernel,numIterations,device); arrayOut = HIP.Local.MinFilter(arrayIn,kernel,numIterations,device);
end end
end end
% MinMax - This returns the global min and max values. % MinMax - This returns the global min and max values.
% [minOut,maxOut] = HSP.MinMax(arrayIn,[device]) % [minOut,maxOut] = HIP.MinMax(arrayIn,[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial. % 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 % The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block. % how to stride or jump to the next spatial block.
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
function [minOut,maxOut] = MinMax(arrayIn,device) function [minOut,maxOut] = MinMax(arrayIn,device)
try try
[minOut,maxOut] = HSP.Cuda.MinMax(arrayIn,device); [minOut,maxOut] = HIP.Cuda.MinMax(arrayIn,device);
catch errMsg catch errMsg
warning(errMsg.message); warning(errMsg.message);
[minOut,maxOut] = HSP.Local.MinMax(arrayIn,device); [minOut,maxOut] = HIP.Local.MinMax(arrayIn,device);
end end
end end
% MultiplySum - Multiplies the kernel with the neighboring values and sums these new values. % MultiplySum - Multiplies the kernel with the neighboring values and sums these new values.
% arrayOut = HSP.MultiplySum(arrayIn,kernel,[numIterations],[device]) % arrayOut = HIP.MultiplySum(arrayIn,kernel,[numIterations],[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial. % 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 % The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block. % how to stride or jump to the next spatial block.
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
function arrayOut = MultiplySum(arrayIn,kernel,numIterations,device) function arrayOut = MultiplySum(arrayIn,kernel,numIterations,device)
try try
arrayOut = HSP.Cuda.MultiplySum(arrayIn,kernel,numIterations,device); arrayOut = HIP.Cuda.MultiplySum(arrayIn,kernel,numIterations,device);
catch errMsg catch errMsg
warning(errMsg.message); warning(errMsg.message);
arrayOut = HSP.Local.MultiplySum(arrayIn,kernel,numIterations,device); arrayOut = HIP.Local.MultiplySum(arrayIn,kernel,numIterations,device);
end end
end end
% Opener - This kernel will erode follow by a dilation. % Opener - This kernel will erode follow by a dilation.
% arrayOut = HSP.Opener(arrayIn,kernel,[numIterations],[device]) % arrayOut = HIP.Opener(arrayIn,kernel,[numIterations],[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial. % 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 % The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block. % how to stride or jump to the next spatial block.
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
function arrayOut = Opener(arrayIn,kernel,numIterations,device) function arrayOut = Opener(arrayIn,kernel,numIterations,device)
try try
arrayOut = HSP.Cuda.Opener(arrayIn,kernel,numIterations,device); arrayOut = HIP.Cuda.Opener(arrayIn,kernel,numIterations,device);
catch errMsg catch errMsg
warning(errMsg.message); warning(errMsg.message);
arrayOut = HSP.Local.Opener(arrayIn,kernel,numIterations,device); arrayOut = HIP.Local.Opener(arrayIn,kernel,numIterations,device);
end end
end end
% StdFilter - This will take the standard deviation of the given neighborhood. % StdFilter - This will take the standard deviation of the given neighborhood.
% arrayOut = HSP.StdFilter(arrayIn,kernel,[numIterations],[device]) % arrayOut = HIP.StdFilter(arrayIn,kernel,[numIterations],[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial. % 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 % The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block. % how to stride or jump to the next spatial block.
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
function arrayOut = StdFilter(arrayIn,kernel,numIterations,device) function arrayOut = StdFilter(arrayIn,kernel,numIterations,device)
try try
arrayOut = HSP.Cuda.StdFilter(arrayIn,kernel,numIterations,device); arrayOut = HIP.Cuda.StdFilter(arrayIn,kernel,numIterations,device);
catch errMsg catch errMsg
warning(errMsg.message); warning(errMsg.message);
arrayOut = HSP.Local.StdFilter(arrayIn,kernel,numIterations,device); arrayOut = HIP.Local.StdFilter(arrayIn,kernel,numIterations,device);
end end
end end
% Sum - This sums up the entire array in. % Sum - This sums up the entire array in.
% valueOut = HSP.Sum(arrayIn,[device]) % valueOut = HIP.Sum(arrayIn,[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial. % 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 % The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block. % how to stride or jump to the next spatial block.
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
function valueOut = Sum(arrayIn,device) function valueOut = Sum(arrayIn,device)
try try
valueOut = HSP.Cuda.Sum(arrayIn,device); valueOut = HIP.Cuda.Sum(arrayIn,device);
catch errMsg catch errMsg
warning(errMsg.message); warning(errMsg.message);
valueOut = HSP.Local.Sum(arrayIn,device); valueOut = HIP.Local.Sum(arrayIn,device);
end end
end end
% VarFilter - This will take the variance deviation of the given neighborhood. % VarFilter - This will take the variance deviation of the given neighborhood.
% arrayOut = HSP.VarFilter(arrayIn,kernel,[numIterations],[device]) % arrayOut = HIP.VarFilter(arrayIn,kernel,[numIterations],[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial. % 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 % The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block. % how to stride or jump to the next spatial block.
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
function arrayOut = VarFilter(arrayIn,kernel,numIterations,device) function arrayOut = VarFilter(arrayIn,kernel,numIterations,device)
try try
arrayOut = HSP.Cuda.VarFilter(arrayIn,kernel,numIterations,device); arrayOut = HIP.Cuda.VarFilter(arrayIn,kernel,numIterations,device);
catch errMsg catch errMsg
warning(errMsg.message); warning(errMsg.message);
arrayOut = HSP.Local.VarFilter(arrayIn,kernel,numIterations,device); arrayOut = HIP.Local.VarFilter(arrayIn,kernel,numIterations,device);
end end
end end
% WienerFilter - A Wiener filter aims to denoise an image in a linear fashion. % WienerFilter - A Wiener filter aims to denoise an image in a linear fashion.
% arrayOut = HSP.WienerFilter(arrayIn,[kernel],[noiseVariance],[device]) % arrayOut = HIP.WienerFilter(arrayIn,[kernel],[noiseVariance],[device])
% imageIn = This is a one to five dimensional array. The first three dimensions are treated as spatial. % 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 % The spatial dimensions will have the kernel applied. The last two dimensions will determine
% how to stride or jump to the next spatial block. % how to stride or jump to the next spatial block.
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
function arrayOut = WienerFilter(arrayIn,kernel,noiseVariance,device) function arrayOut = WienerFilter(arrayIn,kernel,noiseVariance,device)
try try
arrayOut = HSP.Cuda.WienerFilter(arrayIn,kernel,noiseVariance,device); arrayOut = HIP.Cuda.WienerFilter(arrayIn,kernel,noiseVariance,device);
catch errMsg catch errMsg
warning(errMsg.message); warning(errMsg.message);
arrayOut = HSP.Local.WienerFilter(arrayIn,kernel,noiseVariance,device); arrayOut = HIP.Local.WienerFilter(arrayIn,kernel,noiseVariance,device);
end end
end end
function [cTime,mTime,kernelName] = AddConstant(im,additive) function [cTime,mTime,kernelName] = AddConstant(im,additive)
kernelName = 'AddConstant'; kernelName = 'AddConstant';
cT = tic; cT = tic;
imC = HSP.AddConstant(im,additive); imC = HIP.AddConstant(im,additive);
cTime = toc(cT); cTime = toc(cT);
mT = tic; mT = tic;
imM = HSP.AddConstant(im,additive,true); imM = HIP.AddConstant(im,additive,true);
mTime = toc(mT); mTime = toc(mT);
end end
function [cTime,mTime,kernelName] = AddImageWith(im) function [cTime,mTime,kernelName] = AddImageWith(im)
kernelName = 'AddImageWith'; kernelName = 'AddImageWith';
cT = tic; cT = tic;
imC = HSP.AddImageWith(im,im,2); imC = HIP.AddImageWith(im,im,2);
cTime = toc(cT); cTime = toc(cT);
mT = tic; mT = tic;
imM = HSP.AddImageWith(im,im,2,true); imM = HIP.AddImageWith(im,im,2,true);
mTime = toc(mT); mTime = toc(mT);
end end
...@@ -2,16 +2,16 @@ function [cTime,mTime,kernelName,c2Time] = Closure(im,kernel,numDevices) ...@@ -2,16 +2,16 @@ function [cTime,mTime,kernelName,c2Time] = Closure(im,kernel,numDevices)
kernelName = 'Closure'; kernelName = 'Closure';
cT = tic; cT = tic;
imC = HSP.Closure(im,kernel,[],1); imC = HIP.Closure(im,kernel,[],1);
cTime = toc(cT); cTime = toc(cT);
mT = tic; mT = tic;
imM = HSP.Local.Closure(im,kernel,[],[],true); imM = HIP.Local.Closure(im,kernel,[],[],true);
mTime = toc(mT); mTime = toc(mT);
if (numDevices>1) if (numDevices>1)
c2T = tic; c2T = tic;
imC = HSP.Closure(im,kernel,[],[]); imC = HIP.Closure(im,kernel,[],[]);
c2Time = toc(c2T); c2Time = toc(c2T);
else else
c2Time = inf; c2Time = inf;
......
...@@ -10,7 +10,7 @@ function times = ClosureGraph(sizes_rc,sizeItter,types,typeItter,numTrials,numDe ...@@ -10,7 +10,7 @@ function times = ClosureGraph(sizes_rc,sizeItter,types,typeItter,numTrials,numDe
kernel = ones(5,5,3); kernel = ones(5,5,3);
m = memory; m = memory;
cpu_memAvail = m.MemAvailableAllArrays/4; cpu_memAvail = m.MemAvailableAllArrays/4;
m = HSP.Cuda.DeviceStats; m = HIP.Cuda.DeviceStats;
gpu_memAvail = max(m.totalMem); gpu_memAvail = max(m.totalMem);
for i = sizeItter for i = sizeItter
......
function [cTime,mTime,kernelName] = EntropyFilter(im,nhood) function [cTime,mTime,kernelName] = EntropyFilter(im,nhood)
kernelName = 'EntropyFilter'; kernelName = 'EntropyFilter';
cT = tic; cT = tic;
imC = HSP.EntropyFilter(im,ones(nhood)); imC = HIP.EntropyFilter(im,ones(nhood));
cTime = toc(cT); cTime = toc(cT);
mT = tic; mT = tic;
imM = HSP.EntropyFilter(im,ones(nhood),true); imM = HIP.EntropyFilter(im,ones(nhood),true);
mTime = toc(mT); mTime = toc(mT);
end end
...@@ -2,16 +2,16 @@ function [cTime,mTime,kernelName,c2Time] = GaussianFilter(im,sigma,numDevices) ...@@ -2,16 +2,16 @@ function [cTime,mTime,kernelName,c2Time] = GaussianFilter(im,sigma,numDevices)
kernelName = 'GaussianFilter'; kernelName = 'GaussianFilter';
cT = tic; cT = tic;
imC = HSP.Gaussian(im,sigma,[],1); imC = HIP.Gaussian(im,sigma,[],1);
cTime = toc(cT); cTime = toc(cT);
mT = tic; mT = tic;
imM = HSP.Local.Gaussian(im,sigma,[],[],true); imM = HIP.Local.Gaussian(im,sigma,[],[],true);
mTime = toc(mT); mTime = toc(mT);
if (numDevices>1) if (numDevices>1)
c2T = tic; c2T = tic;
imC = HSP.Gaussian(im,sigma,[],[]); imC = HIP.Gaussian(im,sigma,[],[]);
c2Time = toc(c2T); c2Time = toc(c2T);
else else
c2Time = inf; c2Time = inf;
......
...@@ -10,7 +10,7 @@ function times = GaussianFilterGraph(sizes_rc,sizeItter,types,typeItter,numTrial ...@@ -10,7 +10,7 @@ function times = GaussianFilterGraph(sizes_rc,sizeItter,types,typeItter,numTrial
m = memory; m = memory;
cpu_memAvail = m.MemAvailableAllArrays/4; cpu_memAvail = m.MemAvailableAllArrays/4;
m = HSP.Cuda.DeviceStats; m = HIP.Cuda.DeviceStats;
gpu_memAvail = max(m.totalMem); gpu_memAvail = max(m.totalMem);
for i = sizeItter for i = sizeItter
......
...@@ -2,16 +2,16 @@ function [cTime,mTime,kernelName,c2Time] = HighPassFilter(im,gauss,numDevices) ...@@ -2,16 +2,16 @@ function [cTime,mTime,kernelName,c2Time] = HighPassFilter(im,gauss,numDevices)
kernelName = 'Contrast Enhancement'; kernelName = 'Contrast Enhancement';
cT = tic; cT = tic;
imC = HSP.HighPassFilter(im,gauss,1); imC = HIP.HighPassFilter(im,gauss,1);
cTime = toc(cT); cTime = toc(cT);
mT = tic; mT = tic;
imM = HSP.Local.HighPassFilter(im,gauss,[],true); imM = HIP.Local.HighPassFilter(im,gauss,[],true);
mTime = toc(mT); mTime = toc(mT);
if (numDevices>1) if (numDevices>1)
c2T = tic; c2T = tic;
imC = HSP.HighPassFilter(im,gauss,[]); imC = HIP.HighPassFilter(im,gauss,[]);
c2Time = toc(c2T); c2Time = toc(c2T);
else else
c2Time = inf; c2Time = inf;
......
...@@ -10,7 +10,7 @@ function times = HighPassFilterGraph(sizes_rc,sizeItter,types,typeItter,numTrial ...@@ -10,7 +10,7 @@ function times = HighPassFilterGraph(sizes_rc,sizeItter,types,typeItter,numTrial
m = memory; m = memory;
cpu_memAvail = m.MemAvailableAllArrays/4; cpu_memAvail = m.MemAvailableAllArrays/4;
m = HSP.Cuda.DeviceStats; m = HIP.Cuda.DeviceStats;
gpu_memAvail = max(m.totalMem); gpu_memAvail = max(m.totalMem);
for i = sizeItter for i = sizeItter
......
...@@ -2,18 +2,18 @@ function [cTime,mTime,kernelName,c2Time] = MaxFilter(im,kernel,numDevices) ...@@ -2,18 +2,18 @@ function [cTime,mTime,kernelName,c2Time] = MaxFilter(im,kernel,numDevices)
kernelName = 'MaxFilter'; kernelName = 'MaxFilter';
cT = tic; cT = tic;
imC = HSP.MaxFilter(im,kernel,[],1); imC = HIP.MaxFilter(im,kernel,[],1);
cTime = toc(cT); cTime = toc(cT);
clear imC clear imC
mT = tic; mT = tic;
imM = HSP.Local.MaxFilter(im,kernel,[],[],true); imM = HIP.Local.MaxFilter(im,kernel,[],[],true);
mTime = toc(mT); mTime = toc(mT);
clear imM clear imM
if (numDevices>1) if (numDevices>1)
c2T = tic; c2T = tic;
imC = HSP.MaxFilter(im,kernel,[],[]); imC = HIP.MaxFilter(im,kernel,[],[]);
c2Time = toc(c2T); c2Time = toc(c2T);
else else
c2Time = inf; c2Time = inf;
......
...@@ -10,7 +10,7 @@ function times = MaxFilterGraph(sizes_rc,sizeItter,types,typeItter,numTrials,num ...@@ -10,7 +10,7 @@ function times = MaxFilterGraph(sizes_rc,sizeItter,types,typeItter,numTrials,num
kernel = ones(5,5,3); kernel = ones(5,5,3);
m = memory; m = memory;
cpu_memAvail = m.MemAvailableAllArrays/4; cpu_memAvail = m.MemAvailableAllArrays/4;
m = HSP.Cuda.DeviceStats; m = HIP.Cuda.DeviceStats;
gpu_memAvail = max(m.totalMem); gpu_memAvail = max(m.totalMem);
for i = sizeItter for i = sizeItter
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment