{
  "id": 556057,
  "title": "Should the maximum value of x,y coordinate to be 629 (instead of 630)?",
  "url": "/competitions/czii-cryo-et-object-identification/discussion/556057",
  "author_name": "",
  "post_date": "2025-01-10T23:32:00.378086700Z",
  "votes": 1,
  "comment_count": 3,
  "views": 0,
  "content": "<p>I see the shape of tomogram is 630x630x184.  so I guess the x, y coordinates are mapped to [0, 629]? instead of [1, 630]?<br>\nIn other words, we don't need to subtract the coordinates provided in json by 1 to map to tomogram?<br>\nThanks!!</p>",
  "messages": [
    {
      "id": "3093451",
      "postDate": "01/10/2025 23:32:00",
      "content": "<p>I see the shape of tomogram is 630x630x184.  so I guess the x, y coordinates are mapped to [0, 629]? instead of [1, 630]?<br>\nIn other words, we don't need to subtract the coordinates provided in json by 1 to map to tomogram?<br>\nThanks!!</p>",
      "rawMarkdown": "I see the shape of tomogram is 630x630x184.  so I guess the x, y coordinates are mapped to [0, 629]? instead of [1, 630]?\nIn other words, we don't need to subtract the coordinates provided in json by 1 to map to tomogram?\nThanks!!",
      "votes": null
    },
    {
      "id": "3093454",
      "postDate": "01/10/2025 23:53:59",
      "content": "<p>There are actually two coordinate systems here.  First, you have the x,y,z coordinates in units of Angstroms, I believe.  The origin of the x,y,z coordinate system is the center of the 0,0,0 pixel, which is the pixel nearest to you in the upper left corner (You can actually, define it to be in several locations, because of symmetry, but that's where I like to put it.)</p>\n<p>The second coordinate system is what I usually call the i,j,k coordinate system in pixels.  To convert from pixels (i,j,k) to angstroms (x,y,z) use the following equation:</p>\n<p>x = 10.012*i</p>\n<p>with analogous equations for y and z.  To go in the opposite direction its:</p>\n<p>i = int(np.rint(x/10.012))</p>\n<p>again, with analogous equations for j and k.</p>\n<p>To specifically address your question, the max pixel coordinate is 629 (i and j) which corresponds to 6297.55 (x and y).  Note that for your submission, you report results in the x,y,z coordinate system.</p>\n<p>For more discussion look here:<br>\n<a href=\"https://www.kaggle.com/competitions/czii-cryo-et-object-identification/discussion/553126\" target=\"_blank\">https://www.kaggle.com/competitions/czii-cryo-et-object-identification/discussion/553126</a><br>\n<a href=\"https://www.kaggle.com/competitions/czii-cryo-et-object-identification/discussion/544895#3040071\" target=\"_blank\">https://www.kaggle.com/competitions/czii-cryo-et-object-identification/discussion/544895#3040071</a><br>\n<a href=\"https://www.kaggle.com/competitions/czii-cryo-et-object-identification/discussion/545381#3044901\" target=\"_blank\">https://www.kaggle.com/competitions/czii-cryo-et-object-identification/discussion/545381#3044901</a></p>\n<p>Hope this helps!</p>",
      "rawMarkdown": "There are actually two coordinate systems here.  First, you have the x,y,z coordinates in units of Angstroms, I believe.  The origin of the x,y,z coordinate system is the center of the 0,0,0 pixel, which is the pixel nearest to you in the upper left corner (You can actually, define it to be in several locations, because of symmetry, but that's where I like to put it.)\n\nThe second coordinate system is what I usually call the i,j,k coordinate system in pixels.  To convert from pixels (i,j,k) to angstroms (x,y,z) use the following equation:\n\nx = 10.012*i\n\nwith analogous equations for y and z.  To go in the opposite direction its:\n\ni = int(np.rint(x/10.012))\n\nagain, with analogous equations for j and k.\n\nTo specifically address your question, the max pixel coordinate is 629 (i and j) which corresponds to 6297.55 (x and y).  Note that for your submission, you report results in the x,y,z coordinate system.\n\nFor more discussion look here:\n[https://www.kaggle.com/competitions/czii-cryo-et-object-identification/discussion/553126](https://www.kaggle.com/competitions/czii-cryo-et-object-identification/discussion/553126)\n[https://www.kaggle.com/competitions/czii-cryo-et-object-identification/discussion/544895#3040071](https://www.kaggle.com/competitions/czii-cryo-et-object-identification/discussion/544895#3040071)\n[https://www.kaggle.com/competitions/czii-cryo-et-object-identification/discussion/545381#3044901](https://www.kaggle.com/competitions/czii-cryo-et-object-identification/discussion/545381#3044901)\n\nHope this helps!",
      "votes": null
    },
    {
      "id": "3093495",
      "postDate": "01/11/2025 02:22:42",
      "content": "<p>BTW, I remember there were some discussion indicate that the scale factors are stored in zarr attributes. So there are actually different scale for x, y, z.<br>\nBut I guess the scale are all roughly around 10</p>",
      "rawMarkdown": "BTW, I remember there were some discussion indicate that the scale factors are stored in zarr attributes. So there are actually different scale for x, y, z.\nBut I guess the scale are all roughly around 10",
      "votes": null
    },
    {
      "id": "3093519",
      "postDate": "01/11/2025 03:57:39",
      "content": "<p>They're all pretty close.  If you use 10, you'll be off by a little more than half a pixel in the far corner, although that probably doesn't matter all that much.</p>\n<pre><code>{\n  : [\n    {\n      : [\n        {\n          : ,\n          : ,\n          : \n        },\n        {\n          : ,\n          : ,\n          : \n        },\n        {\n          : ,\n          : ,\n          : \n        }\n      ],\n      : [\n        {\n          : [\n            {\n              : [\n                ,\n                ,\n                \n              ],\n              : \n            }\n          ],\n          : \n        },\n        {\n          : [\n            {\n              : [\n                ,\n                ,\n                \n              ],\n              : \n            }\n          ],\n          : \n        },\n        {\n          : [\n            {\n              : [\n                ,\n                ,\n                \n              ],\n              : \n            }\n          ],\n          : \n        }\n      ],\n      : {},\n      : ,\n      : \n    }\n  ]\n}\n</code></pre>",
      "rawMarkdown": "They're all pretty close.  If you use 10, you'll be off by a little more than half a pixel in the far corner, although that probably doesn't matter all that much.\n\n```\n{\n  \"multiscales\": [\n    {\n      \"axes\": [\n        {\n          \"name\": \"z\",\n          \"type\": \"space\",\n          \"unit\": \"angstrom\"\n        },\n        {\n          \"name\": \"y\",\n          \"type\": \"space\",\n          \"unit\": \"angstrom\"\n        },\n        {\n          \"name\": \"x\",\n          \"type\": \"space\",\n          \"unit\": \"angstrom\"\n        }\n      ],\n      \"datasets\": [\n        {\n          \"coordinateTransformations\": [\n            {\n              \"scale\": [\n                10.012444196428572,\n                10.012444196428572,\n                10.012444537618887\n              ],\n              \"type\": \"scale\"\n            }\n          ],\n          \"path\": \"0\"\n        },\n        {\n          \"coordinateTransformations\": [\n            {\n              \"scale\": [\n                20.024888392857143,\n                20.024888392857143,\n                20.024889075237773\n              ],\n              \"type\": \"scale\"\n            }\n          ],\n          \"path\": \"1\"\n        },\n        {\n          \"coordinateTransformations\": [\n            {\n              \"scale\": [\n                40.049776785714286,\n                40.049776785714286,\n                40.04977815047555\n              ],\n              \"type\": \"scale\"\n            }\n          ],\n          \"path\": \"2\"\n        }\n      ],\n      \"metadata\": {},\n      \"name\": \"/\",\n      \"version\": \"0.4\"\n    }\n  ]\n}\n\n```",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 3093454,
      "author_name": "davidlist",
      "author_url": "",
      "post_date": "01/10/2025 23:53:59",
      "content": "<p>There are actually two coordinate systems here.  First, you have the x,y,z coordinates in units of Angstroms, I believe.  The origin of the x,y,z coordinate system is the center of the 0,0,0 pixel, which is the pixel nearest to you in the upper left corner (You can actually, define it to be in several locations, because of symmetry, but that's where I like to put it.)</p>\n<p>The second coordinate system is what I usually call the i,j,k coordinate system in pixels.  To convert from pixels (i,j,k) to angstroms (x,y,z) use the following equation:</p>\n<p>x = 10.012*i</p>\n<p>with analogous equations for y and z.  To go in the opposite direction its:</p>\n<p>i = int(np.rint(x/10.012))</p>\n<p>again, with analogous equations for j and k.</p>\n<p>To specifically address your question, the max pixel coordinate is 629 (i and j) which corresponds to 6297.55 (x and y).  Note that for your submission, you report results in the x,y,z coordinate system.</p>\n<p>For more discussion look here:<br>\n<a href=\"https://www.kaggle.com/competitions/czii-cryo-et-object-identification/discussion/553126\" target=\"_blank\">https://www.kaggle.com/competitions/czii-cryo-et-object-identification/discussion/553126</a><br>\n<a href=\"https://www.kaggle.com/competitions/czii-cryo-et-object-identification/discussion/544895#3040071\" target=\"_blank\">https://www.kaggle.com/competitions/czii-cryo-et-object-identification/discussion/544895#3040071</a><br>\n<a href=\"https://www.kaggle.com/competitions/czii-cryo-et-object-identification/discussion/545381#3044901\" target=\"_blank\">https://www.kaggle.com/competitions/czii-cryo-et-object-identification/discussion/545381#3044901</a></p>\n<p>Hope this helps!</p>",
      "votes": null,
      "replies": [
        {
          "id": 3093495,
          "author_name": "huiliu0",
          "author_url": "",
          "post_date": "01/11/2025 02:22:42",
          "content": "<p>BTW, I remember there were some discussion indicate that the scale factors are stored in zarr attributes. So there are actually different scale for x, y, z.<br>\nBut I guess the scale are all roughly around 10</p>",
          "votes": null,
          "replies": [
            {
              "id": 3093519,
              "author_name": "davidlist",
              "author_url": "",
              "post_date": "01/11/2025 03:57:39",
              "content": "<p>They're all pretty close.  If you use 10, you'll be off by a little more than half a pixel in the far corner, although that probably doesn't matter all that much.</p>\n<pre><code>{\n  : [\n    {\n      : [\n        {\n          : ,\n          : ,\n          : \n        },\n        {\n          : ,\n          : ,\n          : \n        },\n        {\n          : ,\n          : ,\n          : \n        }\n      ],\n      : [\n        {\n          : [\n            {\n              : [\n                ,\n                ,\n                \n              ],\n              : \n            }\n          ],\n          : \n        },\n        {\n          : [\n            {\n              : [\n                ,\n                ,\n                \n              ],\n              : \n            }\n          ],\n          : \n        },\n        {\n          : [\n            {\n              : [\n                ,\n                ,\n                \n              ],\n              : \n            }\n          ],\n          : \n        }\n      ],\n      : {},\n      : ,\n      : \n    }\n  ]\n}\n</code></pre>",
              "votes": null,
              "replies": []
            }
          ]
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "3093451": "I see the shape of tomogram is 630x630x184.  so I guess the x, y coordinates are mapped to [0, 629]? instead of [1, 630]?\nIn other words, we don't need to subtract the coordinates provided in json by 1 to map to tomogram?\nThanks!!",
    "3093454": "There are actually two coordinate systems here.  First, you have the x,y,z coordinates in units of Angstroms, I believe.  The origin of the x,y,z coordinate system is the center of the 0,0,0 pixel, which is the pixel nearest to you in the upper left corner (You can actually, define it to be in several locations, because of symmetry, but that's where I like to put it.)\n\nThe second coordinate system is what I usually call the i,j,k coordinate system in pixels.  To convert from pixels (i,j,k) to angstroms (x,y,z) use the following equation:\n\nx = 10.012*i\n\nwith analogous equations for y and z.  To go in the opposite direction its:\n\ni = int(np.rint(x/10.012))\n\nagain, with analogous equations for j and k.\n\nTo specifically address your question, the max pixel coordinate is 629 (i and j) which corresponds to 6297.55 (x and y).  Note that for your submission, you report results in the x,y,z coordinate system.\n\nFor more discussion look here:\n[https://www.kaggle.com/competitions/czii-cryo-et-object-identification/discussion/553126](https://www.kaggle.com/competitions/czii-cryo-et-object-identification/discussion/553126)\n[https://www.kaggle.com/competitions/czii-cryo-et-object-identification/discussion/544895#3040071](https://www.kaggle.com/competitions/czii-cryo-et-object-identification/discussion/544895#3040071)\n[https://www.kaggle.com/competitions/czii-cryo-et-object-identification/discussion/545381#3044901](https://www.kaggle.com/competitions/czii-cryo-et-object-identification/discussion/545381#3044901)\n\nHope this helps!",
    "3093495": "BTW, I remember there were some discussion indicate that the scale factors are stored in zarr attributes. So there are actually different scale for x, y, z.\nBut I guess the scale are all roughly around 10",
    "3093519": "They're all pretty close.  If you use 10, you'll be off by a little more than half a pixel in the far corner, although that probably doesn't matter all that much.\n\n```\n{\n  \"multiscales\": [\n    {\n      \"axes\": [\n        {\n          \"name\": \"z\",\n          \"type\": \"space\",\n          \"unit\": \"angstrom\"\n        },\n        {\n          \"name\": \"y\",\n          \"type\": \"space\",\n          \"unit\": \"angstrom\"\n        },\n        {\n          \"name\": \"x\",\n          \"type\": \"space\",\n          \"unit\": \"angstrom\"\n        }\n      ],\n      \"datasets\": [\n        {\n          \"coordinateTransformations\": [\n            {\n              \"scale\": [\n                10.012444196428572,\n                10.012444196428572,\n                10.012444537618887\n              ],\n              \"type\": \"scale\"\n            }\n          ],\n          \"path\": \"0\"\n        },\n        {\n          \"coordinateTransformations\": [\n            {\n              \"scale\": [\n                20.024888392857143,\n                20.024888392857143,\n                20.024889075237773\n              ],\n              \"type\": \"scale\"\n            }\n          ],\n          \"path\": \"1\"\n        },\n        {\n          \"coordinateTransformations\": [\n            {\n              \"scale\": [\n                40.049776785714286,\n                40.049776785714286,\n                40.04977815047555\n              ],\n              \"type\": \"scale\"\n            }\n          ],\n          \"path\": \"2\"\n        }\n      ],\n      \"metadata\": {},\n      \"name\": \"/\",\n      \"version\": \"0.4\"\n    }\n  ]\n}\n\n```"
  },
  "source": "meta"
}