Sets the image spacial derivatives.  These should be computed from an image at the appropriate scale
in scale-space.

@param derivX x-derivative of input image
@param derivY y-derivative of input image
5454
public void setImageGradient(Deriv derivX , Deriv derivY ) {
		this.imageDerivX.wrap(derivX);
		this.imageDerivY.wrap(derivY);
	}
923096
public void setValue(float angle, float x, float y, float z) {
        set(angle, x, y, z);
    }
63798
public static double deriv(double pred, double y, double eps)
    {
        final double x = pred - y;
        if(eps < Math.abs(x))
            return Math.signum(x);
        else
            return 0;
    }
999912
public void parameterize( int x , int y , float derivX , float derivY )
	{
		// put the point in a new coordinate system centered at the image's origin
		// this minimizes error, which is a function of distance from origin
		x -= originX;
		y -= originY;

		float v = (x*derivX + y*derivY)/(derivX*derivX + derivY*derivY);

		// finds the foot a line normal equation and put the point into image coordinates
		int x0 = (int)(v*derivX) + originX;
		int y0 = (int)(v*derivY) + originY;

		if( transform.isInBounds(x0,y0)) {
			int index = transform.startIndex+y0*transform.stride+x0;
			// keep track of candidate pixels so that a sparse search can be done
			// to detect lines
			if( transform.data[index]++ == 1 )
				candidates.add(x0,y0);
		}
	}
226437
public void setConer(int index, Vector3D v) {
        if (index <= 0) {
            this.x1 = v.getX();
            this.y1 = v.getY();
        } else if (index == 1) {
            this.x2 = v.getX();
            this.y2 = v.getY();
        } else if (index == 2) {
            this.x3 = v.getX();
            this.y3 = v.getY();
        } else if (3 <= index) {
            this.x4 = v.getX();
            this.y4 = v.getY();
        }
        calcG();
    }
1116098
public void setScaleFactors( int ...scaleFactors ) {
		for( int i = 1; i < scaleFactors.length; i++ ){
			if( scaleFactors[i] % scaleFactors[i-1] != 0 ) {
				throw new IllegalArgumentException("Layer "+i+" is not evenly divisible by its lower layer.");
			}
		}

		// set width/height to zero to force the image to be redeclared
		bottomWidth = bottomHeight = 0;
		this.scale = scaleFactors.clone();
		checkScales();
	}
1307094
private void set(Point3d[] x, Point3d[] y) {
		this.x = x;
		this.y = y;
		rmsdCalculated = false;
		transformationCalculated = false;
	}
1187851
private void declareDerivativeImages(ImageGradient<T, D> gradient, ImageHessian<D> hessian, Class<D> derivType) {
		if( gradient != null || hessian != null ) {
			derivX = GeneralizedImageOps.createSingleBand(derivType, 1, 1);
			derivY = GeneralizedImageOps.createSingleBand(derivType,1,1);
		}
		if( hessian != null ) {
			derivXX = GeneralizedImageOps.createSingleBand(derivType,1,1);
			derivYY = GeneralizedImageOps.createSingleBand(derivType,1,1);
			derivXY = GeneralizedImageOps.createSingleBand(derivType,1,1);
		}
	}
552497
public static void process(GrayF32 orig, GrayF32 derivX, GrayF32 derivY) {
		final float[] data = orig.data;
		final float[] imgX = derivX.data;
		final float[] imgY = derivY.data;

		final int width = orig.getWidth();
		final int height = orig.getHeight();
		final int stride = orig.stride;

		//CONCURRENT_BELOW BoofConcurrency.loopFor(1,height,y->{
		for (int y = 1; y < height; y++) {
			int indexX = derivX.startIndex + derivX.stride*y + 1;
			int indexY = derivY.startIndex + derivY.stride*y + 1;
			int indexSrc = orig.startIndex + orig.stride*y + 1;
			final int endX = indexSrc + width - 1;

			for (; indexSrc < endX; indexSrc++) {
				float val = data[indexSrc];
				imgX[indexX++] = (val - data[indexSrc - 1]);
				imgY[indexY++] = (val - data[indexSrc - stride]);
			}
		}
		//CONCURRENT_ABOVE });
	}
1343549
public void set(Vector3D v1, Vector3D v2, Vector3D v3, Vector3D v4) {
        this.x1 = (float)v1.getX();
        this.y1 = (float)v1.getY();
        this.x2 = (float)v2.getX();
        this.y2 = (float)v2.getY();
        this.x3 = (float)v3.getX();
        this.y3 = (float)v3.getY();
        this.x4 = (float)v4.getX();
        this.y4 = (float)v4.getY();
        calcG();
    }
238305
def derivative(self, z, x, y, fase):
        """"""
        return deriv_G(self, z, x, y, fase)
210943
public static <T extends ImageGray<T>>
	void naiveGradient(T ii, double tl_x, double tl_y, double samplePeriod ,
					   int regionSize, double kernelSize,
					   boolean useHaar, double[] derivX, double derivY[])
	{
		SparseScaleGradient<T,?> gg =  SurfDescribeOps.createGradient(useHaar,(Class<T>)ii.getClass());
		gg.setWidth(kernelSize);
		gg.setImage(ii);
		SparseGradientSafe g = new SparseGradientSafe(gg);

		// add 0.5 to c_x and c_y to have it round when converted to an integer pixel
		// this is faster than the straight forward method
		tl_x += 0.5;
		tl_y += 0.5;

		int i = 0;
		for( int y = 0; y < regionSize; y++ ) {
			for( int x = 0; x < regionSize; x++ , i++) {
				int xx = (int)(tl_x + x * samplePeriod);
				int yy = (int)(tl_y + y * samplePeriod);

				GradientValue deriv = g.compute(xx,yy);
				derivX[i] = deriv.getX();
				derivY[i] = deriv.getY();
//				System.out.printf("%2d %2d %2d %2d dx = %6.2f  dy = %6.2f\n",x,y,xx,yy,derivX[i],derivY[i]);
			}
		}
	}
186738
public static void process(GrayF32 orig, GrayF32 deriv, @Nullable ImageBorder_F32 border) {
		deriv.reshape(orig.width,orig.height);

		if( BoofConcurrency.USE_CONCURRENT ) {
			DerivativeLaplacian_Inner_MT.process(orig,deriv);
		} else {
			DerivativeLaplacian_Inner.process(orig,deriv);
		}

		if( border != null ) {
			border.setImage(orig);
			ConvolveJustBorder_General_SB.convolve(kernel_F32, border,deriv);
		}
	}
829513
public static void process( GrayI orig,
								GrayI derivX,
								GrayI derivY) {
		final int width = orig.getWidth();
		final int height = orig.getHeight();

		for (int y = 1; y < height - 1; y++) {

			for (int x = 1; x < width - 1; x++) {

				int dy = -(orig.get(x - 1, y - 1) + 2 * orig.get(x, y - 1) + orig.get(x + 1, y - 1));
				dy += (orig.get(x - 1, y + 1) + 2 * orig.get(x, y + 1) + orig.get(x + 1, y + 1));


				int dx = -(orig.get(x - 1, y - 1) + 2 * orig.get(x - 1, y) + orig.get(x - 1, y + 1));
				dx += (orig.get(x + 1, y - 1) + 2 * orig.get(x + 1, y) + orig.get(x + 1, y + 1));

				derivX.set(x, y, dx);
				derivY.set(x, y, dy);
			}
		}
	}
98271
private void setEAxis() {
		Rotation e = rotations.get(0);
		Rotation h = rotations.get(principalAxisIndex);
		e.setAxisAngle(new AxisAngle4d(h.getAxisAngle()));
		e.getAxisAngle().angle = 0.0;
		e.setFold(h.getFold());
	}
637458
def derivative(self, z, x, y, fase):
        """"""
        return deriv_H(self, z, x, y, fase)
547611
def deriv(self, x: str, ctype: ContentType) -> SchemaPattern:
        """"""
        return (self.pattern.deriv(x, ctype) if self.check_when() else
                NotAllowed())