00001 package theba.plugins; 00002 00003 import theba.core.Plugin; 00004 import theba.core.Stack; 00005 import theba.core.gui.ThebaGUI; 00006 import watershed.Watershed_Algorithm; 00007 00008 public class WatershedPlugin implements Plugin { 00009 ThebaGUI control; 00010 00011 public void setup(ThebaGUI f) { 00012 this.control = f; 00013 } 00014 00015 public void process(Stack stack) { 00016 for (int z = 0; z < stack.getDepth(); z++) { 00017 control.setProgress(z); 00018 if (control.isStopped()) 00019 return; 00020 Watershed_Algorithm wa = new Watershed_Algorithm(); 00021 wa.run(stack.getSlice(z), stack.getWidth(), stack.getHeight()); 00022 } 00023 } 00024 00025 public String getName() { 00026 return "Watershed 2D"; 00027 } 00028 00029 public String getAbout() { 00030 return null; 00031 } 00032 00033 public String getCategory() { 00034 return null; 00035 } 00036 }