public int[] getCrossLoc() { int[] loc = new int[3]; loc[0] = crossLoc.x; loc[1] = crossLoc.y; loc[2] = imp.getSlice()-1; return loc; }
public int[] getCrossLoc() { int[] loc = new int[3]; loc[0] = crossLoc.x; loc[1] = crossLoc.y; loc[2] = imp.getSlice()-1; return loc; }
public int getSlice(ImagePlus image) { return image.getSlice(); }
int getslice() { int val = 1; switch (imagetype) { case IMAGE5D: val = I5DResource.position(image,3) + 1; break; case HYPERSTACK: val = image.getSlice(); break; case IMAGESTACK: case SINGLEIMAGE: break; } return val; }
public void setFrame(ImagePlus image, int frame) { image.setPosition(image.getChannel(), image.getSlice(), frame); }
public void setChannel(ImagePlus image, int channel) { image.setPosition(channel, image.getSlice(), image.getFrame()); }
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 setchannel(final int c) { switch (imagetype) { case IMAGE5D: I5DResource.position(image,2,c-1); break; case HYPERSTACK: image.setPosition(c,image.getSlice(),image.getFrame()); break; case IMAGESTACK: case SINGLEIMAGE: break; } }
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 Spot makeSpot( final ImagePlus lImp, HyperStackDisplayer displayer, final ImageCanvas canvas, Point mouseLocation ) { if ( displayer == null ) { displayer = displayers.get( lImp ); } if ( mouseLocation == null ) { mouseLocation = MouseInfo.getPointerInfo().getLocation(); SwingUtilities.convertPointFromScreen( mouseLocation, canvas ); } final double[] calibration = TMUtils.getSpatialCalibration( lImp ); return new Spot( ( -0.5d + canvas.offScreenXD( mouseLocation.x ) ) * calibration[ 0 ], ( -0.5d + canvas.offScreenYD( mouseLocation.y ) ) * calibration[ 1 ], ( lImp.getSlice() - 1 ) * calibration[ 2 ], FALL_BACK_RADIUS, -1d ); }
private Spot makeSpot( final ImagePlus lImp, HyperStackDisplayer displayer, final ImageCanvas canvas, Point mouseLocation ) { if ( displayer == null ) { displayer = displayers.get( lImp ); } if ( mouseLocation == null ) { mouseLocation = MouseInfo.getPointerInfo().getLocation(); SwingUtilities.convertPointFromScreen( mouseLocation, canvas ); } final double[] calibration = TMUtils.getSpatialCalibration( lImp ); return new Spot( ( -0.5d + canvas.offScreenXD( mouseLocation.x ) ) * calibration[ 0 ], ( -0.5d + canvas.offScreenYD( mouseLocation.y ) ) * calibration[ 1 ], ( lImp.getSlice() - 1 ) * calibration[ 2 ], FALL_BACK_RADIUS, -1d ); }
public synchronized void itemStateChanged(ItemEvent e) { int index = choice.getSelectedIndex(); channels = channelConstants[index]; ImagePlus imp = WindowManager.getCurrentImage(); if (imp!=null && imp.isComposite()) { if (index+1<=imp.getNChannels()) imp.setPosition(index+1, imp.getSlice(), imp.getFrame()); else { choice.select(channelLabels.length-1); channels = 7; } } else doReset = true; notify(); }
/** 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(); }
/** 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); }