public ZoomOp getRectifyAspectRatioZoomOp() { // Rectify non square pixel image in the first operation if (MathUtil.isDifferent(pixelSizeX, pixelSizeY)) { ZoomOp node = new ZoomOp(); node.setName("rectifyAspectRatio"); //$NON-NLS-1$ node.setParam(ZoomOp.P_RATIO_X, getRescaleX()); node.setParam(ZoomOp.P_RATIO_Y, getRescaleY()); return node; } return null; }
@Override public ZoomOp copy() { return new ZoomOp(this); }
private static void changePixelSize(DicomImageElement img, Map<String, Object> actionsInView, double[] prPixSize) { img.setPixelSize(prPixSize[1], prPixSize[0]); actionsInView.put(PRManager.TAG_CHANGE_PIX_CONFIG, true); ZoomOp node = img.getRectifyAspectRatioZoomOp(); if (node != null) { SimpleOpManager process = new SimpleOpManager(); process.addImageOperationAction(node); OpManager preprocessing = (OpManager) actionsInView.get(ActionW.PREPROCESSING.cmd()); if (preprocessing != null) { for (ImageOpNode op : preprocessing.getOperations()) { if (!node.getName().equals(op.getName())) { process.addImageOperationAction(op); } } } actionsInView.put(ActionW.PREPROCESSING.cmd(), process); } }
public ZoomOp() { setName(OP_NAME); }
public AcquireImageInfo(ImageElement image) { this.image = Objects.requireNonNull(image); readTags(image); this.setStatus(AcquireImageStatus.TO_PUBLISH); this.attributes = new Attributes(); this.preProcessOpManager = new SimpleOpManager(); this.postProcessOpManager = new SimpleOpManager(); this.postProcessOpManager.addImageOperationAction(new CropOp()); this.postProcessOpManager.addImageOperationAction(new BrightnessOp()); this.postProcessOpManager.addImageOperationAction(new AutoLevelsOp()); this.postProcessOpManager.addImageOperationAction(new RotationOp()); this.postProcessOpManager.addImageOperationAction(new FlipOp()); this.postProcessOpManager.addImageOperationAction(new ZoomOp()); defaultValues = new AcquireImageValues(); currentValues = defaultValues.copy(); nextValues = defaultValues.copy(); steps = new ArrayList<>(); steps.add(currentValues); }
@Override public void setImage(E image, OpManager preprocessing) { boolean init = (image != null && !image.equals(this.sourceImage)) || (image == null && sourceImage != null); this.sourceImage = image; this.preprocessing = preprocessing; // Rectify non square pixel image in the first operation if (sourceImage != null) { ZoomOp node = sourceImage.getRectifyAspectRatioZoomOp(); if (node != null) { SimpleOpManager process = new SimpleOpManager(); process.addImageOperationAction(node); if (preprocessing != null) { for (ImageOpNode op : preprocessing.getOperations()) { if (!node.getName().equals(op.getName())) { process.addImageOperationAction(op); } } } this.preprocessing = process; } } if (preprocessing != null || init) { disOpManager.setFirstNode(getSourceRenderedImage()); updateDisplayOperations(); } }