{
  "id": 19541,
  "title": "Location of left ventricle using only DICOM data",
  "url": "/competitions/second-annual-data-science-bowl/discussion/19541",
  "author_name": "",
  "post_date": "2016-03-15T18:46:46.600Z",
  "votes": 8,
  "comment_count": 5,
  "views": 1001,
  "content": "<p>The main idea of finding left ventricle is following:</p>\n\n<ul>\n<li>SAX, 2CH and 4CH views contains left ventricle </li>\n<li>2CH perpendicular to SAX and 4CH perpendicular to SAX </li>\n<li>2CH and 4CH planes form an angle as well</li>\n</ul>\n\n<p>We only need to find the point, where all planes intersect &#8211; this will be the point where left ventricle is located. And we have all the data for this task in DICOM file. We need the following:</p>\n\n<p><strong>ImageOrientationPatient</strong> &#8211; all the data to construct 3D-plane</p>\n\n<p><strong>ImagePositionPatient</strong> &#8211; point defining left-top pixel of image on 3D-plane</p>\n\n<p><strong>PixelSpacing</strong> &#8211; pixel scale</p>\n\n<p><strong>Rows</strong>, <strong>Cols</strong> &#8211; number of rows and cols in image</p>\n\n<p>Find line segment of 2CH intersection with SAX. Project it on SAX-plane. The same for 4CH. Next, find the place where these projection lines are intersected on 2D image. </p>\n\n<p><img src=\"https://www.kaggle.com/blobs/download/forum-message-attachment-files/3916/1_sax_57.jpg\" alt title>\n<img src=\"https://www.kaggle.com/blobs/download/forum-message-attachment-files/3917/4_sax_6.jpg\" alt title></p>\n\n<p>The same way it can be used for 2CH and 4CH analysis.</p>\n\n<p><img src=\"https://www.kaggle.com/blobs/download/forum-message-attachment-files/3918/1.jpg\" alt title></p>\n\n<p>Code: <a href=\"https://github.com/ZFTurbo/KAGGLE_DSB2/blob/master/find_ventricle_location.py\">https://github.com/ZFTurbo/KAGGLE_DSB2/blob/master/find_ventricle_location.py</a></p>",
  "messages": [
    {
      "id": "111617",
      "postDate": "03/15/2016 18:46:46",
      "content": "<p>The main idea of finding left ventricle is following:</p>\n\n<ul>\n<li>SAX, 2CH and 4CH views contains left ventricle </li>\n<li>2CH perpendicular to SAX and 4CH perpendicular to SAX </li>\n<li>2CH and 4CH planes form an angle as well</li>\n</ul>\n\n<p>We only need to find the point, where all planes intersect &#8211; this will be the point where left ventricle is located. And we have all the data for this task in DICOM file. We need the following:</p>\n\n<p><strong>ImageOrientationPatient</strong> &#8211; all the data to construct 3D-plane</p>\n\n<p><strong>ImagePositionPatient</strong> &#8211; point defining left-top pixel of image on 3D-plane</p>\n\n<p><strong>PixelSpacing</strong> &#8211; pixel scale</p>\n\n<p><strong>Rows</strong>, <strong>Cols</strong> &#8211; number of rows and cols in image</p>\n\n<p>Find line segment of 2CH intersection with SAX. Project it on SAX-plane. The same for 4CH. Next, find the place where these projection lines are intersected on 2D image. </p>\n\n<p><img src=\"https://www.kaggle.com/blobs/download/forum-message-attachment-files/3916/1_sax_57.jpg\" alt title>\n<img src=\"https://www.kaggle.com/blobs/download/forum-message-attachment-files/3917/4_sax_6.jpg\" alt title></p>\n\n<p>The same way it can be used for 2CH and 4CH analysis.</p>\n\n<p><img src=\"https://www.kaggle.com/blobs/download/forum-message-attachment-files/3918/1.jpg\" alt title></p>\n\n<p>Code: <a href=\"https://github.com/ZFTurbo/KAGGLE_DSB2/blob/master/find_ventricle_location.py\">https://github.com/ZFTurbo/KAGGLE_DSB2/blob/master/find_ventricle_location.py</a></p>",
      "rawMarkdown": "The main idea of finding left ventricle is following:\r\n\r\n- SAX, 2CH and 4CH views contains left ventricle \r\n- 2CH perpendicular to SAX and 4CH perpendicular to SAX \r\n- 2CH and 4CH planes form an angle as well\r\n\r\nWe only need to find the point, where all planes intersect – this will be the point where left ventricle is located. And we have all the data for this task in DICOM file. We need the following:\r\n\r\n**ImageOrientationPatient** – all the data to construct 3D-plane\r\n\r\n**ImagePositionPatient** – point defining left-top pixel of image on 3D-plane\r\n\r\n**PixelSpacing** – pixel scale\r\n\r\n**Rows**, **Cols** – number of rows and cols in image\r\n\r\nFind line segment of 2CH intersection with SAX. Project it on SAX-plane. The same for 4CH. Next, find the place where these projection lines are intersected on 2D image. \r\n\r\n![][1]\r\n![][2]\r\n\r\nThe same way it can be used for 2CH and 4CH analysis.\r\n\r\n![][3]\r\n\r\nCode: https://github.com/ZFTurbo/KAGGLE_DSB2/blob/master/find_ventricle_location.py\r\n\r\n\r\n[1]: https://www.kaggle.com/blobs/download/forum-message-attachment-files/3916/1_sax_57.jpg\r\n[2]: https://www.kaggle.com/blobs/download/forum-message-attachment-files/3917/4_sax_6.jpg\r\n[3]: https://www.kaggle.com/blobs/download/forum-message-attachment-files/3918/1.jpg",
      "votes": null
    },
    {
      "id": "111629",
      "postDate": "03/15/2016 19:55:26",
      "content": "<p>Great :D </p>",
      "rawMarkdown": "Great :D",
      "votes": null
    },
    {
      "id": "111632",
      "postDate": "03/15/2016 20:03:59",
      "content": "<p>I also used this method (i.e. intersection of 2CH and 4CH on the SAX slice) but unfortunately only in the very final stage of the competition..</p>\n\n<p>However still there was a nonnegligible number of cases where e.g. 4CH slice was missing. Moreover in some cases I found that the intersection was a bit off the left ventricle - so then I had to use a fallback method (my original method with thresholding and using the first Fourier component). I wonder how did you deal with those pathological cases?</p>\n\n<p>I also used the intersection point of 2CH and 4CH to align different slices - this helped in cases when some sax slices were in different resolution or had flipped from portrait to landscape..</p>\n\n<p>Another way that I tried to use the 4CH slice was to discover when its intersection with the proposed LV grew too fast at the edge meaning that the slice was already outside the LV. However this did not work as well as I expected... </p>\n\n<p>Basically in the last stage I decided to go with exploiting the 2CH and 4CH views instead of trying NN segmentation - I could not try both for lack of time - now I am not sure that I made the right choice... </p>",
      "rawMarkdown": "I also used this method (i.e. intersection of 2CH and 4CH on the SAX slice) but unfortunately only in the very final stage of the competition..\r\n\r\nHowever still there was a nonnegligible number of cases where e.g. 4CH slice was missing. Moreover in some cases I found that the intersection was a bit off the left ventricle - so then I had to use a fallback method (my original method with thresholding and using the first Fourier component). I wonder how did you deal with those pathological cases?\r\n\r\nI also used the intersection point of 2CH and 4CH to align different slices - this helped in cases when some sax slices were in different resolution or had flipped from portrait to landscape..\r\n\r\nAnother way that I tried to use the 4CH slice was to discover when its intersection with the proposed LV grew too fast at the edge meaning that the slice was already outside the LV. However this did not work as well as I expected... \r\n\r\nBasically in the last stage I decided to go with exploiting the 2CH and 4CH views instead of trying NN segmentation - I could not try both for lack of time - now I am not sure that I made the right choice...",
      "votes": null
    },
    {
      "id": "111663",
      "postDate": "03/16/2016 00:27:06",
      "content": "<p>It works with all studies ?</p>",
      "rawMarkdown": "It works with all studies ?",
      "votes": null
    },
    {
      "id": "111690",
      "postDate": "03/16/2016 06:12:50",
      "content": "<p><strong>Beyond Two Layers</strong>: It works for all patients where both 2ch and 4ch views available.</p>\n\n<p><strong>rmldj</strong>: We also came to this idea a little bit late. So I actually didn't use this method in my part of ensemble, but my teammates used it for NN and it allowed to increase the accuracy of their prediction.\nI used openCV train cascade to find rectangle with ventricle. This method is usually used for face detection: </p>\n\n<p><a href=\"http://docs.opencv.org/3.1.0/dc/d88/tutorial_traincascade.html#gsc.tab=0\">http://docs.opencv.org/3.1.0/dc/d88/tutorial_traincascade.html#gsc.tab=0</a></p>\n\n<p><a href=\"http://note.sonots.com/SciSoftware/haartraining.html\">http://note.sonots.com/SciSoftware/haartraining.html</a></p>",
      "rawMarkdown": "**Beyond Two Layers**: It works for all patients where both 2ch and 4ch views available.\r\n\r\n**rmldj**: We also came to this idea a little bit late. So I actually didn't use this method in my part of ensemble, but my teammates used it for NN and it allowed to increase the accuracy of their prediction.\r\nI used openCV train cascade to find rectangle with ventricle. This method is usually used for face detection: \r\n\r\nhttp://docs.opencv.org/3.1.0/dc/d88/tutorial_traincascade.html#gsc.tab=0\r\n\r\nhttp://note.sonots.com/SciSoftware/haartraining.html",
      "votes": null
    },
    {
      "id": "111726",
      "postDate": "03/16/2016 12:35:19",
      "content": "<p>This is the smartest idea I've learned from this competition.  Good job!</p>",
      "rawMarkdown": "This is the smartest idea I've learned from this competition.  Good job!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 111629,
      "author_name": "alvaroosvaldo",
      "author_url": "",
      "post_date": "03/15/2016 19:55:26",
      "content": "<p>Great :D </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 111632,
      "author_name": "romualdj",
      "author_url": "",
      "post_date": "03/15/2016 20:03:59",
      "content": "<p>I also used this method (i.e. intersection of 2CH and 4CH on the SAX slice) but unfortunately only in the very final stage of the competition..</p>\n\n<p>However still there was a nonnegligible number of cases where e.g. 4CH slice was missing. Moreover in some cases I found that the intersection was a bit off the left ventricle - so then I had to use a fallback method (my original method with thresholding and using the first Fourier component). I wonder how did you deal with those pathological cases?</p>\n\n<p>I also used the intersection point of 2CH and 4CH to align different slices - this helped in cases when some sax slices were in different resolution or had flipped from portrait to landscape..</p>\n\n<p>Another way that I tried to use the 4CH slice was to discover when its intersection with the proposed LV grew too fast at the edge meaning that the slice was already outside the LV. However this did not work as well as I expected... </p>\n\n<p>Basically in the last stage I decided to go with exploiting the 2CH and 4CH views instead of trying NN segmentation - I could not try both for lack of time - now I am not sure that I made the right choice... </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 111663,
      "author_name": "alvaroosvaldo",
      "author_url": "",
      "post_date": "03/16/2016 00:27:06",
      "content": "<p>It works with all studies ?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 111690,
      "author_name": "zfturbo",
      "author_url": "",
      "post_date": "03/16/2016 06:12:50",
      "content": "<p><strong>Beyond Two Layers</strong>: It works for all patients where both 2ch and 4ch views available.</p>\n\n<p><strong>rmldj</strong>: We also came to this idea a little bit late. So I actually didn't use this method in my part of ensemble, but my teammates used it for NN and it allowed to increase the accuracy of their prediction.\nI used openCV train cascade to find rectangle with ventricle. This method is usually used for face detection: </p>\n\n<p><a href=\"http://docs.opencv.org/3.1.0/dc/d88/tutorial_traincascade.html#gsc.tab=0\">http://docs.opencv.org/3.1.0/dc/d88/tutorial_traincascade.html#gsc.tab=0</a></p>\n\n<p><a href=\"http://note.sonots.com/SciSoftware/haartraining.html\">http://note.sonots.com/SciSoftware/haartraining.html</a></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 111726,
      "author_name": "aaalgo",
      "author_url": "",
      "post_date": "03/16/2016 12:35:19",
      "content": "<p>This is the smartest idea I've learned from this competition.  Good job!</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "111617": "The main idea of finding left ventricle is following:\r\n\r\n- SAX, 2CH and 4CH views contains left ventricle \r\n- 2CH perpendicular to SAX and 4CH perpendicular to SAX \r\n- 2CH and 4CH planes form an angle as well\r\n\r\nWe only need to find the point, where all planes intersect – this will be the point where left ventricle is located. And we have all the data for this task in DICOM file. We need the following:\r\n\r\n**ImageOrientationPatient** – all the data to construct 3D-plane\r\n\r\n**ImagePositionPatient** – point defining left-top pixel of image on 3D-plane\r\n\r\n**PixelSpacing** – pixel scale\r\n\r\n**Rows**, **Cols** – number of rows and cols in image\r\n\r\nFind line segment of 2CH intersection with SAX. Project it on SAX-plane. The same for 4CH. Next, find the place where these projection lines are intersected on 2D image. \r\n\r\n![][1]\r\n![][2]\r\n\r\nThe same way it can be used for 2CH and 4CH analysis.\r\n\r\n![][3]\r\n\r\nCode: https://github.com/ZFTurbo/KAGGLE_DSB2/blob/master/find_ventricle_location.py\r\n\r\n\r\n[1]: https://www.kaggle.com/blobs/download/forum-message-attachment-files/3916/1_sax_57.jpg\r\n[2]: https://www.kaggle.com/blobs/download/forum-message-attachment-files/3917/4_sax_6.jpg\r\n[3]: https://www.kaggle.com/blobs/download/forum-message-attachment-files/3918/1.jpg",
    "111629": "Great :D",
    "111632": "I also used this method (i.e. intersection of 2CH and 4CH on the SAX slice) but unfortunately only in the very final stage of the competition..\r\n\r\nHowever still there was a nonnegligible number of cases where e.g. 4CH slice was missing. Moreover in some cases I found that the intersection was a bit off the left ventricle - so then I had to use a fallback method (my original method with thresholding and using the first Fourier component). I wonder how did you deal with those pathological cases?\r\n\r\nI also used the intersection point of 2CH and 4CH to align different slices - this helped in cases when some sax slices were in different resolution or had flipped from portrait to landscape..\r\n\r\nAnother way that I tried to use the 4CH slice was to discover when its intersection with the proposed LV grew too fast at the edge meaning that the slice was already outside the LV. However this did not work as well as I expected... \r\n\r\nBasically in the last stage I decided to go with exploiting the 2CH and 4CH views instead of trying NN segmentation - I could not try both for lack of time - now I am not sure that I made the right choice...",
    "111663": "It works with all studies ?",
    "111690": "**Beyond Two Layers**: It works for all patients where both 2ch and 4ch views available.\r\n\r\n**rmldj**: We also came to this idea a little bit late. So I actually didn't use this method in my part of ensemble, but my teammates used it for NN and it allowed to increase the accuracy of their prediction.\r\nI used openCV train cascade to find rectangle with ventricle. This method is usually used for face detection: \r\n\r\nhttp://docs.opencv.org/3.1.0/dc/d88/tutorial_traincascade.html#gsc.tab=0\r\n\r\nhttp://note.sonots.com/SciSoftware/haartraining.html",
    "111726": "This is the smartest idea I've learned from this competition.  Good job!"
  },
  "source": "meta"
}