Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ColorTableHarmonizer #259

Open
imagejan opened this issue Oct 27, 2020 · 0 comments
Open

Fix ColorTableHarmonizer #259

imagejan opened this issue Oct 27, 2020 · 0 comments

Comments

@imagejan
Copy link
Member

The logic here is inappropriate:

if (luts == null) { // not a CompositeImage
if (imp.getType() == ImagePlus.COLOR_RGB) {
for (int i = 0; i < imp.getNChannels() * 3; i++) {
final ColorTable cTable = ColorTables.getDefaultColorTable(i);
colorTables.add(cTable);
}
}
else { // not a direct color model image
final IndexColorModel icm =
(IndexColorModel) imp.getProcessor().getColorModel();
ColorTable cTable;
// if (icm.getPixelSize() == 16) // is 16 bit table
// cTable = make16BitColorTable(icm);
// else // 8 bit color table
cTable = make8BitColorTable(icm);
colorTables.add(cTable);
}
}

because since imagej/ImageJ@6c3e9cd, luts will never be null here.

The logic needs to be adapted to the current behavior of ImagePlus that returns an empty list e.g. for RGB images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant