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

Set Threshold to default to 1 on the mask kernel

parent 94893f86
No related branches found
No related tags found
No related merge requests found
......@@ -402,7 +402,7 @@ public:
* The threshold it to allow the input image to be gray scale instead of logical.
* This buffer will get zeroed out where the imageMask is less than or equal to the threshold.
*/
void mask(const CudaProcessBuffer* imageMask, ImagePixelType threshold)
void mask(const CudaProcessBuffer* imageMask, ImagePixelType threshold=1)
{
cudaMask<<<blocks,threads>>>(getCurrentBuffer(),imageMask->getCudaBuffer(),getNextBuffer(),imageDims,threshold,isColumnMajor);
incrementBufferNumber();
......
......@@ -10,13 +10,17 @@ void Mask::execute( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[] )
MexImagePixelType* imageIn2;
setupImagePointers(prhs[1],&imageIn2,&imageDims2);
double threshold = mxGetScalar(prhs[2]);
double threshold = 1;
if (nrhs==3)
threshold = mxGetScalar(prhs[2]);
mask(imageIn1,imageIn2,imageOut,imageDims1,threshold);
}
std::string Mask::check( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[] )
{
if (nrhs!=3)
if (nrhs!=2 && nrhs!=3)
return "Incorrect number of inputs!";
if (nlhs!=1)
......@@ -33,13 +37,16 @@ std::string Mask::check( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prh
if (numDims>3 || numDims<2)
return "Image can only be either 2D or 3D!";
if (!mxIsDouble(prhs[2]))
return "Threshold needs to be a double!";
if (nrhs==3)
{
if (!mxIsDouble(prhs[2]))
return "Threshold needs to be a double!";
}
return "";
}
std::string Mask::printUsage()
{
return "imageOut = CudaMex('Mask',imageIn1,imageIn2,threshold)";
return "imageOut = CudaMex('Mask',imageIn,imageInMask[,threshold])";
}
\ No newline at end of file
......@@ -16,7 +16,7 @@ void gaussianFilter(const MexImagePixelType* image, MexImagePixelType* imageOut,
size_t getGlobalMemoryAvailable(const MexImagePixelType* image1, const MexImagePixelType* image2, MexImagePixelType* imageOut,
Vec<unsigned int> imageDims, double factor);
void mask(const MexImagePixelType* image1, const MexImagePixelType* image2, MexImagePixelType* imageOut, Vec<unsigned int> imageDims,
double theshold);
double theshold=1);
void maxFilter(const MexImagePixelType* image, MexImagePixelType* imageOut, Vec<unsigned int> imageDims, Vec<unsigned int> neighborhood,
double* kernel=NULL);
void maximumIntensityProjection(const MexImagePixelType* image, MexImagePixelType* imageOut, Vec<unsigned int> imageDims);
......
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