NOTICE! This is a static HTML version of a legacy Fiji BugZilla bug.

The Fiji project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Bug 69 - Plugins does not work on Images loaded in TrakEM2
Plugins does not work on Images loaded in TrakEM2
Status: RESOLVED WONTFIX
Product: Fiji
Classification: Unclassified
Component: Plugins
unspecified
PC Windows
: P4 normal
Assigned To: ImageJ Bugs Mailing List
Depends on:
Blocks:
 
Reported: 2009-07-24 06:31 CDT by Yap Chin Kiet
Modified: 2009-10-31 21:36 CDT
1 user (show)

See Also:

Description Yap Chin Kiet 2009-07-24 06:31:37 CDT
Useful Java System Properties:
  os.arch => x86
  os.name => Windows Vista
  os.version => 6.0
  java.version => 1.6.0_03
  java.vendor => Sun Microsystems Inc.
  java.runtime.name => Java(TM) SE Runtime Environment
  java.runtime.version => 1.6.0_03-b05
  java.vm.name => Java HotSpot(TM) Client VM
  java.vm.version => 1.6.0_03-b05
  java.vm.vendor => Sun Microsystems Inc.
  java.vm.info => mixed mode
  java.awt.graphicsenv => sun.awt.Win32GraphicsEnvironment
  java.specification.name => Java Platform API Specification
  java.specification.version => 1.6
  sun.cpu.endian => little
  sun.desktop => windows
  file.separator => \

Bug Report Text:

System I'm using: Windows Vista, Win32.

What I did:
I created a blank new TrakEM2, whereupon I dragged a few images from my desktop onto
the TrakEM2 empty canvas.

With an image selected, I went back to Fiji's menus and tried to edit the image using
plugins like Skeletonize 2D/3D and Auto Threshold. I received a Null Pointer Exception
instead from the log.

Plugins was supposed to work on images loaded inside of TrakEM2 too?
Comment 1 Albert Cardona 2009-10-31 21:36:06 CDT
Most plugins do not work with images inside TrakEM2: TrakEM2 doesn't present them to ImageJ in way that the latter can work on most of the times.

The current way in which you could do it is:

# Assuming an image is selected
patch = Display.getFront().getActive()
imp = patch.getImagePlus()
IJ.run(imp, "Invert", "")
patch.set(imp)

To process all images in a layer, loop:

for patch in Display.getFront().getLayer().getDisplayables(Patch):
  imp = patch.getImagePlus()
  IJ.run(imp, "Invert", "")
  patch.set(imp)

If the image type changes, you may want to call patch.setMinAndMax(min, max) to adjust the contrast properly.