imagej / ImageJ

Public domain software for processing and analyzing scientific images
http://imagej.org
Other
576 stars 227 forks source link

Seeing a Null Pointer Exception when using Pixel Inspection Tool #226

Open scuniff opened 1 year ago

scuniff commented 1 year ago

ImageJ 1.54f

Exception in thread "Pixel Inspector" java.lang.NullPointerException at ij.plugin.tool.PixelInspector.addImageListeners(PixelInspectionTool.java:238) at ij.plugin.tool.PixelInspector.writeNumbers(PixelInspectionTool.java:351) at ij.plugin.tool.PixelInspector.run(PixelInspectionTool.java:330) at java.lang.Thread.run(Thread.java:748)

Steps:

  1. Open up Fiji
  2. Select Pixel Inspection Tool on Toolbar
  3. Open up File->Open Samples->Fluorecsnt Cells
  4. Left click anywhere on Image a. Pixle Inspection Window pops up
  5. Close Fluorecsnt Cells window
  6. Open up again File->Open Samples->Fluorecsnt Cells a. Console window with Null Pointer Exception pops up

See screen recording:

https://github.com/imagej/ImageJ/assets/40019379/3c8455ff-ea7c-4a3b-802f-61b3ee8e1afd

PixelInspectionTool.java from GitHub:

https://github.com/imagej/ImageJ/blob/master/ij/plugin/tool/PixelInspectionTool.java

This might be the offending code if variable win is null at line 238.

    if (win == null) close();
    canvas = win.getCanvas();