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 109 - TrakEM2: custom attributes (e.g. for synapses) cannot be instantiated?
TrakEM2: custom attributes (e.g. for synapses) cannot be instantiated?
Status: RESOLVED INVALID
Product: Fiji
Classification: Unclassified
Component: Plugins
unspecified
PC Windows
: P4 normal
Assigned To: ImageJ Bugs Mailing List
Depends on:
Blocks:
 
Reported: 2009-11-28 22:19 CST by Davi Bock
Modified: 2011-03-13 11:27 CDT
1 user (show)

See Also:

Description Davi Bock 2009-11-28 22:19:18 CST
Experimenting with TrakEM2 0.7l, trying to get  XML attributes working so as to implement synapses as outlined in the "generic_neuronal_network.xml" example in TrakEM2 user manual. The template tree loads, but when try to instantiate this by dragging a synapse element over to the Project Objects hierarchy, I get the following exception:

==================
ERROR:
java.lang.ClassCastException: ini.trakem2.tree.TemplateAttribute cannot be cast to ini.trakem2.tree.Thing
	at ini.trakem2.tree.DNDTree.duplicate(DNDTree.java:554)
	at ini.trakem2.tree.DNDTree.duplicate(DNDTree.java:562)
	at ini.trakem2.tree.DNDTree.duplicate(DNDTree.java:562)
	at ini.trakem2.tree.DNDTree.duplicate(DNDTree.java:549)
	at ini.trakem2.display.LayerSet$DoChangeTrees.<init>(LayerSet.java:1893)
	at ini.trakem2.display.LayerSet.addChangeTreesStep(LayerSet.java:1642)
	at ini.trakem2.tree.DefaultTreeTransferHandler.executeDrop(DefaultTreeTransferHandler.java:185)
	at ini.trakem2.tree.AbstractTreeTransferHandler.drop(AbstractTreeTransferHandler.java:212)
	at java.awt.dnd.DropTarget.drop(DropTarget.java:434)
	at sun.awt.dnd.SunDropTargetContextPeer.processDropMessage(SunDropTargetContextPeer.java:500)
	at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchDropEvent(SunDropTargetContextPeer.java:812)
	at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchEvent(SunDropTargetContextPeer.java:736)
	at sun.awt.dnd.SunDropTargetEvent.dispatch(SunDropTargetEvent.java:30)
	at java.awt.Component.dispatchEventImpl(Component.java:4487)
	at java.awt.Container.dispatchEventImpl(Container.java:2099)
	at java.awt.Component.dispatchEvent(Component.java:4460)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
	at java.awt.LightweightDispatcher.processDropTargetEvent(Container.java:4309)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4163)
	at java.awt.Container.dispatchEventImpl(Container.java:2085)
	at java.awt.Window.dispatchEventImpl(Window.java:2475)
	at java.awt.Component.dispatchEvent(Component.java:4460)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
==================

Here are the pertinent bits of my project XML file:

        <!ELEMENT cerebral_cortex (synapse)>
        <!ATTLIST cerebral_cortex id NMTOKEN #REQUIRED>
        <!ATTLIST cerebral_cortex expanded NMTOKEN #REQUIRED>
        <!ELEMENT synapse EMPTY>
        <!ATTLIST synapse id NMTOKEN #REQUIRED>
        <!ATTLIST synapse expanded NMTOKEN #REQUIRED>
        <!ATTLIST synapse foo_attribute NMTOKEN "-1">

If the last line is eliminated, everything works fine; but I would like to be able to set foo_attribute to the ID of another element, per the "generic_neuronal_network.xml" example.

Am I doing something wrong? It's quite possible I'm not reading the documentation correctly. Or, is there a more up-to-date way to make synapses these days?

Information about your version of Java - this information is useful for the Fiji developers:
  os.arch => amd64
  os.name => Windows XP
  os.version => 5.2
  java.version => 1.6.0_16
  java.vendor => Sun Microsystems Inc.
  java.runtime.name => Java(TM) SE Runtime Environment
  java.runtime.version => 1.6.0_16-b01
  java.vm.name => Java HotSpot(TM) 64-Bit Server VM
  java.vm.version => 14.2-b01
  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 => \
Comment 1 Albert Cardona 2009-11-30 17:09:08 CST
Hi Davi,

You are not doing anything wrong--I just have not used these features for years. A test suite would have cached these; my apologies.

In any case, the attributes are rather inflexible. What I have in mind is an object that takes one origin point and one or more target points. This object could be thought of as a "connection" that links together any objects pinned under its origin and its target points, but with direction: perhaps an "arrow". Such object could represent a synapse and other  relationship objects.

Implementing the "Connection" object is rather trivial. Would such an object fit your needs for representing synapses?

In the way I imagine it, one can then open up a 2D or 3D graph view that has objects such as arealists representing axons and dendrites, and connection objects connecting them in a directional way.

A better name than "connection" and "arrow" would be welcome too, if you can think of one.

Albert
Comment 2 Albert Cardona 2011-03-13 11:27:40 CDT
The connector object has existed for a year now and suited the needs.