Ticket #1091 (closed defect: fixed)
Opened 2012-04-09T08:02:48-05:00
Last modified 2012-12-05T15:32:38-06:00
Invert plugin only inverts 2 out of 3 channels for color image
Reported by: | leek | Owned by: | bdezonia |
---|---|---|---|
Priority: | major | Milestone: |
|
Component: | Other | Version: | 2.0.0-beta1 |
Severity: | serious | Keywords: | ij-plugins-data |
Cc: | Blocked By: | ||
Blocking: | #1016 |
Description
The invert plugin and, I believe, any other that uses imagej.core.plugins.assign.InplaceUnaryTransform, will only update the first two planes of a color image. To reproduce:
File / Open Samples / Clown
Edit / Invert [IJ2]
Image / Color / Split Channels.
Two of the channels are clearly inverted and the third is not. The problem is in InplaceUnaryTransform.setOriginAndSpan which records the position of the last pixel in each dimension, rather than the length of the dimension (span[i] = dims[i] - 1). net.imglib.ops.image.ImageAssignment.buildRegion then creates offsets pOffsets[i] = spn[i] - 1. The resulting region will be shortened by 1 in every dimension, most notably the channel dimension.
Fixed in 2f3d71f1c75da1a47f2f242d7054d0da05b11f97