{
  "id": 441764,
  "title": "simplest way to align multi-phrase CT scan",
  "url": "/competitions/rsna-2023-abdominal-trauma-detection/discussion/441764",
  "author_name": "hengck23",
  "post_date": "2023-09-20T05:49:37.457000",
  "votes": 5,
  "comment_count": 2,
  "views": 0,
  "content": "<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F113660%2Ffd8b842f2039bdc93ce3caa2e4a3084c%2FSelection_999(3300).png?generation=1695188803315458&amp;alt=media\" alt=\"\"></p>\n<p>Assume a patient has 2 series: A and B. <br>\ncompute intensity difference of each pair (a,b) where a is  any image in A, b is any image in B<br>\nyou end up a difference matrix that is len(A) x len(B). This is the \"diff figure\" shown above.</p>\n<p>you can use heuristics to find the best shift (the dark line in \"diff figure\"  )</p>\n<hr>\n<p>fanciful heuristics like dynamic programming to find the least cost (difference) path ….</p>\n<p>but brute force search works well (just sum up all possible sfited diagonal paths)</p>\n<p>a smarter search: just search sfited diagonal  in the set(diff.argmin(-1))</p>\n<hr>\n<p>once you get the idea, you can compare difference slice: e.g. z-y plane or z-x plane. or even in 3d x,yz voxel<br>\nhere i use x-y plane.</p>\n<p>we use resized image for faster comparison.</p>\n<p>if you don't want to to use heuristic, just learned a neural network for it.</p>",
  "messages": [
    {
      "id": 2447495,
      "postDate": "2023-09-20T05:49:37.457Z",
      "content": "<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F113660%2Ffd8b842f2039bdc93ce3caa2e4a3084c%2FSelection_999(3300).png?generation=1695188803315458&amp;alt=media\" alt=\"\"></p>\n<p>Assume a patient has 2 series: A and B. <br>\ncompute intensity difference of each pair (a,b) where a is  any image in A, b is any image in B<br>\nyou end up a difference matrix that is len(A) x len(B). This is the \"diff figure\" shown above.</p>\n<p>you can use heuristics to find the best shift (the dark line in \"diff figure\"  )</p>\n<hr>\n<p>fanciful heuristics like dynamic programming to find the least cost (difference) path ….</p>\n<p>but brute force search works well (just sum up all possible sfited diagonal paths)</p>\n<p>a smarter search: just search sfited diagonal  in the set(diff.argmin(-1))</p>\n<hr>\n<p>once you get the idea, you can compare difference slice: e.g. z-y plane or z-x plane. or even in 3d x,yz voxel<br>\nhere i use x-y plane.</p>\n<p>we use resized image for faster comparison.</p>\n<p>if you don't want to to use heuristic, just learned a neural network for it.</p>",
      "rawMarkdown": "![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F113660%2Ffd8b842f2039bdc93ce3caa2e4a3084c%2FSelection_999(3300).png?generation=1695188803315458&alt=media)\n\nAssume a patient has 2 series: A and B. \ncompute intensity difference of each pair (a,b) where a is  any image in A, b is any image in B\nyou end up a difference matrix that is len(A) x len(B). This is the \"diff figure\" shown above.\n\nyou can use heuristics to find the best shift (the dark line in \"diff figure\"  )\n\n---\nfanciful heuristics like dynamic programming to find the least cost (difference) path ....\n\nbut brute force search works well (just sum up all possible sfited diagonal paths)\n\na smarter search: just search sfited diagonal  in the set(diff.argmin(-1))\n\n\n---\nonce you get the idea, you can compare difference slice: e.g. z-y plane or z-x plane. or even in 3d x,yz voxel\nhere i use x-y plane.\n\nwe use resized image for faster comparison.\n\nif you don't want to to use heuristic, just learned a neural network for it.\n",
      "votes": 5
    },
    {
      "id": 2447501,
      "postDate": "2023-09-20T05:52:37.613Z",
      "content": "<p>more succesful cases</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F113660%2Fd86cb3f0d3d443c8f17ec9ecba6e1349%2FSelection_999(3299).png?generation=1695189130507560&amp;alt=media\" alt=\"\"></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F113660%2F2477bc48f32acabe4d6f5ce2caf5033e%2FSelection_999(3296).png?generation=1695189142338279&amp;alt=media\" alt=\"\"></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F113660%2Fd8f7fa4dd3402c0963f1cfa13d245410%2FSelection_999(3294).png?generation=1695189155973183&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "more succesful cases\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F113660%2Fd86cb3f0d3d443c8f17ec9ecba6e1349%2FSelection_999(3299).png?generation=1695189130507560&alt=media)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F113660%2F2477bc48f32acabe4d6f5ce2caf5033e%2FSelection_999(3296).png?generation=1695189142338279&alt=media)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F113660%2Fd8f7fa4dd3402c0963f1cfa13d245410%2FSelection_999(3294).png?generation=1695189155973183&alt=media)",
      "votes": 1
    },
    {
      "id": 2447499,
      "postDate": "2023-09-20T05:51:46.647Z",
      "content": "<p>unfortunately, some series are enlarged. but it still work to some extend.<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F113660%2Fe54ab6767efb9b2e5c58e3a6eb5d6422%2FSelection_999(3298).png?generation=1695189096978475&amp;alt=media\" alt=\"\"></p>\n<p>there are some unknown failure cases (about 5%), which i am debugging now<br>\ne.g. </p>\n<ul>\n<li>shifted in x,y, and z (instead of z only)</li>\n<li>overlap region is too small</li>\n</ul>",
      "rawMarkdown": "unfortunately, some series are enlarged. but it still work to some extend.\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F113660%2Fe54ab6767efb9b2e5c58e3a6eb5d6422%2FSelection_999(3298).png?generation=1695189096978475&alt=media)\n\n\nthere are some unknown failure cases (about 5%), which i am debugging now\ne.g. \n- shifted in x,y, and z (instead of z only)\n- overlap region is too small"
    }
  ],
  "comments": [
    {
      "id": 2447501,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2023-09-20T05:52:37.613000",
      "content": "<p>more succesful cases</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F113660%2Fd86cb3f0d3d443c8f17ec9ecba6e1349%2FSelection_999(3299).png?generation=1695189130507560&amp;alt=media\" alt=\"\"></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F113660%2F2477bc48f32acabe4d6f5ce2caf5033e%2FSelection_999(3296).png?generation=1695189142338279&amp;alt=media\" alt=\"\"></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F113660%2Fd8f7fa4dd3402c0963f1cfa13d245410%2FSelection_999(3294).png?generation=1695189155973183&amp;alt=media\" alt=\"\"></p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 2447499,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2023-09-20T05:51:46.647000",
      "content": "<p>unfortunately, some series are enlarged. but it still work to some extend.<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F113660%2Fe54ab6767efb9b2e5c58e3a6eb5d6422%2FSelection_999(3298).png?generation=1695189096978475&amp;alt=media\" alt=\"\"></p>\n<p>there are some unknown failure cases (about 5%), which i am debugging now<br>\ne.g. </p>\n<ul>\n<li>shifted in x,y, and z (instead of z only)</li>\n<li>overlap region is too small</li>\n</ul>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2447495": "![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F113660%2Ffd8b842f2039bdc93ce3caa2e4a3084c%2FSelection_999(3300).png?generation=1695188803315458&alt=media)\n\nAssume a patient has 2 series: A and B. \ncompute intensity difference of each pair (a,b) where a is  any image in A, b is any image in B\nyou end up a difference matrix that is len(A) x len(B). This is the \"diff figure\" shown above.\n\nyou can use heuristics to find the best shift (the dark line in \"diff figure\"  )\n\n---\nfanciful heuristics like dynamic programming to find the least cost (difference) path ....\n\nbut brute force search works well (just sum up all possible sfited diagonal paths)\n\na smarter search: just search sfited diagonal  in the set(diff.argmin(-1))\n\n\n---\nonce you get the idea, you can compare difference slice: e.g. z-y plane or z-x plane. or even in 3d x,yz voxel\nhere i use x-y plane.\n\nwe use resized image for faster comparison.\n\nif you don't want to to use heuristic, just learned a neural network for it.\n",
    "2447501": "more succesful cases\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F113660%2Fd86cb3f0d3d443c8f17ec9ecba6e1349%2FSelection_999(3299).png?generation=1695189130507560&alt=media)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F113660%2F2477bc48f32acabe4d6f5ce2caf5033e%2FSelection_999(3296).png?generation=1695189142338279&alt=media)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F113660%2Fd8f7fa4dd3402c0963f1cfa13d245410%2FSelection_999(3294).png?generation=1695189155973183&alt=media)",
    "2447499": "unfortunately, some series are enlarged. but it still work to some extend.\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F113660%2Fe54ab6767efb9b2e5c58e3a6eb5d6422%2FSelection_999(3298).png?generation=1695189096978475&alt=media)\n\n\nthere are some unknown failure cases (about 5%), which i am debugging now\ne.g. \n- shifted in x,y, and z (instead of z only)\n- overlap region is too small"
  }
}