Commit 2e8c70a
committed
PERF: Use tuned ImageRangeRegion copy in CastImageFilter
Based on performance testing, across converting between Image of
Vector and VectorImage, this loop was the best performing. Key
features of the improved performane:
- Uses NumericTraits::GetLength over Image::GetNumberOfComponents,
the former may be constant, while the latter is virtual
- Uses const InputPixelType & inputPixel
- OutputPixelType value{ outputIt.Get() } initialized to a reference
in the output image bufffer and does not perform memory allocation
for variable length vectors.1 parent 4fcc20a commit 2e8c70a
File tree
1 file changed
+20
-18
lines changed- Modules/Filtering/ImageFilterBase/include
1 file changed
+20
-18
lines changedLines changed: 20 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
142 | | - | |
| 143 | + | |
| 144 | + | |
143 | 145 | | |
144 | | - | |
145 | | - | |
146 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
147 | 149 | | |
148 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
149 | 157 | | |
150 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
151 | 161 | | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
| 162 | + | |
162 | 163 | | |
163 | | - | |
164 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
165 | 167 | | |
166 | 168 | | |
167 | 169 | | |
| |||
0 commit comments