{"id":1446,"date":"2023-05-20T19:49:34","date_gmt":"2023-05-20T11:49:34","guid":{"rendered":"https:\/\/sanlangcode.com\/?p=1446"},"modified":"2023-05-20T19:49:34","modified_gmt":"2023-05-20T11:49:34","slug":"%e5%8c%bb%e5%ad%a6%e5%bd%b1%e5%83%8f%e5%a4%84%e7%90%86%e7%9b%b8%e5%85%b3%e7%9f%a5%e8%af%86%e6%95%b4%e7%90%86%ef%bc%88%e4%b8%80%ef%bc%89","status":"publish","type":"post","link":"https:\/\/sanlangcode.com\/index.php\/2023\/05\/20\/%e5%8c%bb%e5%ad%a6%e5%bd%b1%e5%83%8f%e5%a4%84%e7%90%86%e7%9b%b8%e5%85%b3%e7%9f%a5%e8%af%86%e6%95%b4%e7%90%86%ef%bc%88%e4%b8%80%ef%bc%89\/","title":{"rendered":"\u533b\u5b66\u5f71\u50cf\u5904\u7406\u76f8\u5173\u77e5\u8bc6\u6574\u7406\uff08\u4e00\uff09\u8f6c"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>Segmentation to RT structure<\/strong><\/h2>\n\n\n\n<p>\u8fd1\u65e5\u505a\u533b\u7597\u5f71\u50cf\u5904\u7406\u76f8\u5173\u7684\u5185\u5bb9\uff0c\u611f\u6168\u4e8e\u8fd9\u65b9\u9762\u8d44\u6599\u4e0d\u5168\u3001\u6563\u788e\uff0c\u9042\u8bb0\u5f55\u81ea\u5df1\u83b7\u5f97\u7684\u4e00\u4e9b\u8d44\u6599\u4ee5\u4f9b\u65e5\u540e\u67e5\u9605\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>DICOM<\/strong><\/h2>\n\n\n\n<p>DICOM \u662f\u533b\u5b66\u56fe\u50cf\u548c\u76f8\u5173\u4fe1\u606f\u7684\u56fd\u9645\u6807\u51c6\uff0c\u5b83\u5b9a\u4e49\u4e86\u6ee1\u8db3\u4e34\u5e8a\u9700\u8981\u7684\u53ef\u7528\u4e8e\u6570\u636e\u4ea4\u6362\u7684\u533b\u5b66\u56fe\u50cf\u683c\u5f0f\uff0c\u88ab\u5e7f\u6cdb\u7528\u4e8e\u653e\u5c04\u3001\u6210\u50cf\u7684\u8bca\u7597\u8bca\u65ad\u8bbe\u5907\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u5728\u533b\u9662\u653e\u5c04\u79d1\u4f7f\u7528\u7684\u8bbe\u5907\u4e0a\u8bfb\u53d6\u7684\u5f71\u50cf\u57fa\u672c\u90fd\u662fDICOM\u683c\u5f0f\uff0c\u5305\u62ecCT\u3001MRI\u3001\u8d85\u58f0\u7b49\u3002<\/p>\n\n\n\n<p>DICOM\u683c\u5f0f\u7684\u56fe\u50cf\uff0c\u6bcf\u4e00\u5f20\u90fd\u5e26\u6709\u9664\u50cf\u7d20\uff08\u4f53\u7d20\uff09\u4fe1\u606f\u4e4b\u5916\u7684\u5927\u91cf\u4fe1\u606f\u3002\u5176\u4fe1\u606f\u7ec4\u6210\u4e3b\u8981\u6709\u4ee5\u4e0b\u51e0\u90e8\u5206\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Patient<\/strong>\uff1a\u75c5\u4eba\u4fe1\u606f<\/li><li><strong>Study<\/strong>\uff1a\u8bca\u7597\u4fe1\u606f\uff0c\u5982\u68c0\u67e5\u65f6\u95f4\u3001\u68c0\u67e5\u90e8\u4f4d\u3001ID\u7b49<\/li><li><strong>Series<\/strong>\uff1a\u5e8f\u5217\u53f7\u3001\u56fe\u50cf\u5750\u6807\u4fe1\u606f\u7b49\u3002\u56fe\u50cf\u5750\u6807\u4fe1\u606f\u4e3b\u8981\u5173\u6ce8\uff1a<ul><li><strong>SliceThickness<\/strong>\uff1a\u5c42\u539a\uff0c\u5373\u6bcf\u5f20\u5207\u7247\u4e4b\u95f4\u7684\u95f4\u8ddd<\/li><li><strong>ImagePositionPatient<\/strong>\uff1a\u8be5\u5f20\u5207\u7247\u5750\u6807\u539f\u70b9\uff08\u56fe\u50cf\u5de6\u4e0a\u89d2\uff0c\u4e8c\u7ef4\u56fe\u4e2d\u5411\u4e0b\u4e3ay\u8f74\uff0c\u5411\u53f3\u4e3ax\u8f74\uff09\u5728\u7a7a\u95f4\u4e2d\u7684\u5750\u6807\uff08x\uff0cy\uff0cz\uff09<\/li><li><strong>ImageOritentationPatient<\/strong>\uff1a\u516d\u5143\u7ec4\uff0c\u5f53\u524d\u5207\u7247\u7684x\u3001y\u8f74\u4e0e\u89e3\u5256\u5b66\u5750\u6807\u7cfb\u95f4\u7684\u5173\u7cfb\u3002<\/li><\/ul><\/li><\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>\u6b64\u5904\u6d89\u53ca\u77e2\u72b6\u9762\u3001\u51a0\u72b6\u9762\u3001\u6a2a\u65ad\u9762<br>\u7b80\u5355\u7684\u8bb0\u5fc6\u65b9\u5f0f\u662f\uff1a\u77e2\u72b6\u9762\u5373\u4e00\u652f\u7bad\u5c04\u4e2d\u4eba\u6240\u5f62\u6210\u7684\u9762\uff0c\u6b63\u4e2d\u4e8c\u5206\u4eba\u4f53\u3002<br>\u51a0\u72b6\u9762\u53ef\u60f3\u8c61\u53e4\u4ee3\u5b98\u5e3d\uff0c\u4ece\u5934\u9876\u5411\u5730\u9762\u7684\u5207\u9762\u3002<br>\u6a2a\u65ad\u9762\u5373\u8170\u65a9\u5e73\u9762\u3002<br>\u5728\u4e0b\u56fe\u4e2d\uff0c\u7ea2\u8272\u5207\u9762\u4e3a\u77e2\u72b6\u9762\uff0c\u7d2b\u8272\u5207\u9762\u4e3a\u51a0\u72b6\u9762\uff0c\u7eff\u8272\u5207\u9762\u4e3a\u6a2a\u65ad\u9762\u3002<\/p><\/blockquote>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pic4.zhimg.com\/80\/v2-081604283c42e11bb2dde7692c127857_1440w.webp\" alt=\"\"\/><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>\u516d\u5143\u7ec4\u6240\u8868\u793a\u7684\uff0c\u5373\u662f\u4e0e\u8fd9\u4e09\u4e2a\u9762\u7684\u5939\u89d2\u5173\u7cfb\uff0c\u4ee5\u4f59\u5f26\u503c\u5448\u73b0\u3002<br>\u5f71\u50cf\u4e0a\uff0c\u6b63\u65b9\u5411\u4e3aL\u3001S\u3001P\u3002<br>\u7528\uff08x1\uff0cx2\uff0cx3\uff0cy1\uff0cy2\uff0cy3\uff09\u6765\u8868\u793a\u7684\u8bdd\uff0cx1\u3001x2\u3001x3\u5206\u522b\u8868\u793ax\u8f74\u4e0eL\u3001P\u3001S\u95f4\u7684\u5939\u89d2\u4f59\u5f26\u503c\uff0cy1\u3001y2\u3001y3\u5219\u8868\u793ay\u8f74\u4e0eL\u3001P\u3001S\u95f4\u7684\u5939\u89d2\u4f59\u5f26\u503c\u3002<br>\u4f7f\u7528\u8fd9\u4e2a\u516d\u5143\u7ec4\u53ef\u4ee5\u5224\u65ad\u56fe\u50cf\u533a\u57df\u662f\u5426\u4e3a\u77e9\u5f62\uff08\u4e24\u5411\u91cf\u70b9\u4e58\u4e3a0\uff09\uff0c\u4ee5\u53ca\u4e0e\u89e3\u5256\u5b66\u5750\u6807\u7684\u5173\u7cfb\u3002\u5f53\u8fd9\u4e2a\u516d\u5143\u7ec4\u53ea\u542b\u67090\u30011\u3001-1\u65f6\uff0c\u4ee3\u8868\u5207\u7247\u4e00\u5b9a\u4e0e\u67d0\u89e3\u5256\u5b66\u5e73\u9762\u5e73\u884c\u3002<br>\u66f4\u591a\u5185\u5bb9\u53ef\u4ee5\u53c2\u89c1\u6b64\u535a\u5ba2\uff0c\u8bb2\u89e3\u5f97\u5f88\u8be6\u7ec6\u3002<br><a href=\"https:\/\/link.zhihu.com\/?target=https%3A\/\/blog.csdn.net\/zssureqh\/article\/details\/61636150\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/blog.csdn.net\/zssureqh\/article\/details\/61636150<\/a><\/p><\/blockquote>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Image<\/strong>\uff1a\u56fe\u50cf\u4fe1\u606f\u3002\u4e3b\u8981\u5173\u6ce8\uff1a<ul><li><strong>PixelSpacing<\/strong>\uff1a\u4e8c\u5143\u7ec4\u3002\u7528\u6765\u8868\u793a\u5f53\u524d\u4e8c\u7ef4\u56fe\u50cf\u5750\u6807\u4e0a\uff0cxy\u8f74\u7684\u5355\u4f4d\u957f\u5ea6\uff0c\u5728\u5b9e\u9645\u5750\u6807\u7cfb\u4e2d\u6240\u5360\u636e\u7684\u957f\u5ea6\u3002<\/li><li><strong>Rows\u3001Columns<\/strong>\uff1a\u884c\u5217\u4fe1\u606f\u3002<\/li><li><strong>Bits Allocated\u3001Bits Stored<\/strong>\uff1a\u6bcf\u4e2a\u50cf\u7d20\u5206\u914d\u7684\u4f4d\u6570\u3001\u5b58\u50a8\u4f4d\u6570<\/li><li><strong>Window Center\u3001Window Width<\/strong>\uff1a\u7a97\u4f4d\u3001\u7a97\u5bbd<\/li><li><strong>Rescale Slope\u3001Rescale Intercept&nbsp;<\/strong>\uff1a\u659c\u7387\u3001\u622a\u8ddd\u3002\u4e3b\u8981\u7528\u5728\u56fe\u50cf\u53ef\u89c6\u5316\u4e2d\u3002<\/li><\/ul><\/li><\/ul>\n\n\n\n<p>\u9664\u4e86\u4e0a\u8ff0\u56db\u4e2a\u90e8\u5206 tag \u4fe1\u606f\u5916\uff0c\u5c31\u662f PixelData \u4fe1\u606f\u3002\u6b64\u5904\u5b58\u50a8\u7684\u65e2\u662f\u8be5\u5f20\u5207\u7247\u7684\u50cf\u7d20\u4fe1\u606f\u3002<\/p>\n\n\n\n<p>DICOM \u6587\u4ef6\u53ef\u4ee5\u4f7f\u7528 pydicom \u5e93\u6765\u8fdb\u884c\u8bfb\u5199\uff0c\u8be5\u5e93\u63d0\u4f9b\u4e86\u975e\u5e38\u5168\u9762\u7684\u64cd\u4f5c\u3002<\/p>\n\n\n\n<p>\u5728 vscode \u4e2d\u641c\u7d22 dicom \u6709\u4e00\u4e2a\u63d2\u4ef6\u53ef\u4ee5\u7528\u6765\u770b dicom \u6587\u4ef6\u4fe1\u606f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>segmentation<\/strong><\/h2>\n\n\n\n<p>segmentatiom \u662f\u5bf9 DICOM \u5e8f\u5217\u6587\u4ef6\u8fdb\u884c\u5668\u5b98\u5206\u5272\u3001\u9776\u533a\u52fe\u753b\u540e\u7684\u7ed3\u679c\uff0c\u4ee5 nifti \u683c\u5f0f\u7ed9\u51fa\uff08\u4e5f\u53ef\u4ee5\u4e3a\u5176\u4ed6\u683c\u5f0f\uff0c\u4f46\u5b58\u50a8\u5f62\u5f0f\u57fa\u672c\u90fd\u662f\u88f8\u6570\u636e\uff0c\u76f4\u63a5\u7ed9\u51fa\u5206\u5272\u7ed3\u679c\u7684\u6570\u7ec4\uff09\u3002\u5176\u4e2d\u7684\u4fe1\u606f\u4e3a\u4e09\u7ef4\u6570\u7ec4\u5f62\u5f0f\uff0c\u6bcf\u4e2a\u4f53\u7d20\u70b9\u5b58\u50a8\u8be5\u70b9\u5bf9\u5e94\u56fe\u50cf\u7684\u5206\u5272\u7ed3\u679c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>0\uff1a\u4ee3\u8868\u6b64\u70b9\u4e3abackground\uff0c\u6216\u6b64\u6b21\u6807\u6ce8\u4e2d\u4e0d\u5173\u6ce8\u7684\u533a\u57df\n1~n\uff1a\u4ee3\u8868\u6b64\u70b9\u4e3a\u5bf9\u5e94\u7684\u533a\u57df\u3002\n\u5176\u4e2d 1~n \u6240\u4ee3\u8868\u7684\u5668\u5b98\u3001\u533a\u57df\u7531\u5206\u5272\u7a0b\u5e8f\u5b9a\u4e49<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>RT structure<\/strong><\/h2>\n\n\n\n<p>RT structure \u6587\u4ef6\u662f\u5bfc\u5165\u5230\u653e\u7597\u7cfb\u7edf\u4e2d\u6240\u9700\u7684 DICOM \u6587\u4ef6\uff0c\u5176\u4e2d\u5b58\u50a8\u4e86\u6bcf\u4e2a\u7ed3\u6784\u533a\u57df\u7684\u7ec4\u6210\uff0c\u4ee5\u53ca\u76f8\u5bf9\u5e94\u7684\u539f\u59cb DICOM \u5e8f\u5217\u6807\u8bc6\u548c\u90e8\u5206\u75c5\u4eba\u4fe1\u606f\u3002\u5176\u4e3b\u8981\u7ed3\u6784\u5206\u4e3a\u4e09\u4e2a\u90e8\u5206\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u9996\u5148\u4e3a\u5934\u90e8\u4fe1\u606f\uff0c\u5176\u4e2d\u5b58\u50a8\u4e86\u8bf8\u5982 patientname\u3001patientid \u4e00\u7c7b\u7684\u75c5\u4eba\u4fe1\u606f\uff0c\u4ee5\u53ca DICOM \u4fe1\u606f\u3002<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pic4.zhimg.com\/80\/v2-30c45c61ff9d0e1b53322772c472cbcb_1440w.webp\" alt=\"\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>\u7b2c\u4e8c\u90e8\u5206\u4e3a reference \u4fe1\u606f\uff0c\u5373\u8be5 RT structure \u6587\u4ef6\u53c2\u8003\u7684 dicom \u5e8f\u5217\u6587\u4ef6\u3002<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pic3.zhimg.com\/80\/v2-814ecb2645ff9c31ff03df7641809492_1440w.webp\" alt=\"\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>\u7b2c\u4e09\u90e8\u5206\u5373\u662f\u7ed3\u6784\u4fe1\u606f\uff0c\u5b58\u50a8\u5404\u4e2a\u533a\u57df\u7684\u6784\u6210\u70b9\u3001\u53c2\u8003dicom\u6587\u4ef6\u7b49\u3002<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pic4.zhimg.com\/80\/v2-b2fb8279c3e5b7fffd8fe7350f08ce53_1440w.webp\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u82e5\u8981\u89e3\u6790 RT structure \u6587\u4ef6\u53ef\u4ee5\u4ece\u4ee5\u4e0a\u4e09\u90e8\u5206\u5165\u624b<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>segmentation to RT structure<\/strong><\/h2>\n\n\n\n<p>\u8fd1\u671f\u6240\u505a\u7684\u5de5\u4f5c\u4e3b\u8981\u662f\u5c06\u5df2\u7ecf\u751f\u6210\u7684\u5206\u5272\u3001\u52fe\u753b\u4fe1\u606f\u7ed3\u5408\u539f\u59cb\u7684 DICOM \u5e8f\u5217\u6587\u4ef6\uff0c\u751f\u6210 RT structure \u6587\u4ef6\uff08\u540e\u7b80\u79f0 RTs \uff09\uff0c\u4ee5\u4f9b\u533b\u751f\u540e\u7eed\u4f7f\u7528\u3002<\/p>\n\n\n\n<p>\u4e3b\u8981\u601d\u8def\u4e3a\uff1anifti-&gt;mha-&gt;RTs<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>nifti-&gt;mha<\/strong><\/h3>\n\n\n\n<p>mha \u662f\u4e00\u79cd metadata \u683c\u5f0f\uff0c\u5176\u4e2d\u5b58\u50a8\u4e86\u5934\u90e8\u4fe1\u606f\u548c\u50cf\u7d20\u4fe1\u606f\u3002\u4e0e mha \u683c\u5f0f\u7c7b\u4f3c\u7684\u662f mhd \u683c\u5f0f\uff0c\u533a\u522b\u5728\u4e8e mhd \u5c06\u5934\u90e8\u4fe1\u606f\u5b58\u50a8\u4e8e\u4e00\u4e2a\u5355\u72ec\u7684 .raw \u6587\u4ef6\u4e2d\uff0c\u672c\u8eab\u53ea\u5b58\u50a8\u6570\u636e\u4fe1\u606f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pic4.zhimg.com\/80\/v2-ae89de1f4e5a43cd3774306d15925587_1440w.webp\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u4e0a\u56fe\u5373\u4e3a\u4e00\u4e2a mha \u6587\u4ef6\u6240\u5b58\u50a8\u7684\u5934\u90e8\u4fe1\u606f\uff0c\u53ef\u4ee5\u770b\u5230\uff0c\u5b83\u5b58\u50a8\u4e86\u7ef4\u5ea6\u3001\u539f\u70b9\u3001\u65b9\u5411\u3001\u50cf\u7d20\u95f4\u8ddd\u7b49\u4fe1\u606f\uff0c\u8fd9\u90e8\u5206\u4fe1\u606f\u5728\u540e\u7eed\u6784\u5efa RTs \u65f6\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002<\/p>\n\n\n\n<p>\u90a3\u4e48\uff0c\u5728\u521d\u6b65\u4e86\u89e3 mha \u6587\u4ef6\u7684\u6784\u6210\u540e\uff0c\u8981\u5c06 nii \u6587\u4ef6\u8f6c\u6362\u4e3a mha \u6587\u4ef6\u5c31\u6bd4\u8f83\u7b80\u5355\u4e86\u3002<\/p>\n\n\n\n<p>\u601d\u8def\u4e3a\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u4f7f\u7528 SimpleITK \u5e93\u8bfb\u53d6 nii \u6587\u4ef6\u4e2d\u50a8\u5b58\u7684\u4f53\u7d20\u4fe1\u606f\u3002<\/li><li>\u4f7f\u7528 pydicom \u5e93\u8bfb\u53d6\u53c2\u8003\u7684 DICOM \u5e8f\u5217\u6587\u4ef6\u4fe1\u606f\u3002\u7136\u540e\u4f7f\u7528\u8fd9\u91cc\u5f97\u5230\u7684\u4fe1\u606f\u7528\u4e8e\u6784\u5efa mha \u5934\u90e8\u4fe1\u606f\u3002<\/li><li>\u6700\u540e\u518d\u4f7f\u7528 SimpleITK \u5e93\u5199 mha \u6587\u4ef6<\/li><\/ul>\n\n\n\n<p>\u4e00\u4e2a\u7b80\u5355\u7684\u53ef\u6267\u884c\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import SimpleITK as sitk\nimport pydicom\nreader=sitk.ReadImage(\"labels.nii\")\nreferencect=pydicom.read_file(\"file_path.dcm\")<em>##\u8f93\u5165\u53c2\u8003\u7684 dicom \u6587\u4ef6\uff0c\u4e00\u4e2a\u5373\u53ef<\/em>\n\u200b\nConstPixelSpacing =(float(referencect.PixelSpacing&#91;0]), float(referencect.PixelSpacing&#91;1]), float(referencect.SliceThickness))\n\u200b\nOrigin = referencect.ImagePositionPatient\n\u200b\nimg=sitk.GetArrayFromImage(reader) <em>#z y x<\/em>\nimg2=sitk.GetImageFromArray(img) <em>#z y x<\/em>\nimg2.SetSpacing(ConstPixelSpacing)\nimg2.SetOrigin(Origin)\nsitk.WriteImage(img2,\"testmha.mha\")<\/code><\/pre>\n\n\n\n<p>\u4e0a\u4f8b\u4ee3\u7801\u4ec5\u663e\u793a\u5982\u4f55\u6784\u5efa\u4e00\u4e2a mha \u6587\u4ef6\uff0c\u5728 nii \u8f6c\u5316 mha \u4e2d\u8fd8\u6709\u5f88\u591a\u7ec6\u8282\u9700\u8981\u4e3b\u8981\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u5728\u4e00\u4e2a DICOM \u5e8f\u5217\u4e2d\uff0c\u4f60\u6700\u7ec8\u53c2\u8003\u7684 DICOM \u6587\u4ef6\u5c06\u51b3\u5b9a\u4f60\u6784\u5efa\u7684 mha \u6587\u4ef6\u5934\u90e8\u4fe1\u606f\u4e2d&nbsp;<code>offset<\/code>&nbsp;\u9879\uff0c\u8be5\u9879\u5c06\u5f71\u54cd\u5230\u6784\u5efa RTs \u65f6\u5207\u7247\u7684\u8d70\u5411\u3002\u4f8b\u5982\u82e5\u4f60\u9009\u62e9\u7684 DICOM \u6587\u4ef6\u4e3a\u5207\u7247\u4e2d\u6700\u9876\u90e8\u7684\u4e00\u5f20\uff0c\u5219\u4f60\u7684\u6574\u4e2a\u7ed3\u6784\u7531\u4e8e\u5c42\u539a\u5927\u4e8e0\uff0c\u5c06\u5411\u4e0a\u751f\u957f\uff0c\u4e0e\u771f\u5b9e\u7ed3\u6784\u76f8\u53cd\u3002\u56e0\u6b64\u9009\u62e9\u54ea\u5f20\u5207\u7247\u4f5c\u4e3a\u53c2\u8003\uff0c\u8981\u7ed3\u5408\u5c42\u539a\u6765\u786e\u5b9a\u3002\u901a\u5e38\u5c42\u539a\u5927\u4e8e0\uff0c\u56e0\u6b64\u9009\u62e9\u6700\u5e95\u90e8\u7684\u5207\u7247\u4f5c\u4e3a\u53c2\u8003\u3002<\/li><li>SimpleITK \u5e93\u5728\u8bfb\u5165 nii \u6587\u4ef6\u751f\u6210\u6570\u7ec4\u65f6\uff0c\u5c06\u4ee5 (z,y,x) \u5f62\u5f0f\u751f\u6210\u6570\u7ec4\uff0c\u5982\u679c\u540c\u6837\u4ee5 SimpleITK \u5e93\u5199\u6587\u4ef6\uff0c\u53ef\u4ee5\u4e0d\u7528\u6ce8\u610f\uff0c\u4f46\u82e5\u8fd8\u6709\u5176\u4ed6\u8bf8\u5982\u53ef\u89c6\u5316\u7b49\u9700\u6c42\uff0c\u5e94\u6ce8\u610f\u5750\u6807\u5bf9\u5e94\u3002<\/li><li>\u5199 mha \u6587\u4ef6\u65f6\uff0c\u53ef\u80fd\u51fa\u73b0 PixelSpacing\u3001Origin \u7531\u4e8e\u6d6e\u70b9\u6570\u7cbe\u5ea6\u800c\u4e0d\u5b8c\u5168\u7b49\u4e8e\u5143\u6570\u636e\u7684\u95ee\u9898\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff0c\u6b64\u95ee\u9898\u6211\u6682\u672a\u60f3\u5230\u89e3\u51b3\u65b9\u6848\uff0c\u4f46\u7531\u4e8e\u5728\u540e\u7eed\u751f\u6210 RTs \u5e76\u65e0\u5f71\u54cd\uff0c\u56e0\u6b64\u6682\u65f6\u5ffd\u7565\u6b64\u95ee\u9898\u3002<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pic2.zhimg.com\/80\/v2-1cf7179dd503b00608100acb37a08bb9_1440w.webp\" alt=\"\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>mha-&gt;RTs<\/strong><\/h3>\n\n\n\n<p>\u5c06 mha \u8f6c\u6362\u4e3a RTs \u6587\u4ef6\u662f\u4e00\u4e2a\u6bd4\u8f83\u68d8\u624b\u7684\u95ee\u9898\uff0c\u4e00\u5f00\u59cb\u6211\u9884\u5907\u5728\u4e86\u89e3 RTs \u6587\u4ef6\u7684\u7ed3\u6784\u540e\uff0c\u624b\u52a8\u6784\u9020 RTs \u6587\u4ef6\uff0c\u4f46\u8003\u8651\u5230\u53ef\u9760\u6027\uff08\u6709\u53ef\u80fd\u4fe1\u606f\u8f6c\u6362\u4e0d\u5b8c\u5168\u6216\u517c\u5bb9\u6027\u4e0d\u591f\u597d\uff0c\u6bd5\u7adf\u533b\u5b66\u7684\u4e1c\u897f\u8c28\u614e\u4e00\u70b9\u66f4\u597d\uff09\uff0c\u6700\u7ec8\u6ca1\u6709\u91c7\u7528\u624b\u52a8\u6784\u9020\u7684\u65b9\u6cd5\uff0c\u800c\u662f\u4f7f\u7528\u4e86 plastimatch \u8fd9\u4e2a\u6bd4\u8f83\u6210\u719f\u7684\u8f6f\u4ef6\u6765\u8fdb\u884c\u3002\u4f46\u4e0d\u6392\u9664\u540e\u7eed\u4f7f\u7528\u81ea\u5df1\u5199\u7684\u4ee3\u7801\u6765\u5b8c\u6210\u8fd9\u4e2a\u6b65\u9aa4\u7684\u53ef\u80fd\u6027\u3002<\/p>\n\n\n\n<p>plastimatch \u63d0\u4f9b\u4e86 DICOM RT \u5bfc\u51fa\u529f\u80fd\uff0c\u652f\u6301\u4ece mha \u6587\u4ef6\u5bfc\u51fa RTs\uff0c\u540c\u65f6\u4e5f\u652f\u6301 nii \u5bfc\u51fa RTs\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>\u5728\u6211\u6210\u529f\u4ece mha \u5bfc\u51fa RTs \u540e\uff0c\u8bd5\u56fe\u7b80\u5316\u6b65\u9aa4\u76f4\u63a5\u4ece nii \u5230 RTs\uff0c\u4f46\u7ecf\u8fc7\u5c1d\u8bd5\u540e\u53d1\u73b0 nii \u5230 RTs \u7684\u7ed3\u679c\u4e0e mha \u5230 RTs \u5e76\u4e0d\u76f8\u540c\uff08\u5f88\u5947\u602a\uff09\uff0c\u4e14\u5e76\u4e0d\u6b63\u786e\uff0c\u540c\u65f6\uff0c\u4ece nii \u5230 RTs \u6240\u9700\u7684\u65f6\u95f4\u975e\u5e38\u4e45\uff0c\u5728\u4e94\u5206\u949f\u4ee5\u4e0a\uff0c\u800c\u4f7f\u7528 nii-&gt;mha-&gt;RTs \u8017\u65f6\u4e0d\u5230 30s<br>\u8fd9\u4e2a\u7ed3\u679c\u4ee4\u4eba\u8d39\u89e3\uff0cmha \u6587\u4ef6\u7684\u4fe1\u606f\u90fd\u662f\u4ece nii \u4e2d\u89e3\u6790\u5f97\u5230\uff0c\u5bfc\u51fa RTs \u6240\u4f7f\u7528\u7684\u53c2\u8003 dicom \u5e8f\u5217\u4e5f\u90fd\u76f8\u540c\uff0c\u5374\u5bfc\u5411\u4e86\u4e0d\u540c\u7684\u7ed3\u679c\u3002\u6211\u6700\u521d\u731c\u6d4b\u662f\u7531\u4e8e nii \u4e2d\u6570\u7ec4\u65b9\u5411\u53ef\u80fd\u6709\u95ee\u9898\uff0c\u4f46\u5728\u6211\u4fee\u6539\u65b9\u5411\u91cd\u5199 nii \u540e\u7ed3\u679c\u4f9d\u7136\u4e0d\u5bf9\u3002<\/p><\/blockquote>\n\n\n\n<p>\u90a3\u4e48\u5728\u5b89\u88c5 plastimatch \u540e\uff0c\u4f7f\u7528\u5982\u4e0b\u4e09\u6761\u6307\u4ee4\u5373\u53ef\u4f7f\u7528 mha \u751f\u6210 RTs\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>plastimatch adjust --input testmha.mha --pw-linear \"0,0,1,1,2,2,3,4,4,8,5,16\" --output TEMP-1.mha\nplastimatch convert --input TEMP-1.mha --output-img TEMP-2.mha --output-type uint32\nplastimatch convert --input-ss-img TEMP-2.mha input-ss-list structure_ref.txt --referenced-ct renference_files\/ --output-dicom DICOM-OUT<\/code><\/pre>\n\n\n\n<p>\u63a5\u4e0b\u6765\u89e3\u91ca\u4e00\u4e0b\u4e0a\u8ff0\u4e09\u6761\u6307\u4ee4\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>\u7b2c\u4e00\u6761\u6307\u4ee4\u7684\u76ee\u7684\u662f\u5c06 mha \u6587\u4ef6\u5b58\u50a8\u7684\u4f53\u7d20\u7684\u4fe1\u606f\u505a\u4e00\u4e2a\u53d8\u6362\uff0c\u9075\u5faa 0-&gt;0\uff0c1-&gt;1\uff0c2-&gt;2\uff0c3-&gt;4\uff0c4-&gt;8\uff0c\u4f9d\u6b21\u7c7b\u63a8\u3002\u5982\u679c\u4f60\u7684\u52fe\u753b\u7ed3\u679c\u5e76\u975e\u662f\u4ee5\u4f4d\u56fe\u65b9\u5f0f\u5b58\u50a8\uff08\u5373\u7b2c 0bit \u4e3a 1 \u8868\u793a\u8be5\u70b9\u4e3a\u7b2c 0 \u79cd\u7ed3\u6784\uff0c\u7b2c 1bit \u4e3a 1 \u8868\u793a\u8be5\u70b9\u4e3a\u7b2c 1 \u79cd\u7ed3\u6784\uff09\uff0c\u90a3\u4e48\u4f60\u5c31\u9700\u8981\u8fd9\u4e2a\u64cd\u4f5c\u5c06\u5176\u8f6c\u6362\u4e3a\u8be5\u683c\u5f0f\uff0c\u4ee5\u65b9\u4fbf\u540e\u7eed\u5904\u7406\u3002<\/li><li>\u7b2c\u4e8c\u6761\u6307\u4ee4\u7684\u76ee\u7684\u662f\u8f6c\u6362 mha \u6587\u4ef6\u4e2d\u7684\u4fe1\u606f\u4e3a uint32 \u5b58\u50a8\u3002<\/li><li>\u7b2c\u4e09\u6761\u6307\u4ee4\u751f\u6210 RTs \u6587\u4ef6\uff0c\u5176\u4e2d<code>input-ss-list structure_ref.txt<\/code>&nbsp;\u540e\u7eed\u9610\u8ff0\u3002<code>referenced-ct renference_files\/<\/code>&nbsp;\u6307\u5b9a\u8981\u53c2\u8003\u7684 DICOM \u5e8f\u5217\u6240\u5728\u7684\u6587\u4ef6\u5939\uff0c\u6700\u7ec8\u5c06\u5728&nbsp;<code>DICOM-OUT<\/code>&nbsp;\u76ee\u5f55\u4e0b\u751f\u6210 RTs \u6587\u4ef6\u3002<\/li><\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>structure_ref.txt<\/strong><\/h3>\n\n\n\n<p>\u8be5\u6587\u4ef6\u9075\u5faa\u4e0b\u8ff0\u683c\u5f0f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>0|0 255 0|Bladder\n1|0 0 255|Femoral_Head-L\n2|255 0 255|Femoral_Head-R\n3|0 255 255|Femur-L\n4|255 255 0|Femur-R\n5|122 122 122|Rectum<\/code><\/pre>\n\n\n\n<p>\u5728\u672a\u6307\u5b9a\u8be5\u6587\u4ef6\u65f6\uff0c\u751f\u6210\u7684 RTs \u6587\u4ef6\u4e2d\u7ed3\u6784\u540d\u662f\u6ca1\u6709\u6307\u5b9a\u7684\uff0c\u5c06\u4ee5 unknown structure \u7684\u540d\u5b57\u5448\u73b0\uff0c\u8fd9\u5bf9\u540e\u7eed\u533b\u751f\u7684\u64cd\u4f5c\u662f\u4e0d\u5229\u7684\uff0c\u56e0\u6b64\u9700\u8981\u6307\u5b9a\u4e0a\u8ff0\u6587\u4ef6\uff0c\u4ee5\u5f62\u6210 value-color-structure_name \u7684\u5bf9\u5e94\u5173\u7cfb\u3002\u6b64\u5904\u7684 value\uff0c\u5373 0\u30011\u30012&#8230;\u7b49\u503c\uff0c\u662f\u6307\u5bf9\u5e94 bit \u4f4d\u4e3a 1\u3002\u56e0\u6b64\u524d\u8ff0\u7b2c\u4e00\u6761\u6307\u4ee4\u7684\u8f6c\u6362\u64cd\u4f5c\u5c31\u662f\u4e0d\u53ef\u7f3a\u5c11\u7684\uff0c\u5c06\u666e\u901a\u7684\u503c\u8f6c\u6362\u4e3a\u5bf9\u5e94\u7684 bit \u4f4d\u4e3a 1 \u7684\u503c\uff0c\u624d\u80fd\u6b63\u786e\u6807\u8bc6\u7ed3\u6784\u540d\u5b57\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>others<\/strong><\/h2>\n\n\n\n<p>\u6b64\u5904\u5217\u51fa\u4e00\u4e9b\u53ef\u80fd\u6709\u7528\u7684\u5e93\uff1a<\/p>\n\n\n\n<p>SimpleITK\uff1a\u652f\u6301\u8f83\u591a\u683c\u5f0f\u7684\u6587\u4ef6\uff0c\u63d0\u4f9b\u4e86\u4e00\u4e9b\u5904\u7406\u56fe\u50cf\u5185\u5bb9\u7684\u64cd\u4f5c\u3002<\/p>\n\n\n\n<p>pydicom\uff1a\u63d0\u4f9b\u5bf9 DICOM \u6587\u4ef6\u8bfb\u5199\u3001\u4fee\u6539\u7684\u64cd\u4f5c\u3002<\/p>\n\n\n\n<p>itk\u3001vtk\uff1a\u524d\u8005\u63d0\u4f9b\u5904\u7406\uff0c\u540e\u8005\u63d0\u4f9b\u663e\u793a\uff0c\u662f\u533b\u5b66\u5f71\u50cf\u5904\u7406\u4e2d\u5e38\u7528\u7684\u5e93\u3002<\/p>\n\n\n\n<p>dicom2nifti\uff1adicom \u6587\u4ef6\u8f6c nii \u6587\u4ef6\u7b49\u64cd\u4f5c\u3002<\/p>\n\n\n\n<p>gdcm2vtk\uff1a\u63d0\u4f9b vtk \u652f\u6301\u7684\u683c\u5f0f\u6587\u4ef6\u8f6c\u6362 dicom \u6587\u4ef6\u7b49\u64cd\u4f5c\u3002<\/p>\n\n\n\n<p>\u6b64\u5916\u8fd8\u6709 gdcm\u3001dcmtk \u7b49\u5e93\u5c1a\u672a\u8be6\u770b\u3002<\/p>\n\n\n\n<p>plastimatch \u8fd9\u4e2a\u8f6f\u4ef6\u4e5f\u63d0\u4f9b\u4e86\u5f88\u4e30\u5bcc\u7684\u529f\u80fd\uff0c\u6700\u91cd\u8981\u7684\u662f\u5728\u5b83\u7684 mail list \u4e2d\uff0c\u5f00\u53d1\u8005\u4f1a\u56de\u590d\u4f7f\u7528\u76f8\u5173\u95ee\u9898\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Segmentation to &#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":1419,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[31],"class_list":["post-1446","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-4","tag-31"],"_links":{"self":[{"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/posts\/1446","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/comments?post=1446"}],"version-history":[{"count":0,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/posts\/1446\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/media?parent=1446"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/categories?post=1446"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/tags?post=1446"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}