/** Replaces the pixel data with contents of the specified 2D float array. */ public void setFloatArray(float[][] a) { for(int y=0; y<height; y++) { for(int x=0; x<width; x++) setf(x, y, a[x][y]); } }
/** Inserts the pixels contained in 'data' into a horizontal line starting at (x,y). */ public void putRow(int x, int y, float[] data, int length) { for (int i=0; i<length; i++) setf(x++, y, data[i]); }
public void setf( final int i, final float value ) { ip.setf( i, value ); } }
void putFloat2Image(ImageProcessor ip, float[][] imFloat, float imMin) { for (int x1=0; x1<imW; x1++) { for (int y1=0; y1<imH; y1++) { final int x2=x1, y2=y1; ip.setf(x1, y1, imFloat[x2][y2]+0.5f+imMin); } } }
/** Inserts the pixels contained in 'data' into a horizontal line starting at (x,y). */ public void putRow(int x, int y, float[] data, int length) { for (int i=0; i<length; i++) setf(x++, y, data[i]); }
void putFloat2Image(ImageProcessor ip, float[][] imFloat, float imMin) { for (int x1=0; x1<imW; x1++) { for (int y1=0; y1<imH; y1++) { final int x2=x1, y2=y1; ip.setf(x1, y1, imFloat[x2][y2]+0.5f+imMin); } } }
/** Replaces the pixel data with contents of the specified 2D float array. */ public void setFloatArray(float[][] a) { for(int y=0; y<height; y++) { for(int x=0; x<width; x++) setf(x, y, a[x][y]); } }
/** * Fill in the horizontal line define by y-coordinate and the two x * coordinate extremities (inclusive), with the specified integer value. * the value x1 must be lower than or equal the value x2. */ private final static void fillLine(ImageProcessor ip, int y, int x1, int x2, float value) { for (int x = x1; x <= x2; x++) ip.setf(x, y, value); }
public void setf(int index, float value) { record("setf", new Object[] {new Integer(index), new Float(value)}, new Class[] {int.class, float.class}); proc.setf(index, value); }
public void setf(int index, float value) { record("setf", new Object[] {new Integer(index), new Float(value)}, new Class[] {int.class, float.class}); proc.setf(index, value); }
private static final void fillRect(ImageProcessor image, int xmin, int xmax, int ymin, int ymax, double value) { for (int y = ymin; y <= ymax; y++) { for (int x = xmin; x <= xmax; x++) { image.setf(x, y, (float) value); } } } }
public void setf(int x, int y, float value) { record("setf", new Object[] {new Integer(x), new Integer(y), new Float(value)}, new Class[] {int.class, int.class, float.class}); proc.setf(x, y, value); }
public void setf(int x, int y, float value) { record("setf", new Object[] {new Integer(x), new Integer(y), new Float(value)}, new Class[] {int.class, int.class, float.class}); proc.setf(x, y, value); }
private static final void fillRect(ImageProcessor image, int xmin, int xmax, int ymin, int ymax, double value) { for (int y = ymin; y <= ymax; y++) { for (int x = xmin; x <= xmax; x++) { image.setf(x, y, (float) value); } } } }
/** * Update the pixel at position (i,j) with the value <code>value<value>. * First computes the min of value and the value of the mask. * Check if value is greater than the current value at position (i,j). * If new value is lower than current value, do nothing. */ private void geodesicDilationUpdateFloat(int i, int j, float value) { // update current value only if value is strictly greater value = Math.min(value, mask.getf(i, j)); if (value > result.getf(i, j)) { modif = true; result.setf(i, j, value); } }
/** * Update the pixel at position (i,j) with the value <code>value<value>. * First computes the min of value and the value of the mask. * Check if value is greater than the current value at position (i,j). * If new value is lower than current value, do nothing. */ private void geodesicErosionUpdateFloat(int i, int j, float value) { // update current value only if value is strictly lower value = Math.max(value, mask.getf(i, j)); if (value < result.getf(i, j)) { modif = true; result.setf(i, j, value); } } }
private void initializeResultFloat() { // Create result image the same size as marker image this.result = this.marker.createProcessor(this.sizeX, this.sizeY); float sign = this.reconstructionType.getSign(); for (int y = 0; y < this.sizeY; y++) { for (int x = 0; x < this.sizeX; x++) { float v1 = this.marker.getf(x, y) * sign; float v2 = this.mask.getf(x, y) * sign; this.result.setf(x, y, Math.min(v1, v2) * sign); } } }
private void initializeResultFloat() { // Create result image the same size as the mask image this.result = this.mask.createProcessor(this.sizeX, this.sizeY); float sign = this.reconstructionType.getSign(); for (int y = 0; y < this.sizeY; y++) { for (int x = 0; x < this.sizeX; x++) { float v1 = this.marker.getf(x, y) * sign; float v2 = this.mask.getf(x, y) * sign; this.result.setf(x, y, Math.min(v1, v2) * sign); } } }
private void resetPreview() { ImageProcessor image = this.imagePlus.getProcessor(); if (image instanceof FloatProcessor) { for (int i = 0; i < image.getPixelCount(); i++) image.setf(i, this.baseImage.getf(i)); } else { for (int i = 0; i < image.getPixelCount(); i++) image.set(i, this.baseImage.get(i)); } imagePlus.updateAndDraw(); }
private void resetPreview() { ImageProcessor image = this.imagePlus.getProcessor(); if (image instanceof FloatProcessor) { for (int i = 0; i < image.getPixelCount(); i++) image.setf(i, this.baseImage.getf(i)); } else { for (int i = 0; i < image.getPixelCount(); i++) image.set(i, this.baseImage.get(i)); } image.resetMinAndMax(); imagePlus.updateAndDraw(); }