Commit 0b6156d
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 0b6156d
File tree
1 file changed
+19
-20
lines changed- Modules/Filtering/ImageFilterBase/include
1 file changed
+19
-20
lines changedLines changed: 19 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
149 | 154 | | |
150 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
151 | 158 | | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
| 159 | + | |
162 | 160 | | |
163 | | - | |
164 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
165 | 164 | | |
166 | 165 | | |
167 | 166 | | |
| |||
0 commit comments