\u30de\u30b9\u30af\u753b\u50cf\u306b\u9818\u57df\u3092\u63cf\u51fa<\/li>\n<\/ul>\n\n\n\n\u3068\u3044\u3063\u305f\u6d41\u308c\u306b\u306a\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n
\u4e0a\u8a18\u30b3\u30fc\u30c9\u3067<\/p>\n\n\n\n
DICOM\u753b\u50cf\u306e\u8868\u793a\u306fmain\u95a2\u6570\u5185<\/p>\n\n\n\n
DICOM\u753b\u50cf\u3067\u9818\u57df\u62bd\u51fa\u306f\u300con_motion\u300d\u95a2\u6570<\/p>\n\n\n\n
\u30de\u30b9\u30af\u753b\u50cf\u306b\u9818\u57df\u3092\u63cf\u51fa\u306f\u300con_button_release\u300d\u95a2\u6570<\/p>\n\n\n\n
\u3067\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n
<\/p>\n\n\n\n
\u9818\u57df\u62bd\u51fa<\/h2>\n\n\n\n
\u9818\u57df\u62bd\u51fa\u306f\u3001DICOM\u753b\u50cf\u4e0a\u3067\u62bd\u51fa\u3059\u308b\u9818\u57df\u3092\u306a\u305e\u3063\u3066\u3044\u304f\u3053\u3068\u3067\u305d\u306e\u5ea7\u6a19\u3092\u3001\u30ea\u30b9\u30c8\u306b\u767b\u9332\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n
\u3053\u3053\u3067\u306f\u3001numpy\u306e\u914d\u5217\u3068\u3057\u3066\u3067\u306f\u306a\u304f\u3001\u30ea\u30b9\u30c8\u3068\u3057\u3066\u6271\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n
numpy\u914d\u5217\u3068\u3057\u3066\u3001\uff12\u6b21\u5143\u30c7\u30fc\u30bf\u306b\uff12\u6b21\u5143\u30c7\u30fc\u30bf\u3092\u3072\u3068\u3064\u3065\u3064\u8ffd\u52a0\u3057\u3066\u3044\u3053\u3046\u3068\u3059\u308b\u3068\u3061\u3087\u3063\u3068\u5384\u4ecb\u306a\u3053\u3068\u304c\u8d77\u3053\u308b\u306e\u3067\u3002\u3002\u3002\u3002\u3002\uff08\u8a73\u7d30\u306f\u3044\u3064\u304b\u8a18\u4e8b\u306b\u3057\u305f\u3044\u3068\u601d\u3063\u3066\u3044\u307e\u3059\uff09<\/p>\n\n\n\n
\u30ea\u30b9\u30c8\u3068\u3057\u3066\u6271\u3063\u3066\u3044\u3051\u3070\u3001\u7d14\u7c8b\u306bappend\u3067\u8ffd\u52a0\u3057\u3066\u3044\u3051\u307e\u3059\u3002<\/p>\n\n\n\n
\u8ffd\u52a0\u3059\u308b\u969b\u306b\u3001\u6574\u6570\u578b\u3068\u3057\u3066\u8ffd\u52a0\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n
contour.append([int(event.xdata), int(event.ydata)])<\/p>\n\n\n\n
<\/p>\n\n\n\n
\u307e\u305f\u3001\u306a\u305e\u3063\u305f\u4f4d\u7f6e\u3092DICOM\u753b\u50cf\u4e0a\u306b\u8868\u793a\u3057\u3066\u304a\u304d\u305f\u3044\u306e\u3067<\/p>\n\n\n\n
ax1.add_patch(Circle((event.xdata, event.ydata), 0.1, color=’r’))<\/p>\n\n\n\n
\u3067\u753b\u50cf\u4e0a\u306b\u30d7\u30ed\u30c3\u30c8\u3057\u3066<\/p>\n\n\n\n
fig.canvas.draw()<\/p>\n\n\n\n
\u3067\u753b\u50cf\u3092\u518d\u63cf\u51fa\u3057\u3066\u3044\u307e\u3059\u3002
<\/p>\n\n\n\n
\u30de\u30b9\u30af\u753b\u50cf\u306b\u9818\u57df\u3092\u63cf\u51fa\u3000cv2.fillConvexPoly<\/h2>\n\n\n\n
\u306a\u305e\u3063\u305f\u5ea7\u6a19\u306e\u30ea\u30b9\u30c8\u3092\u5225\u306e\u753b\u50cf\u4e0a\u306b\u63cf\u51fa\u3057\u307e\u3059\u3002<\/p>\n\n\n\n
\u4e0a\u8a18\u30b3\u30fc\u30c9\u306e\uff13\uff12\u884c\u76ee<\/p>\n\n\n\n
mask = np.zeros_like(img, dtype=np.uint8)<\/p>\n\n\n\n
\u3067\u30de\u30b9\u30af\u753b\u50cf\u7528\u306e\u914d\u5217\u3092\u30c7\u30fc\u30bf\uff10\u3067\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n
\u914d\u5217\u306e\u578b\u306f\u3001\u30de\u30a4\u30ca\u30b9\u30c7\u30fc\u30bf\u306a\u3057\u306e8bit\u753b\u50cf\u3067\u3059\u3002\u306a\u306e\u3067\u968e\u8abf\u306f\uff10\uff5e\uff12\uff15\uff15\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n
\u5148\u307b\u3069\u306a\u305e\u3063\u3066\u767b\u9332\u3057\u305f\u30ea\u30b9\u30c8\u3092mask\u4e0a\u306b\u63cf\u51fa\u3057\u307e\u3059\u3002<\/p>\n\n\n\n
\u3053\u306e\u6a5f\u80fd\u306f\u3001openCV\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n\n\n\n
cv2.fillConvexPoly(mask, np.array(contour), color=255, lineType=cv2.LINE_AA)<\/p>\n\n\n\n
\u3053\u306e\u95a2\u6570\u306f\u77e9\u5f62\u3092\u63cf\u51fa\u3057\u3001\u305d\u306e\u4e2d\u3092\u5857\u308a\u3064\u3076\u3057\u307e\u3059\u3002<\/p>\n\n\n\n
\u3053\u3053\u3067\u5148\u307b\u3069\u306e\u5ea7\u6a19\u30c7\u30fc\u30bf\u3092\u4f7f\u3046\u306e\u3067\u3059\u304c\u3001\u53d7\u3051\u308b\u30c7\u30fc\u30bf\u306fnumpy\u914d\u5217\u3067\u6574\u6570\u578b\u3057\u304b\u53d7\u3051\u3066\u304f\u308c\u307e\u305b\u3093\u3002<\/p>\n\n\n\n
\u306a\u306e\u3067\u3001\u30ea\u30b9\u30c8\u306b\u767b\u9332\u3059\u308b\u969b\u306bint\u578b\u3092\u6307\u5b9a\u3057\u3066\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n
\u305d\u306e\u30ea\u30b9\u30c8\u3092numpy\u914d\u5217\u306b\u5909\u63db\u3059\u308b\u306e\u306f<\/p>\n\n\n\n
np.array(contour)<\/p>\n\n\n\n
\u3068\u3057\u3066\u3042\u3052\u308b\u3060\u3051\u3067numpy\u914d\u5217\u3068\u3057\u3066\u6271\u3063\u3066\u304f\u308c\u307e\u3059\u3002\u975e\u5e38\u306b\u4fbf\u5229\u3067\u3059\u3002<\/p>\n\n\n\n
\u3067\u3001\uff13\u756a\u76ee\u306e\u5f15\u6570\u3067\uff12\uff15\uff15\u306e\u5024\u3092\u6307\u5b9a\u3057\u3066\u3042\u3052\u307e\u3059\u3002\u3082\u3057\u3001\uff32\uff27\uff22\u3067\u6307\u5b9a\u3059\u308b\u306e\u3067\u3042\u308c\u3070\uff080\uff0c0\uff0c0\uff09\u7b49\u3067\u6307\u5b9a\u3057\u3066\u3042\u3052\u308c\u3070\u5927\u4e08\u592b\u3067\u3059\u3002\u305f\u3060\u3001\u305d\u306e\u969b\u306b\u306fmask\u914d\u5217\u4f5c\u6210\u6642\u306b\uff32\uff27\uff22\u3068\u3057\u3066\u914d\u5217\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u3092\u5fd8\u308c\u306a\u3044\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n
\u3053\u308c\u3067\u3001\u5148\u307b\u3069\u306a\u305e\u3063\u305f\u5ea7\u6a19\u5185\u3092\uff12\uff15\uff15\u306e\u5024\u3068\u3057\u3066\u767b\u9332\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3057\u305f\u3002<\/p>\n\n\n\n
\u5f8c\u306f\u3001\u753b\u50cf\u8868\u793a\u3057\u3066\u78ba\u8a8d\u3067\u3059\u3002<\/p>\n\n\n\n
<\/p>\n\n\n\n
\u3055\u3044\u3054\u306b<\/h2>\n\n\n\n
\u3044\u304b\u304c\u3067\u3059\u304b\uff1f\u3053\u306e\u30b3\u30fc\u30c9\u3060\u3051\u3067\u306f\u4f55\u679a\u3082\u306e\u6559\u5e2b\u753b\u50cf\u3092\u4f5c\u6210\u3059\u308b\u306e\u306f\u5927\u5909\u3067\u3059\u304c\u3001\u6839\u5e79\u3068\u306a\u308b\u30b3\u30fc\u30c9\u306f\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n\n\n\n
\u3053\u306e\u30b3\u30fc\u30c9\u304c\u3069\u306a\u305f\u304b\u306e\u5f79\u306b\u7acb\u3066\u3070\u5e78\u3044\u3067\u3059\u3002<\/p>\n\n\n\n
<\/p>\n\n\n\n
<\/p>\n\n\n\n
<\/p>\n","protected":false},"excerpt":{"rendered":"
\u6df1\u5c64\u5b66\u7fd2\u3092\u3084\u3063\u3066\u307f\u3088\u3046\u3068\u601d\u3063\u305f\u6642\u306b\u3001\u3084\u306f\u308a\u5b66\u7fd2\u30c7\u30fc […]<\/p>\n","protected":false},"author":1,"featured_media":363,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[18,85,6,4],"tags":[45,7,230,229,156,96],"class_list":["post-1884","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-matplotlib","category-numpy","category-opencv","category-python","tag-opencv","tag-python","tag-230","tag-229","tag-156","tag-96"],"aioseo_notices":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/radiology-technologist.info\/wp-content\/uploads\/2019\/11\/python_logo.png?fit=614%2C612","_links":{"self":[{"href":"http:\/\/radiology-technologist.info\/wp-json\/wp\/v2\/posts\/1884","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/radiology-technologist.info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/radiology-technologist.info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/radiology-technologist.info\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/radiology-technologist.info\/wp-json\/wp\/v2\/comments?post=1884"}],"version-history":[{"count":6,"href":"http:\/\/radiology-technologist.info\/wp-json\/wp\/v2\/posts\/1884\/revisions"}],"predecessor-version":[{"id":1891,"href":"http:\/\/radiology-technologist.info\/wp-json\/wp\/v2\/posts\/1884\/revisions\/1891"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/radiology-technologist.info\/wp-json\/wp\/v2\/media\/363"}],"wp:attachment":[{"href":"http:\/\/radiology-technologist.info\/wp-json\/wp\/v2\/media?parent=1884"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/radiology-technologist.info\/wp-json\/wp\/v2\/categories?post=1884"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/radiology-technologist.info\/wp-json\/wp\/v2\/tags?post=1884"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}