@Test public void testGetFullScaleRelativeModel() throws Exception { final double splitStackScale = 0.27445725006700616; final Bounds fullScaleBounds = new Bounds(44263.0, 38528.0, 2213.0, 47994.0, 42182.0, 2215.0); final AffineModel2D model = getModel(0.993066409663, 0.014806698843, -0.011630185859, 0.999452281992, 12145.447082412213, 10614.308863353232); final double[] expectedArray = new double[6]; model.toArray(expectedArray); expectedArray[4] = 744.5899587683962; expectedArray[5] = -488.4716178320232; final AffineModel2D relativeModel = HierarchicalStack.getFullScaleRelativeModel(model, splitStackScale, fullScaleBounds); final double[] array = new double[6]; relativeModel.toArray(array); for (int i = 0; i < expectedArray.length; i++) { Assert.assertEquals("invalid value for index " + i, expectedArray[i], array[i], 0.0001); } }
@JsonIgnore public static AffineModel2D getFullScaleRelativeModel(final AffineModel2D alignedLayerTransformModel, final double alignedStackScale, final Bounds fullScaleStackBounds) { final double invertedScale = 1.0 / alignedStackScale; final AffineModel2D invertedScaleModel = new AffineModel2D(); invertedScaleModel.set(invertedScale, 0.0, 0.0, invertedScale, 0.0, 0.0); final AffineModel2D scaleModel = new AffineModel2D(); scaleModel.set(alignedStackScale, 0.0, 0.0, alignedStackScale, 0.0, 0.0); final TranslationModel2D offsetModel = new TranslationModel2D(); offsetModel.set(-fullScaleStackBounds.getMinX(), -fullScaleStackBounds.getMinY()); final AffineModel2D fullScaleRelativeModel = new AffineModel2D(); fullScaleRelativeModel.concatenate(invertedScaleModel); fullScaleRelativeModel.concatenate(alignedLayerTransformModel); fullScaleRelativeModel.concatenate(scaleModel); fullScaleRelativeModel.concatenate(offsetModel); return fullScaleRelativeModel; }
HierarchicalStack implements Serializable { @JsonIgnore public static AffineModel2D getFullScaleRelativeModel(final AffineModel2D alignedLayerTransformModel, final double alignedStackScale, final Bounds fullScaleStackBounds) { final double invertedScale = 1.0 / alignedStackScale; final AffineModel2D invertedScaleModel = new AffineModel2D(); invertedScaleModel.set(invertedScale, 0.0, 0.0, invertedScale, 0.0, 0.0); final AffineModel2D scaleModel = new AffineModel2D(); scaleModel.set(alignedStackScale, 0.0, 0.0, alignedStackScale, 0.0, 0.0); final TranslationModel2D offsetModel = new TranslationModel2D(); offsetModel.set(-fullScaleStackBounds.getMinX(), -fullScaleStackBounds.getMinY()); final AffineModel2D fullScaleRelativeModel = new AffineModel2D(); fullScaleRelativeModel.concatenate(invertedScaleModel); fullScaleRelativeModel.concatenate(alignedLayerTransformModel); fullScaleRelativeModel.concatenate(scaleModel); fullScaleRelativeModel.concatenate(offsetModel); return fullScaleRelativeModel; } }
HierarchicalStack implements Serializable { @JsonIgnore public static AffineModel2D getFullScaleRelativeModel(final AffineModel2D alignedLayerTransformModel, final double alignedStackScale, final Bounds fullScaleStackBounds) { final double invertedScale = 1.0 / alignedStackScale; final AffineModel2D invertedScaleModel = new AffineModel2D(); invertedScaleModel.set(invertedScale, 0.0, 0.0, invertedScale, 0.0, 0.0); final AffineModel2D scaleModel = new AffineModel2D(); scaleModel.set(alignedStackScale, 0.0, 0.0, alignedStackScale, 0.0, 0.0); final TranslationModel2D offsetModel = new TranslationModel2D(); offsetModel.set(-fullScaleStackBounds.getMinX(), -fullScaleStackBounds.getMinY()); final AffineModel2D fullScaleRelativeModel = new AffineModel2D(); fullScaleRelativeModel.concatenate(invertedScaleModel); fullScaleRelativeModel.concatenate(alignedLayerTransformModel); fullScaleRelativeModel.concatenate(scaleModel); fullScaleRelativeModel.concatenate(offsetModel); return fullScaleRelativeModel; } @SuppressWarnings("unused") protected  HierarchicalStack();  HierarchicalStack(final StackId roughTilesStackId,
                             final int tier,
                             final int tierRow,
                             final int tierColumn,
                             final int totalTierRowCount,
                             final int totalTierColumnCount,
                             final double scale,
                             final Bounds fullScaleBounds);  HierarchicalStack(final StackId roughTilesStackId,
                             final StackId parentTierStackId,
                             final StackId alignedStackId,
                             final StackId warpTilesStackId,
                             final Integer tier,
                             final Integer tierRow,
                             final Integer tierColumn,
                             final Integer totalTierRowCount,
                             final Integer totalTierColumnCount,
                             final Double scale,
                             final Bounds fullScaleBounds,
                             final MatchCollectionId matchCollectionId); }
HierarchicalStack implements Serializable { @JsonIgnore public static AffineModel2D getFullScaleRelativeModel(final AffineModel2D alignedLayerTransformModel, final double alignedStackScale, final Bounds fullScaleStackBounds) { final double invertedScale = 1.0 / alignedStackScale; final AffineModel2D invertedScaleModel = new AffineModel2D(); invertedScaleModel.set(invertedScale, 0.0, 0.0, invertedScale, 0.0, 0.0); final AffineModel2D scaleModel = new AffineModel2D(); scaleModel.set(alignedStackScale, 0.0, 0.0, alignedStackScale, 0.0, 0.0); final TranslationModel2D offsetModel = new TranslationModel2D(); offsetModel.set(-fullScaleStackBounds.getMinX(), -fullScaleStackBounds.getMinY()); final AffineModel2D fullScaleRelativeModel = new AffineModel2D(); fullScaleRelativeModel.concatenate(invertedScaleModel); fullScaleRelativeModel.concatenate(alignedLayerTransformModel); fullScaleRelativeModel.concatenate(scaleModel); fullScaleRelativeModel.concatenate(offsetModel); return fullScaleRelativeModel; } @SuppressWarnings("unused") protected  HierarchicalStack();  HierarchicalStack(final StackId roughTilesStackId,
                             final int tier,
                             final int tierRow,
                             final int tierColumn,
                             final int totalTierRowCount,
                             final int totalTierColumnCount,
                             final double scale,
                             final Bounds fullScaleBounds);  HierarchicalStack(final StackId roughTilesStackId,
                             final StackId parentTierStackId,
                             final StackId alignedStackId,
                             final StackId warpTilesStackId,
                             final Integer tier,
                             final Integer tierRow,
                             final Integer tierColumn,
                             final Integer totalTierRowCount,
                             final Integer totalTierColumnCount,
                             final Double scale,
                             final Bounds fullScaleBounds,
                             final MatchCollectionId matchCollectionId); StackId getRoughTilesStackId(); StackId getParentTierStackId(); StackId getAlignedStackId(); StackId getWarpTilesStackId(); Integer getTier(); int getTierRow(); int getTierColumn(); int getTotalTierRowCount(); double getTotalTierFullScaleHeight(); int getTotalTierColumnCount(); double getTotalTierFullScaleWidth(); double getScale(); Bounds getFullScaleBounds(); MatchCollectionId getMatchCollectionId(); void updateDerivedData(final HierarchicalStack storedData); @JsonIgnore boolean requiresMatchDerivation(); @JsonIgnore boolean hasMatchPairs(); Long getSavedMatchPairCount(); void setSavedMatchPairCount(final Long savedMatchPairCount); boolean hasSplitGroupId(final String groupId); void setSplitGroupIds(final Collection<String> groupIds); @JsonIgnore boolean requiresAlignment(); Double getAlignmentQuality(); void setAlignmentQuality(final Double alignmentQuality); @Override String toString(); @JsonIgnore StackId getSplitStackId(); @JsonIgnore String getTileIdForZ(final double z); @JsonIgnore void setTileSpecBounds(final TileSpec tileSpec); @JsonIgnore String getBoxPathForZ(final double z); @JsonIgnore List<OrderedCanvasIdPair> getNeighborPairs(final List<Double> zValues,
                                                      final int zNeighborDistance); String toJson(); @JsonIgnore static AffineModel2D getFullScaleRelativeModel(final AffineModel2D alignedLayerTransformModel,
                                                          final double alignedStackScale,
                                                          final Bounds fullScaleStackBounds); static HierarchicalStack fromJson(final String json); static String deriveProjectForTier(final StackId roughTilesStackId,
                                              final int tier); static StackId deriveWarpStackIdForTier(final StackId roughTilesStackId,
                                                   final int tier); static StackId deriveParentTierStackId(final StackId roughTilesStackId,
                                                  final int tier); static int deriveSplitStackIndex(final Integer tierRow,
                                            final Integer tierColumn,
                                            final Integer totalTierRowCount); static void setTileSpecBounds(final TileSpec tileSpec,
                                         final double scale,
                                         final Bounds fullScaleBounds); static int floor(final double value); static int ceil(final double value); }
HierarchicalStack implements Serializable { @JsonIgnore public static AffineModel2D getFullScaleRelativeModel(final AffineModel2D alignedLayerTransformModel, final double alignedStackScale, final Bounds fullScaleStackBounds) { final double invertedScale = 1.0 / alignedStackScale; final AffineModel2D invertedScaleModel = new AffineModel2D(); invertedScaleModel.set(invertedScale, 0.0, 0.0, invertedScale, 0.0, 0.0); final AffineModel2D scaleModel = new AffineModel2D(); scaleModel.set(alignedStackScale, 0.0, 0.0, alignedStackScale, 0.0, 0.0); final TranslationModel2D offsetModel = new TranslationModel2D(); offsetModel.set(-fullScaleStackBounds.getMinX(), -fullScaleStackBounds.getMinY()); final AffineModel2D fullScaleRelativeModel = new AffineModel2D(); fullScaleRelativeModel.concatenate(invertedScaleModel); fullScaleRelativeModel.concatenate(alignedLayerTransformModel); fullScaleRelativeModel.concatenate(scaleModel); fullScaleRelativeModel.concatenate(offsetModel); return fullScaleRelativeModel; } @SuppressWarnings("unused") protected  HierarchicalStack();  HierarchicalStack(final StackId roughTilesStackId,
                             final int tier,
                             final int tierRow,
                             final int tierColumn,
                             final int totalTierRowCount,
                             final int totalTierColumnCount,
                             final double scale,
                             final Bounds fullScaleBounds);  HierarchicalStack(final StackId roughTilesStackId,
                             final StackId parentTierStackId,
                             final StackId alignedStackId,
                             final StackId warpTilesStackId,
                             final Integer tier,
                             final Integer tierRow,
                             final Integer tierColumn,
                             final Integer totalTierRowCount,
                             final Integer totalTierColumnCount,
                             final Double scale,
                             final Bounds fullScaleBounds,
                             final MatchCollectionId matchCollectionId); StackId getRoughTilesStackId(); StackId getParentTierStackId(); StackId getAlignedStackId(); StackId getWarpTilesStackId(); Integer getTier(); int getTierRow(); int getTierColumn(); int getTotalTierRowCount(); double getTotalTierFullScaleHeight(); int getTotalTierColumnCount(); double getTotalTierFullScaleWidth(); double getScale(); Bounds getFullScaleBounds(); MatchCollectionId getMatchCollectionId(); void updateDerivedData(final HierarchicalStack storedData); @JsonIgnore boolean requiresMatchDerivation(); @JsonIgnore boolean hasMatchPairs(); Long getSavedMatchPairCount(); void setSavedMatchPairCount(final Long savedMatchPairCount); boolean hasSplitGroupId(final String groupId); void setSplitGroupIds(final Collection<String> groupIds); @JsonIgnore boolean requiresAlignment(); Double getAlignmentQuality(); void setAlignmentQuality(final Double alignmentQuality); @Override String toString(); @JsonIgnore StackId getSplitStackId(); @JsonIgnore String getTileIdForZ(final double z); @JsonIgnore void setTileSpecBounds(final TileSpec tileSpec); @JsonIgnore String getBoxPathForZ(final double z); @JsonIgnore List<OrderedCanvasIdPair> getNeighborPairs(final List<Double> zValues,
                                                      final int zNeighborDistance); String toJson(); @JsonIgnore static AffineModel2D getFullScaleRelativeModel(final AffineModel2D alignedLayerTransformModel,
                                                          final double alignedStackScale,
                                                          final Bounds fullScaleStackBounds); static HierarchicalStack fromJson(final String json); static String deriveProjectForTier(final StackId roughTilesStackId,
                                              final int tier); static StackId deriveWarpStackIdForTier(final StackId roughTilesStackId,
                                                   final int tier); static StackId deriveParentTierStackId(final StackId roughTilesStackId,
                                                  final int tier); static int deriveSplitStackIndex(final Integer tierRow,
                                            final Integer tierColumn,
                                            final Integer totalTierRowCount); static void setTileSpecBounds(final TileSpec tileSpec,
                                         final double scale,
                                         final Bounds fullScaleBounds); static int floor(final double value); static int ceil(final double value); static final JsonUtils.Helper<HierarchicalStack> JSON_HELPER; }