private void syncWindows(Object source) { if (SyncWindows.getInstance()==null) return; if (source==cSelector) SyncWindows.setC(this, cSelector.getValue()); else if (source==zSelector) { int stackSize = imp.getStackSize(); if (imp.getNChannels()==stackSize) SyncWindows.setC(this, zSelector.getValue()); else if (imp.getNFrames()==stackSize) SyncWindows.setT(this, zSelector.getValue()); else SyncWindows.setZ(this, zSelector.getValue()); } else if (source==tSelector) SyncWindows.setT(this, tSelector.getValue()); else throw new RuntimeException("Unknownsource:"+source); }
private void syncWindows(Object source) { if (SyncWindows.getInstance()==null) return; if (source==cSelector) SyncWindows.setC(this, cSelector.getValue()); else if (source==zSelector) { int stackSize = imp.getStackSize(); if (imp.getNChannels()==stackSize) SyncWindows.setC(this, zSelector.getValue()); else if (imp.getNFrames()==stackSize) SyncWindows.setT(this, zSelector.getValue()); else SyncWindows.setZ(this, zSelector.getValue()); } else if (source==tSelector) SyncWindows.setT(this, tSelector.getValue()); else throw new RuntimeException("Unknownsource:"+source); }
public void setPosition(int channel, int slice, int frame) { if (cSelector!=null && channel!=c) { c = channel; cSelector.setValue(channel); SyncWindows.setC(this, channel); } if (zSelector!=null && slice!=z) { z = slice; zSelector.setValue(slice); SyncWindows.setZ(this, slice); } if (tSelector!=null && frame!=t) { t = frame; tSelector.setValue(frame); SyncWindows.setT(this, frame); } updatePosition(); if (this.slice>0) { int s = this.slice; this.slice = 0; if (s!=imp.getCurrentSlice()) imp.setSlice(s); } }
public void setPosition(int channel, int slice, int frame) { if (cSelector!=null && channel!=c) { c = channel; cSelector.setValue(channel); SyncWindows.setC(this, channel); } if (zSelector!=null && slice!=z) { z = slice; zSelector.setValue(slice); SyncWindows.setZ(this, slice); } if (tSelector!=null && frame!=t) { t = frame; tSelector.setValue(frame); SyncWindows.setT(this, frame); } updatePosition(); if (this.slice>0) { int s = this.slice; this.slice = 0; if (s!=imp.getCurrentSlice()) imp.setSlice(s); } }