Enabling Undo for trakEM2 scripts

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Pol
Reply | Threaded
Open this post in threaded view
|

Enabling Undo for trakEM2 scripts

Pol
I'm working on a couple trakEM2 scripts and I'd like to enable undo/redo in
them but I can't figure out why it keeps saying the undo history is empty

Here an excerpt of the interesting part which a script that performs
interpolate on all selected arealists (so I'm sort of mimicking
Display.java:3447 - 3480)

for arealist in selectedAreaLists:
  [...]
  layerset.addTransformStep()
  #layerset.addDataEditStep(arealist)
  arealist.interpolate(firstLayer,lastLayer,[...])
  #layerset.addDateEditStep(arealist)
  layerset.addTransformStep()

None of the two options  (addDateEditStep or addTransformStep) work. The
commented one says I'm trying to convert the arealist into a java.util.Set,
I'm not used to Jython so I don't know how to "cast" arealist to
Displayable.

Another script does a lot of changes on several layers and several
arealists, how could I save the arealists state before running it so it can
be undone in case it's required?

Cheers,

Pol

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html