Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VTK
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Erik Palmer
VTK
Commits
67221cf7
Commit
67221cf7
authored
10 years ago
by
Julien Finet
Browse files
Options
Downloads
Patches
Plain Diff
Exposes vtkHighestDensityRegionStatistics::ComputeHDR() to the public API
parent
b6947eed
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
Filters/Statistics/vtkHighestDensityRegionsStatistics.cxx
+19
-8
19 additions, 8 deletions
Filters/Statistics/vtkHighestDensityRegionsStatistics.cxx
Filters/Statistics/vtkHighestDensityRegionsStatistics.h
+16
-8
16 additions, 8 deletions
Filters/Statistics/vtkHighestDensityRegionsStatistics.h
with
35 additions
and
16 deletions
Filters/Statistics/vtkHighestDensityRegionsStatistics.cxx
+
19
−
8
View file @
67221cf7
...
...
@@ -196,8 +196,17 @@ void vtkHighestDensityRegionsStatistics::Derive(vtkMultiBlockDataSet*)
// ----------------------------------------------------------------------
double
vtkHighestDensityRegionsStatistics
::
ComputeHDR
(
vtkDataArray
*
inObs
,
vtkDataArray
*
outDensity
)
{
return
ComputeHDR
(
inObs
,
inObs
,
outDensity
);
}
// ----------------------------------------------------------------------
double
vtkHighestDensityRegionsStatistics
::
ComputeHDR
(
vtkDataArray
*
inObs
,
vtkDataArray
*
inPointsOfInterest
,
vtkDataArray
*
outDensity
)
{
vtkIdType
nbObservations
=
inObs
->
GetNumberOfTuples
();
vtkIdType
nbPoints
=
inPointsOfInterest
->
GetNumberOfTuples
();
if
(
nbObservations
==
0
)
{
...
...
@@ -208,29 +217,31 @@ double vtkHighestDensityRegionsStatistics::ComputeHDR(vtkDataArray *inObs,
double
denom
=
1.0
/
static_cast
<
double
>
(
nbObservations
);
// Let's compute the HDR for each points of
the observations
for
(
vtkIdType
i
=
0
;
i
<
nb
Observation
s
;
i
++
)
// Let's compute the HDR for each points of
interest
for
(
vtkIdType
i
=
0
;
i
<
nb
Point
s
;
i
++
)
{
double
currentXi
[
2
];
double
currentXj
[
2
];
double
hdr
=
0.0
;
// We are working in a bivariate model.
in
Obs
->
GetTuple
(
i
,
currentXi
);
in
PointsOfInterest
->
GetTuple
(
i
,
currentXi
);
// Sum all gaussian kernel
for
(
vtkIdType
j
=
0
;
j
<
nbObservations
;
j
++
)
{
inObs
->
GetTuple
(
j
,
currentXj
);
const
double
deltaX
=
currentXi
[
0
]
-
currentXj
[
0
];
const
double
deltaY
=
currentXi
[
1
]
-
currentXj
[
1
];
// Avoid case where point is compared to itself
if
(
i
==
j
)
if
(
deltaX
==
0.
&&
deltaY
==
0.
)
{
continue
;
}
inObs
->
GetTuple
(
j
,
currentXj
);
hdr
+=
this
->
ComputeSmoothGaussianKernel
(
inObs
->
GetNumberOfComponents
(),
currentXi
[
0
]
-
currentXj
[
0
],
currentXi
[
1
]
-
currentXj
[
1
]);
deltaX
,
deltaY
);
}
double
d
=
denom
*
hdr
;
outDensity
->
SetTuple1
(
i
,
d
);
...
...
This diff is collapsed.
Click to expand it.
Filters/Statistics/vtkHighestDensityRegionsStatistics.h
+
16
−
8
View file @
67221cf7
...
...
@@ -69,6 +69,22 @@ public:
vtkGetVectorMacro
(
SmoothHC2
,
double
,
2
);
vtkSetVectorMacro
(
SmoothHC2
,
double
,
2
);
// Description:
// Fill outDensity with density vector that is computed from
// inObservations values. This method uses a Gaussian kernel.
// For n observations and with X an observation point:
// f(X) = (1 / n) * Sum(KH(X -Xi)) for (i = 1 to n).
// Look ComputeSmoothGaussianKernel for KH kernel definition.
double
ComputeHDR
(
vtkDataArray
*
inObservations
,
vtkDataArray
*
outDensity
);
// Description:
// Fill outDensity with density vector defined by inPOI and computed from
// the inObs values. This method uses a Gaussian kernel.
// For n observations and with X an observation point:
// f(X) = (1 / n) * Sum(KH(X -Xi)) for (i = 1 to n).
// Look ComputeSmoothGaussianKernel for KH kernel definition.
double
ComputeHDR
(
vtkDataArray
*
inObs
,
vtkDataArray
*
inPOI
,
vtkDataArray
*
outDensity
);
protected
:
vtkHighestDensityRegionsStatistics
();
~
vtkHighestDensityRegionsStatistics
();
...
...
@@ -104,14 +120,6 @@ protected:
AssessFunctor
*&
)
{
return
;
}
//ETX
// Description:
// Fill outDensity with density vector that is computed from
// inObservations values. This method uses a Gaussian kernel.
// For n observations and with X an observation point:
// f(X) = (1 / n) * Sum(KH(X -Xi)) for (i = 1 to n).
// Look ComputeSmoothGaussianKernel for KH kernel definition.
double
ComputeHDR
(
vtkDataArray
*
inObservations
,
vtkDataArray
*
outDensity
);
// Description:
// Store the smooth matrix parameter H. Specify a smooth direction
// for the Gaussian kernel.
...
...
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