Commit b819ed6
Simon Rit
BUG: Fix CastImageFilter for VariableLengthVector
The `Get` function of `VectorImage` iterators calls the
`VariableLengthVector` constructor parameterized by a const pointer and
a vector length (see `DefaultVectorPixelAccessor::Get`). The `m_Data`
pointer of the constructed VariableLengthVector which is returned is
pointing to the returned pixel data. This was a problem in
CastImageFitler.
A `CastImageFilter` test has been added to reproduce the issue: when a
`VectorImage` was casted to an `Image< Vector <`, the first pixel of the
region was taking the value of the last pixel of the region. The test
illustrated this by creating an image filled with 0 except the first
pixel. The casted image was completely full of 0 before bug correction.1 parent a8dd05b commit b819ed6
File tree
2 files changed
+46
-1
lines changed- Modules/Filtering/ImageFilterBase
- include
- test
2 files changed
+46
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
| 148 | + | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| |||
Lines changed: 45 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
403 | 447 | | |
404 | 448 | | |
405 | 449 | | |
| |||
431 | 475 | | |
432 | 476 | | |
433 | 477 | | |
| 478 | + | |
434 | 479 | | |
435 | 480 | | |
436 | 481 | | |
| |||
0 commit comments