public int getChannel(ImagePlus image) { return image.getChannel(); }
int getchannel() { int val = 1; switch (imagetype) { case IMAGE5D: val = I5DResource.position(image,2) + 1; break; case HYPERSTACK: val = image.getChannel(); break; case IMAGESTACK: case SINGLEIMAGE: break; } return val; }
public void setSlice(ImagePlus image, int slice) { image.setPosition(image.getChannel(), slice, image.getFrame()); }
public void setFrame(ImagePlus image, int frame) { image.setPosition(image.getChannel(), image.getSlice(), frame); }
void setslice(final int z) { switch (imagetype) { case IMAGE5D: I5DResource.position(image,3,z-1); break; case HYPERSTACK: image.setPosition(image.getChannel(),z,image.getFrame()); break; case IMAGESTACK: case SINGLEIMAGE: break; } }
private void printPositionInfo() { final int channel = imp.getChannel(); final int slice = imp.getSlice(); final int frame = imp.getFrame(); IJ.log("Position: c=" + channel + ", z=" + slice + ", t=" + frame); } }
void setframe(final int t) { switch (imagetype) { case IMAGE5D: I5DResource.position(image,4,t-1); break; case HYPERSTACK: image.setPosition(image.getChannel(),image.getSlice(),t); break; case IMAGESTACK: image.setSlice(t); break; case SINGLEIMAGE: break; } }
public void sliceChanged(ImagePlus image) { IJ.log("position in '" + image.getTitle() + "': " + image.getChannel() + ", " + image.getSlice() + ", " + image.getFrame()); } });
private void fillModernIJPosition(ImageDisplay disp, ImagePlus imp, long[] dimensions, AxisType[] axes, long[] workspace) { fillIndex(disp, Axes.X, workspace); fillIndex(disp, Axes.Y, workspace); fillIndex(disp, Axes.Z, workspace); fillIndex(disp, Axes.TIME, workspace); LegacyUtils.fillChannelIndices( dimensions, axes, imp.getChannel()-1, workspace); }
/** Updates the slider values to match the ImagePlus's displayed plane. */ private void syncSliders() { cIndex = FormatTools.rasterToPosition(cLengths, imp.getChannel() - 1); for (int i=0; i<cSliders.length; i++) { cSliders[i].setValue(cIndex[i] + 1); } if (zScroll != null) zScroll.setValue(imp.getSlice()); if (tScroll != null) tScroll.setValue(imp.getFrame()); }
/** Updates the slider values to match the ImagePlus's displayed plane. */ private void syncSliders() { cIndex = FormatTools.rasterToPosition(cLengths, imp.getChannel() - 1); for (int i=0; i<cSliders.length; i++) { cSliders[i].setValue(cIndex[i] + 1); } if (zScroll != null) zScroll.setValue(imp.getSlice()); if (tScroll != null) tScroll.setValue(imp.getFrame()); }
public void setCrossLoc(int x, int y, int z) { crossLoc.setLocation(x, y); int slice = z+1; if (slice!=imp.getSlice()) { if (hyperstack) imp.setPosition(imp.getChannel(), slice, imp.getFrame()); else imp.setSlice(slice); sliceSet = true; } while (!initialized) { IJ.wait(10); } update(); }
public void setCrossLoc(int x, int y, int z) { crossLoc.setLocation(x, y); int slice = z+1; if (slice!=imp.getSlice()) { if (hyperstack) imp.setPosition(imp.getChannel(), slice, imp.getFrame()); else imp.setSlice(slice); sliceSet = true; } while (!initialized) { IJ.wait(10); } update(); }
/** Sets the position of this ROI based on the stack position of the specified image. */ public void setPosition(ImagePlus imp ) { if (imp==null) return; if (imp.isHyperStack()) { int channel = imp.getDisplayMode()==IJ.COMPOSITE?0:imp.getChannel(); setPosition(channel, imp.getSlice(), imp.getFrame()); } else if (imp.getStackSize()>1) setPosition(imp.getCurrentSlice()); else setPosition(0); }
/** Sets the position of this ROI based on the stack position of the specified image. */ public void setPosition(ImagePlus imp ) { if (imp==null) return; if (imp.isHyperStack()) { int channel = imp.getDisplayMode()==IJ.COMPOSITE?0:imp.getChannel(); setPosition(channel, imp.getSlice(), imp.getFrame()); } else if (imp.getStackSize()>1) setPosition(imp.getCurrentSlice()); else setPosition(0); }
void getPosition(ImagePlus imp) { Variable channel = getFirstVariable(); Variable slice = getNextVariable(); Variable frame = getLastVariable(); int c = imp.getChannel(); int z = imp.getSlice(); int t = imp.getFrame(); if (c*z*t>imp.getStackSize()) {c=1; z=imp.getCurrentSlice(); t=1;} channel.setValue(c); slice.setValue(z); frame.setValue(t); }
void getPosition(ImagePlus imp) { Variable channel = getFirstVariable(); Variable slice = getNextVariable(); Variable frame = getLastVariable(); int c = imp.getChannel(); int z = imp.getSlice(); int t = imp.getFrame(); if (c*z*t>imp.getStackSize()) {c=1; z=imp.getCurrentSlice(); t=1;} channel.setValue(c); slice.setValue(z); frame.setValue(t); }
public synchronized void adjustmentValueChanged(AdjustmentEvent e) { if (!running2 || imp.isHyperStack()) { if (e.getSource()==cSelector) { c = cSelector.getValue(); if (c==imp.getChannel()&&e.getAdjustmentType()==AdjustmentEvent.TRACK) return; } else if (e.getSource()==zSelector) { z = zSelector.getValue(); int slice = hyperStack?imp.getSlice():imp.getCurrentSlice(); if (z==slice&&e.getAdjustmentType()==AdjustmentEvent.TRACK) return; } else if (e.getSource()==tSelector) { t = tSelector.getValue(); if (t==imp.getFrame()&&e.getAdjustmentType()==AdjustmentEvent.TRACK) return; } updatePosition(); notify(); } if (!running) syncWindows(e.getSource()); }
private void setPosition(ImagePlus imp, Roi roi) { boolean setPos = defaultRoi.getPosition()!=0; int stackSize = imp.getStackSize(); if (setPos && stackSize>1) { if (imp.isHyperStack()||imp.isComposite()) { boolean compositeMode = imp.isComposite() && ((CompositeImage)imp).getMode()==IJ.COMPOSITE; int channel = !compositeMode||imp.getNChannels()==stackSize?imp.getChannel():0; if (imp.getNSlices()>1) roi.setPosition(channel, imp.getSlice(), 0); else if (imp.getNFrames()>1) roi.setPosition(channel, 0, imp.getFrame()); } else roi.setPosition(imp.getCurrentSlice()); } }
private void setPosition(ImagePlus imp, Roi roi) { boolean setPos = defaultRoi.getPosition()!=0; int stackSize = imp.getStackSize(); if (setPos && stackSize>1) { if (imp.isHyperStack()||imp.isComposite()) { boolean compositeMode = imp.isComposite() && ((CompositeImage)imp).getMode()==IJ.COMPOSITE; int channel = !compositeMode||imp.getNChannels()==stackSize?imp.getChannel():0; if (imp.getNSlices()>1) roi.setPosition(channel, imp.getSlice(), 0); else if (imp.getNFrames()>1) roi.setPosition(channel, 0, imp.getFrame()); } else roi.setPosition(imp.getCurrentSlice()); } }