Ticket #1091 (closed defect: fixed)

Opened 8 years ago

Last modified 7 years ago

Invert plugin only inverts 2 out of 3 channels for color image

Reported by: leek Owned by: bdezonia
Priority: major Milestone: imagej2-b2-bugfixes
Component: Other Version: 2.0.0-beta1
Severity: serious Keywords: ij-plugins-data
Cc: Blocked By:
Blocking: #1016


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.

Change History

comment:1 Changed 8 years ago by bdezonia

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in 2f3d71f1c75da1a47f2f242d7054d0da05b11f97

comment:2 Changed 8 years ago by bdezonia

  • Milestone changed from imagej-2.0.0-beta3 to imagej-2.0.0-beta2

comment:3 Changed 7 years ago by bdezonia

  • Blocking 1016 added
Note: See TracTickets for help on using tickets.