Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NutriMorph
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
Service Desk
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
DEBREUVE Eric
NutriMorph
Commits
108edce6
Commit
108edce6
authored
5 years ago
by
DEBREUVE Eric
Browse files
Options
Downloads
Patches
Plain Diff
added an itk version to frangi
parent
240dcd09
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
frangi_3d.py
+38
-0
38 additions, 0 deletions
frangi_3d.py
with
39 additions
and
0 deletions
.gitignore
+
1
−
0
View file @
108edce6
.idea/
.mypy_cache/
__material__/
__pycache__/
__version__/
...
...
This diff is collapsed.
Click to expand it.
frangi_3d.py
+
38
−
0
View file @
108edce6
...
...
@@ -29,6 +29,10 @@
# The fact that you are presently reading this means that you have had
# knowledge of the CeCILL license and that you accept its terms.
'''
Follows: https://github.com/ellisdg/frangi3d
'''
from
type
import
array_t
import
multiprocessing
as
pl_
...
...
@@ -36,6 +40,7 @@ from ctypes import c_float as c_float_t
from
multiprocessing.sharedctypes
import
Array
as
shared_array_t
from
typing
import
Optional
,
Tuple
import
itk
as
ik_
import
numpy
as
np_
from
scipy
import
ndimage
as
im_
...
...
@@ -204,6 +209,39 @@ def _FrangiEnhancementOneScale(
shared_enhanced
[:]
=
local_enhanced
.
flatten
()[:]
def
_ITKFrangiEnhancementOneScale
(
img
:
array_t
,
scale
:
float
,
alpha
:
float
=
0.5
,
beta
:
float
=
0.5
,
frangi_c
:
float
=
500.0
,
bright_on_dark
:
bool
=
True
,
shared_enhanced
:
shared_array_t
=
None
,
)
->
Optional
[
array_t
]:
'''
Do not produce nice resultas as is. Parameter tuning?
'''
print
(
f
"
scale=
{
scale
}
"
)
assert
bright_on_dark
img
=
ik_
.
image_view_from_array
(
img
)
hessian_image
=
ik_
.
hessian_recursive_gaussian_image_filter
(
img
,
sigma
=
scale
)
vesselness_filter
=
ik_
.
Hessian3DToVesselnessMeasureImageFilter
[
ik_
.
ctype
(
'
float
'
)].
New
()
vesselness_filter
.
SetInput
(
hessian_image
)
# vesselness_filter.SetAlpha1(args.alpha1)
# vesselness_filter.SetAlpha2(args.alpha2)
# Do not view-version here since vesselness_filter is local
local_enhanced
=
ik_
.
array_from_image
(
vesselness_filter
)
if
shared_enhanced
is
None
:
return
local_enhanced
else
:
shared_enhanced
[:]
=
local_enhanced
.
flatten
()[:]
def
_EigenValuesOfHessianMatrix
(
img
:
array_t
,
scale
:
float
)
->
array_t
:
#
global
_hessian_matrices
...
...
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