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
Andrew Bauer
VTK
Commits
de7fdcf1
Commit
de7fdcf1
authored
Apr 10, 2020
by
Andrew Bauer
Browse files
Refactor ResampleToImage for performance
parent
555ef3a3
Pipeline
#168234
running with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Filters/Core/vtkResampleToImage.cxx
View file @
de7fdcf1
...
...
@@ -268,6 +268,9 @@ public:
this
->
CellDim
[
1
]
=
vtkMath
::
Max
(
1
,
this
->
PointDim
[
1
]
-
1
);
this
->
CellDim
[
2
]
=
vtkMath
::
Max
(
1
,
this
->
PointDim
[
2
]
-
1
);
this
->
CellSliceSize
=
this
->
CellDim
[
0
]
*
this
->
CellDim
[
1
];
this
->
Dim
[
0
]
=
(
this
->
PointDim
[
0
]
>
1
)
?
1
:
0
;
this
->
Dim
[
1
]
=
(
this
->
PointDim
[
1
]
>
1
)
?
1
:
0
;
this
->
Dim
[
2
]
=
(
this
->
PointDim
[
2
]
>
1
)
?
1
:
0
;
}
void
operator
()(
vtkIdType
begin
,
vtkIdType
end
)
...
...
@@ -281,17 +284,12 @@ public:
vtkIdType
ptid
=
ptijk
[
0
]
+
this
->
PointDim
[
0
]
*
ptijk
[
1
]
+
this
->
PointSliceSize
*
ptijk
[
2
];
int
dim
[
3
];
dim
[
0
]
=
(
this
->
PointDim
[
0
]
>
1
)
?
1
:
0
;
dim
[
1
]
=
(
this
->
PointDim
[
1
]
>
1
)
?
1
:
0
;
dim
[
2
]
=
(
this
->
PointDim
[
2
]
>
1
)
?
1
:
0
;
bool
validCell
=
true
;
for
(
int
k
=
0
;
k
<=
d
im
[
2
];
++
k
)
for
(
int
k
=
0
;
k
<=
this
->
D
im
[
2
];
++
k
)
{
for
(
int
j
=
0
;
j
<=
d
im
[
1
];
++
j
)
for
(
int
j
=
0
;
j
<=
this
->
D
im
[
1
];
++
j
)
{
for
(
int
i
=
0
;
i
<=
d
im
[
0
];
++
i
)
for
(
int
i
=
0
;
i
<=
this
->
D
im
[
0
];
++
i
)
{
validCell
&=
(
0
!=
this
->
MaskArray
[
ptid
+
i
+
(
j
*
this
->
PointDim
[
0
])
+
(
k
*
this
->
PointSliceSize
)]);
...
...
@@ -316,6 +314,7 @@ private:
vtkIdType
PointSliceSize
;
int
CellDim
[
3
];
vtkIdType
CellSliceSize
;
int
Dim
[
3
];
};
}
// anonymous namespace
...
...
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