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
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
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
Alex W.
VTK
Commits
20a86e82
Commit
20a86e82
authored
9 years ago
by
Ben Boeckel
Browse files
Options
Downloads
Patches
Plain Diff
vtkImageAccumulate: handle errors in the actual algorithm
parent
f0c36199
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Imaging/Statistics/vtkImageAccumulate.cxx
+16
-10
16 additions, 10 deletions
Imaging/Statistics/vtkImageAccumulate.cxx
with
16 additions
and
10 deletions
Imaging/Statistics/vtkImageAccumulate.cxx
+
16
−
10
View file @
20a86e82
...
...
@@ -126,14 +126,14 @@ vtkImageStencilData *vtkImageAccumulate::GetStencil()
//----------------------------------------------------------------------------
// This templated function executes the filter for any type of data.
template
<
class
T
>
void
vtkImageAccumulateExecute
(
vtkImageAccumulate
*
self
,
vtkImageData
*
inData
,
T
*
,
vtkImageData
*
outData
,
vtkIdType
*
outPtr
,
double
min
[
3
],
double
max
[
3
],
double
mean
[
3
],
double
standardDeviation
[
3
],
vtkIdType
*
voxelCount
,
int
*
updateExtent
)
int
vtkImageAccumulateExecute
(
vtkImageAccumulate
*
self
,
vtkImageData
*
inData
,
T
*
,
vtkImageData
*
outData
,
vtkIdType
*
outPtr
,
double
min
[
3
],
double
max
[
3
],
double
mean
[
3
],
double
standardDeviation
[
3
],
vtkIdType
*
voxelCount
,
int
*
updateExtent
)
{
// variables used to compute statistics (filter handles max 3 components)
double
sum
[
3
];
...
...
@@ -147,6 +147,10 @@ void vtkImageAccumulateExecute(vtkImageAccumulate *self,
// input's number of components is used as output dimensionality
int
numC
=
inData
->
GetNumberOfScalarComponents
();
if
(
numC
>
3
)
{
return
0
;
}
// get information for output data
int
outExtent
[
6
];
...
...
@@ -255,6 +259,7 @@ void vtkImageAccumulateExecute(vtkImageAccumulate *self,
}
}
return
1
;
}
...
...
@@ -308,9 +313,10 @@ int vtkImageAccumulate::RequestData(
return
0
;
}
int
retVal
=
0
;
switch
(
inData
->
GetScalarType
())
{
vtkTemplateMacro
(
vtkImageAccumulateExecute
(
this
,
vtkTemplateMacro
(
retVal
=
vtkImageAccumulateExecute
(
this
,
inData
,
static_cast
<
VTK_TT
*>
(
inPtr
),
outData
,
...
...
@@ -325,7 +331,7 @@ int vtkImageAccumulate::RequestData(
return
0
;
}
return
1
;
return
retVal
;
}
...
...
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