public static void scale(final Set<UPoint> set, final Calibration cal) { for (final Iterator<UPoint> it = set.iterator(); it.hasNext();) { final UPoint point = it.next(); point.x = cal.getX(point.x); point.y = cal.getY(point.y); point.z = cal.getZ(point.z); } }
public UPoint(final int x, final int y, final int z, final Calibration cal) { this.x = cal.getX(x); this.y = cal.getY(y); this.z = cal.getZ(z); }
public UPoint(final int x, final int y, final Calibration cal) { this.x = cal.getX(x); this.y = cal.getY(y); this.z = cal.getZ(0); }
public void mouseMoved(MouseEvent e) { int x = cc.offScreenX(e.getX()); int y = cc.offScreenY(e.getY()); double posX, posY, posZ; int voxelValue; int materialID; String materialName; if(x<imp.getWidth() && y<imp.getHeight()) { Calibration cal = imp.getCalibration(); posX = cal.getX(x); posX = Double.valueOf(IJ.d2s(posX)).doubleValue(); posY = cal.getY(y); posY = Double.valueOf(IJ.d2s(posY)).doubleValue(); int z = imp.getCurrentSlice()-1; posZ = cal.getZ(z); posZ = Double.valueOf(IJ.d2s(posZ)).doubleValue(); voxelValue = imp.getProcessor().get(x, y); materialID = cc.getLabels().getStack().getProcessor(z+1).get(x,y); materialName = sidebar.getMaterials() .params.getMaterialName(materialID); IJ.showStatus("x=" + posX + ", y=" + posY + ", z=" + posZ + ", value=" + voxelValue + ", material=" + materialName); } }
final double distance2 = Math.abs( p2.getL()[ 2 ] - currentSlice2 ) * ( imp2.getCalibration().getZ( 1 ) / imp2.getCalibration().getX( 1 ) );
final double distance1 = Math.abs( p1.getL()[ 2 ] - currentSlice1 ) * ( imp1.getCalibration().getZ( 1 ) / imp1.getCalibration().getX( 1 ) );
/** Converts the current cursor location to a string. */ public String getLocationAsString(int x, int y) { Calibration cal = getCalibration(); if (getProperty("FHT")!=null) return getFFTLocation(x, height-y, cal); String xx="", yy=""; if (cal.scaled()) { xx = " ("+x+")"; yy = " ("+y+")"; } String s = " x="+d2s(cal.getX(x)) + xx + ", y=" + d2s(cal.getY(y,height)) + yy; if (getStackSize()>1) { Roi roi2 = getRoi(); if (roi2==null || roi2.getState()==Roi.NORMAL) { int z = isDisplayedHyperStack()?getSlice()-1:getCurrentSlice()-1; String zz = cal.scaled()&&cal.getZ(z)!=z?" ("+z+")":""; s += ", z="+d2s(cal.getZ(z))+zz; } } return s; }
/** Converts the current cursor location to a string. */ public String getLocationAsString(int x, int y) { Calibration cal = getCalibration(); if (getProperty("FHT")!=null) return getFFTLocation(x, height-y, cal); String xx="", yy=""; if (cal.scaled()) { xx = " ("+x+")"; yy = " ("+y+")"; } String s = " x="+d2s(cal.getX(x)) + xx + ", y=" + d2s(cal.getY(y,height)) + yy; if (getStackSize()>1) { Roi roi2 = getRoi(); if (roi2==null || roi2.getState()==Roi.NORMAL) { int z = isDisplayedHyperStack()?getSlice()-1:getCurrentSlice()-1; String zz = cal.scaled()&&cal.getZ(z)!=z?" ("+z+")":""; s += ", z="+d2s(cal.getZ(z))+zz; } } return s; }
final double zR = imp.getCalibration().getZ( z - 1 );
yv.setValue(plot == null ? cal.getY(y,height) : plot.descaleY((int)(y+0.5))); if (threeArgs) zv.setValue(cal.getZ(zv.getValue())); } else //oneArg; convert horizontal length (not the x coordinate, no offset) xv.setValue(x * cal.pixelWidth) ;
yv.setValue(plot == null ? cal.getY(y,height) : plot.descaleY((int)(y+0.5))); if (threeArgs) zv.setValue(cal.getZ(zv.getValue())); } else //oneArg; convert horizontal length (not the x coordinate, no offset) xv.setValue(x * cal.pixelWidth) ;