Code Monkey home page Code Monkey logo

Comments (5)

trautmane avatar trautmane commented on July 18, 2024

Sadly, it took over 2 years for me to realize that I misunderstood this issue. My original fix was a hack that just hid the real problem which is with the tile spec bounding box derivation code. Ironically, the "sloppy" derivation introduced by Saalfeld in ec46251 corrects this specific case but sloppy=false derivation still exposes the original problem. I have rolled back my original hack and have reopened this issue.

from render.

miketaormina avatar miketaormina commented on July 18, 2024

I'm not sure if this is related or not, but I have 2048x2048 image tiles that come back as 2049x2049 when I request the tile image data (I guess the opposite behavior as Forrest notes above).
In this case, the Render Parameters call shows the correct dimensions, but returned data does not match:

http://10.128.50.158:8080/render-ws/v1/owner/optical_coordinates/project/495710_08/stack/Moxd1_5_01/tile/495710.08.1.0.5.400/render-parameters

{
  "meshCellSize": 64,
  "minMeshCellSize": 0,
  "x": -810,
  "y": 0,
  "width": 2049,
  "height": 2049,
  "scale": 1,
  "areaOffset": false,
  "convertToGray": false,
  "quality": 0.85,
  "numberOfThreads": 1,
  "skipInterpolation": false,
  "binaryMask": false,
  "excludeMask": false,
  "doFilter": false,
  "addWarpFieldDebugOverlay": false,
  "fillWithNoise": false,
  "tileSpecs": [
    {
      "tileId": "495710.08.1.0.5.400",
      "layout": {
        "sectionId": "0400",
        "imageRow": 0,
        "imageCol": 0,
        "stageX": 10593.02,
        "stageY": 47465.79
      },
      "z": 400,
      "minX": -810,
      "minY": 0,
      "maxX": 1238,
      "maxY": 2048,
      "width": 2048,
      "height": 2048,
      "mipmapLevels": {
        "0": {
          "imageUrl": "/integration_test/camera_coord_tiles/WP.000021.R1/495710.08.R1/Camera-1-640/495710_08_1_0_5_400.tif"
        }
      },
      "transforms": {
        "type": "list",
        "specList": [
          {
            "type": "leaf",
            "className": "mpicbg.trakem2.transform.AffineModel2D",
            "dataString": "1.0000000000 0.0000000000 0.0000000000 1.0000000000 -810.0000000000 -0.0000000000"
          }
        ]
      },
      "meshCellSize": 64
    }
  ],
  "minBoundsMeshCellSize": 64
}

Edit: now that I see it here, I notice that the width and height are indeed inconsistent with the tileSpec data. I also should note that this behavior is not confined to PNG images.

from render.

trautmane avatar trautmane commented on July 18, 2024

Hi Mike - yes you found the same thing I did last November. On the geometric_descriptor branch (where we've been doing most of our work recently), I removed my original hack in 6aee2f7 and then re-opened this issue with the hope that at some point I could investigate further and properly fix the sloppy=false bounding box derivation code. Is this bug causing trouble for you or is it just something you noticed? If the bug is a problem, I'll try to solve it for you sooner.
--Eric

from render.

miketaormina avatar miketaormina commented on July 18, 2024

I noticed it quite a while ago, but haven't generally used tile images until recently (previously mainly used bb_image). It isn't causing me trouble, as I've just been either ignoring it or truncating the image. I finally went to put it here just so that someone would know about it, and then found this issue.

Also, I'm not sure if this is also related:
I can't seem to recall the specifics, but it seemed like there was also an inconsistency with how z is treated in the stack bounds. If I recall, maxZ - minZ does not equal sectionCount, but maxX - minX does equal the total extent of the stack in x. I've never really figured out if it's weird or not, since the 0 indexing does make sense and there's no equivalent to sectionCount for x.

Again, neither of these is hangin me up, so no worries. I'm just really glad to have the Render package as a resource and will try to help as my skill set allows.

from render.

trautmane avatar trautmane commented on July 18, 2024

Thanks Mike - the sectionCount in the stack metadata is the number of distinct sectionId values across all tiles in the stack. For "simple" stacks where there is a one-to-one correspondence between sectionId and z and you have a contiguous set of layers, the sectionCount happens to be equal to maxZ - minZ + 1 (but that's not how it is calculated). We have data sets where the same layers have been acquired at different times - typically re-imaging of problem areas. The re-acquired data is assigned a different sectionId from the original data, but ultimately gets assigned the same z. In these cases, the sectionCount is much higher than the z range. We also have data sets with non-contiguous layers / z values where the sectionCount is less than the z range.

from render.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.