Skip to content

Commit

Permalink
Merge pull request ome#4193 from dgault/imaris-null-colors
Browse files Browse the repository at this point in the history
Imaris: Remove empty color entries for non 0 indexed colors
  • Loading branch information
dgault authored Jul 10, 2024
2 parents 4860a21 + a5d90ad commit cc8bb5f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public short[][] get16BitLookupTable() {
FormatTools.assertId(currentId, true, 1);
if (getPixelType() != FormatTools.UINT16 || !isIndexed()) return null;

if (lastChannel < 0 || lastChannel >= colors.size()) {
if (lastChannel < 0 || lastChannel >= colors.size() || colors.get(lastChannel) == null) {
return null;
}

Expand Down Expand Up @@ -408,7 +408,7 @@ protected void initFile(String id) throws FormatException, IOException {
catch (NumberFormatException e) { }
}

if (i < colors.size()) {
if (i < colors.size() && colors.get(i) != null) {
double[] color = colors.get(i);
Color realColor = new Color(
(int) (color[0] * 255), (int) (color[1] * 255),
Expand Down

0 comments on commit cc8bb5f

Please sign in to comment.