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
da288a83
Commit
da288a83
authored
10 years ago
by
Eric Wait
Browse files
Options
Downloads
Patches
Plain Diff
Ellipsoid Kernel Creation fixes
parent
42ea0e3c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/c/Common/CHelpers.cpp
+14
-15
14 additions, 15 deletions
src/c/Common/CHelpers.cpp
src/c/Common/CHelpers.h
+1
-1
1 addition, 1 deletion
src/c/Common/CHelpers.h
with
15 additions
and
16 deletions
src/c/Common/CHelpers.cpp
+
14
−
15
View file @
da288a83
#include
"CHelpers.h"
double
*
createEllipsoidKernel
(
Vec
<
size_t
>
radii
,
Vec
<
size_t
>&
kernelDims
)
float
*
createEllipsoidKernel
(
Vec
<
size_t
>
radii
,
Vec
<
size_t
>&
kernelDims
)
{
kernelDims
.
x
=
radii
.
x
*
2
+
1
;
kernelDims
.
y
=
radii
.
y
*
2
+
1
;
kernelDims
.
z
=
radii
.
z
*
2
+
1
;
kernelDims
=
radii
*
2
+
1
;
double
*
kernel
=
new
double
[
kernelDims
.
product
()];
memset
(
kernel
,
0
,
sizeof
(
double
)
*
kernelDims
.
product
());
float
*
kernel
=
new
float
[
kernelDims
.
product
()];
memset
(
kernel
,
0
,
sizeof
(
float
)
*
kernelDims
.
product
());
Vec
<
size_t
>
mid
;
mid
.
x
=
(
kernelDims
.
x
+
1
)
/
2
;
mid
.
y
=
(
kernelDims
.
y
+
1
)
/
2
;
mid
.
z
=
(
kernelDims
.
z
+
1
)
/
2
;
Vec
<
float
>
dimScale
(
1.0
f
/
((
float
)
SQR
(
radii
.
x
)),
1.0
f
/
((
float
)
SQR
(
radii
.
y
)),
1.0
f
/
((
float
)
SQR
(
radii
.
z
)));
Vec
<
size_t
>
mid
((
kernelDims
-
1
)
/
2
);
Vec
<
float
>
dimScale
=
Vec
<
float
>
(
1
,
1
,
1
)
/
Vec
<
float
>
(
radii
.
pwr
(
2
));
Vec
<
size_t
>
cur
(
0
,
0
,
0
);
for
(
cur
.
z
=
0
;
cur
.
z
<
kernelDims
.
z
;
++
cur
.
z
)
for
(
cur
.
z
=
0
;
cur
.
z
<
kernelDims
.
z
;
++
cur
.
z
)
{
for
(
cur
.
y
=
0
;
cur
.
y
<
kernelDims
.
y
;
++
cur
.
y
)
for
(
cur
.
y
=
0
;
cur
.
y
<
kernelDims
.
y
;
++
cur
.
y
)
{
for
(
cur
.
x
=
0
;
cur
.
x
<
kernelDims
.
x
;
++
cur
.
x
)
for
(
cur
.
x
=
0
;
cur
.
x
<
kernelDims
.
x
;
++
cur
.
x
)
{
if
(
dimScale
.
x
*
SQR
(
cur
.
x
-
mid
.
x
)
+
dimScale
.
y
*
SQR
(
cur
.
y
-
mid
.
y
)
+
dimScale
.
z
*
SQR
(
cur
.
z
-
mid
.
z
)
<=
1
)
Vec
<
float
>
tmp
=
dimScale
*
Vec
<
float
>
((
cur
-
mid
).
pwr
(
2
));
if
(
tmp
.
x
+
tmp
.
y
+
tmp
.
z
<=
1.0
f
)
{
size_t
ind
=
kernelDims
.
linearAddressAt
(
cur
);
kernel
[
kernelDims
.
linearAddressAt
(
cur
)]
=
1.0
f
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/c/Common/CHelpers.h
+
1
−
1
View file @
da288a83
...
...
@@ -4,6 +4,6 @@
#include
<memory.h>
#include
<complex>
double
*
createEllipsoidKernel
(
Vec
<
size_t
>
radii
,
Vec
<
size_t
>&
kernelDims
);
float
*
createEllipsoidKernel
(
Vec
<
size_t
>
radii
,
Vec
<
size_t
>&
kernelDims
);
int
calcOtsuThreshold
(
const
double
*
normHistogram
,
int
numBins
);
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