Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bill Lorensen
VTK
Commits
ce38ab1d
Commit
ce38ab1d
authored
Feb 28, 2012
by
David Gobbi
Committed by
Code Review
Feb 28, 2012
Browse files
Merge topic 'threshold-connectivity-progress' into master
00ecfdbb
ENH: Add a progress estimate to vtkImageThresholdConnectivity.
parents
1271c383
00ecfdbb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Imaging/vtkImageThresholdConnectivity.cxx
View file @
ce38ab1d
...
...
@@ -18,8 +18,8 @@
#include
"vtkMath.h"
#include
"vtkImageData.h"
#include
"vtkImageStencilData.h"
#include
"vtkImageProgressIterator.h"
#include
"vtkImageStencilIterator.h"
#include
"vtkImageIterator.h"
#include
"vtkObjectFactory.h"
#include
"vtkPoints.h"
#include
"vtkImageStencilData.h"
...
...
@@ -334,7 +334,7 @@ void vtkImageThresholdConnectivityExecute(
// Set the "outside" with either the input or the OutValue
vtkImageIterator
<
IT
>
inIt
(
inData
,
outExt
);
vtkImage
Progress
Iterator
<
OT
>
outIt
(
outData
,
outExt
,
self
,
id
);
vtkImageIterator
<
OT
>
outIt
(
outData
,
outExt
);
while
(
!
outIt
.
IsAtEnd
())
{
IT
*
inSI
=
inIt
.
BeginSpan
();
...
...
@@ -430,6 +430,10 @@ void vtkImageThresholdConnectivityExecute(
static_cast
<
vtkIdType
>
(
extent
[
3
]
-
extent
[
2
]
+
1
)
*
static_cast
<
vtkIdType
>
(
extent
[
5
]
-
extent
[
4
]
+
1
));
// for the progress meter
double
progress
=
0.0
;
vtkIdType
target
=
static_cast
<
vtkIdType
>
(
fullsize
/
50.0
);
target
++
;
// Setup the mask
maskData
->
SetWholeExtent
(
inData
->
GetWholeExtent
());
...
...
@@ -502,8 +506,8 @@ void vtkImageThresholdConnectivityExecute(
}
double
point
[
3
];
int
nPoints
=
points
->
GetNumberOfPoints
();
for
(
int
p
=
0
;
p
<
nPoints
;
p
++
)
vtkIdType
nPoints
=
points
->
GetNumberOfPoints
();
for
(
vtkIdType
p
=
0
;
p
<
nPoints
;
p
++
)
{
points
->
GetPoint
(
p
,
point
);
vtkFloodFillSeed
seed
=
vtkFloodFillSeed
(
...
...
@@ -519,7 +523,8 @@ void vtkImageThresholdConnectivityExecute(
}
}
int
counter
=
0
;
vtkIdType
counter
=
0
;
vtkIdType
fullcount
=
0
;
while
(
!
seedStack
.
empty
())
{
...
...
@@ -536,6 +541,18 @@ void vtkImageThresholdConnectivityExecute(
}
*
maskPtr1
=
255
;
fullcount
++
;
if
(
id
==
0
&&
(
fullcount
%
target
)
==
0
)
{
double
v
=
counter
/
(
10.0
*
fullcount
);
double
p
=
fullcount
/
(
v
*
fullsize
+
(
1.0
-
v
)
*
fullcount
);
if
(
p
>
progress
)
{
progress
=
p
;
self
->
UpdateProgress
(
progress
);
}
}
IT
*
inPtr1
=
inPtr
+
(
seed
[
0
]
*
inInc
[
0
]
+
seed
[
1
]
*
inInc
[
1
]
+
seed
[
2
]
*
inInc
[
2
]);
...
...
@@ -652,6 +669,11 @@ void vtkImageThresholdConnectivityExecute(
}
}
if
(
id
==
0
)
{
self
->
UpdateProgress
(
1.0
);
}
voxelCount
=
counter
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment