Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
hydra-image-processor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenSource
hydra-image-processor
Commits
4305ee60
Commit
4305ee60
authored
11 years ago
by
Eric Wait
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/c/Common/CudaProcessBuffer.cuh
+1
-1
1 addition, 1 deletion
src/c/Common/CudaProcessBuffer.cuh
src/c/CudaMex/Mask.cpp
+12
-5
12 additions, 5 deletions
src/c/CudaMex/Mask.cpp
src/c/CudaMex/Process.h
+1
-1
1 addition, 1 deletion
src/c/CudaMex/Process.h
with
14 additions
and
7 deletions
src/c/Common/CudaProcessBuffer.cuh
+
1
−
1
View file @
4305ee60
...
...
@@ -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
();
...
...
This diff is collapsed.
Click to expand it.
src/c/CudaMex/Mask.cpp
+
12
−
5
View file @
4305ee60
...
...
@@ -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',imageIn
1
,imageIn
2
,threshold)"
;
return
"imageOut = CudaMex('Mask',imageIn,imageIn
Mask[
,threshold
]
)"
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/c/CudaMex/Process.h
+
1
−
1
View file @
4305ee60
...
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment