Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the all-in-one-seo-pack domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /virtual/mcu03iphuk/public_html/radiology-technologist.info/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the easy-fancybox domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /virtual/mcu03iphuk/public_html/radiology-technologist.info/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the urvanov-syntax-highlighter domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /virtual/mcu03iphuk/public_html/radiology-technologist.info/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the breadcrumb-navxt domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /virtual/mcu03iphuk/public_html/radiology-technologist.info/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the advanced-ads domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /virtual/mcu03iphuk/public_html/radiology-technologist.info/wp-includes/functions.php on line 6114

Notice: 関数 _load_textdomain_just_in_time が誤って呼び出されました。lancr ドメインの翻訳の読み込みが早すぎました。これは通常、プラグインまたはテーマの一部のコードが早すぎるタイミングで実行されていることを示しています。翻訳は init アクション以降で読み込む必要があります。 詳しくは WordPress のデバッグをご覧ください。 (このメッセージはバージョン 6.7.0 で追加されました) in /virtual/mcu03iphuk/public_html/radiology-technologist.info/wp-includes/functions.php on line 6114

Warning: Cannot modify header information - headers already sent by (output started at /virtual/mcu03iphuk/public_html/radiology-technologist.info/wp-includes/functions.php:6114) in /virtual/mcu03iphuk/public_html/radiology-technologist.info/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /virtual/mcu03iphuk/public_html/radiology-technologist.info/wp-includes/functions.php:6114) in /virtual/mcu03iphuk/public_html/radiology-technologist.info/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /virtual/mcu03iphuk/public_html/radiology-technologist.info/wp-includes/functions.php:6114) in /virtual/mcu03iphuk/public_html/radiology-technologist.info/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /virtual/mcu03iphuk/public_html/radiology-technologist.info/wp-includes/functions.php:6114) in /virtual/mcu03iphuk/public_html/radiology-technologist.info/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /virtual/mcu03iphuk/public_html/radiology-technologist.info/wp-includes/functions.php:6114) in /virtual/mcu03iphuk/public_html/radiology-technologist.info/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /virtual/mcu03iphuk/public_html/radiology-technologist.info/wp-includes/functions.php:6114) in /virtual/mcu03iphuk/public_html/radiology-technologist.info/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /virtual/mcu03iphuk/public_html/radiology-technologist.info/wp-includes/functions.php:6114) in /virtual/mcu03iphuk/public_html/radiology-technologist.info/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /virtual/mcu03iphuk/public_html/radiology-technologist.info/wp-includes/functions.php:6114) in /virtual/mcu03iphuk/public_html/radiology-technologist.info/wp-includes/rest-api/class-wp-rest-server.php on line 1893
{"id":413,"date":"2020-04-22T11:57:22","date_gmt":"2020-04-22T02:57:22","guid":{"rendered":"http:\/\/radiology-technologist.info\/?p=413"},"modified":"2020-04-22T11:57:30","modified_gmt":"2020-04-22T02:57:30","slug":"post-413","status":"publish","type":"post","link":"http:\/\/radiology-technologist.info\/post-413","title":{"rendered":"DICOM\u753b\u50cf\u304b\u3089jpg\u3001png\u7b49\u306e\u6c4e\u7528\u753b\u50cf\u306b\u5909\u66f4"},"content":{"rendered":"\n

\u524d\u56de\u3001OpenCV\u3092\u7528\u3044\u3066\u30de\u30a6\u30b9\u30db\u30a4\u30fc\u30eb\u3092\u4f7f\u3063\u3066\u753b\u50cf\u3092\u5207\u308a\u66ff\u3048\u308b\u3068\u3044\u3063\u305f\u8a18\u4e8b\u3092\u66f8\u304d\u307e\u3057\u305f\u3002\u3057\u304b\u3057\u3001\u305d\u306e\u307e\u307e\u3067\u306f\u3064\u307e\u3089\u306a\u3044\u306e\u3067\u3001DICOM\u753b\u50cf\u3092jpeg,png\u3068\u3044\u3063\u305f\u6c4e\u7528\u753b\u50cf\u3068\u3057\u3066\u4fdd\u5b58\u3059\u308b\u65b9\u6cd5\u3092\u8a18\u8f09\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n


<\/p>\n\n\n\n

\u624b\u9806<\/h2>\n\n\n\n

\u624b\u9806\u3068\u3057\u3066\u306f\u3001<\/p>\n\n\n\n

  1. DICOM\u753b\u50cf\u3092\u8aad\u307f\u8fbc\u307f<\/li>
  2. \u30d4\u30af\u30bb\u30eb\u30c7\u30fc\u30bf\u3092\u914d\u5217\u3068\u3057\u3066\u8aad\u307f\u8fbc\u307f<\/li>
  3. \uff57\uff57\u3001\uff57\uff4c\u3067\u6700\u9069\u306a\u6761\u4ef6\u306b\u5408\u308f\u305b\u308b<\/li>
  4. \u305d\u306e\u914d\u5217\u3092\uff57\uff57\u3001\uff57\uff4c\u306e\u7bc4\u56f2\u306b\u843d\u3068\u3057\u8fbc\u3080<\/li>
  5. \u6c4e\u7528\u753b\u50cf\u3068\u3057\u3066\u4fdd\u5b58<\/li><\/ol>\n\n\n\n

    \u306e\u624b\u9806\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n

    \u305f\u3060\u3001\u524d\u56de\u307e\u3067\u306e\u8a18\u4e8b\u3067\uff11\uff5e\uff14\u307e\u3067\u306e\u4f5c\u696d\u306f\u5b8c\u4e86\u3057\u3044\u308b\u306e\u3067\u6b8b\u308a\uff15\u756a\u306e\u4f5c\u696d\u3068\u306a\u308a\u307e\u3059\u3002\uff08\u524d\u56de\u306e\u30b3\u30fc\u30c9\u306f\u4e0b\u306e\u30ea\u30f3\u30af\u304b\u3089\uff09<\/p>\n\n\n\n

    \nhttp:\/\/radiology-technologist.info\/2020\/04\/17\/post-501\/\n<\/div><\/figure>\n\n\n\n

    \u305d\u308c\u3067\u306f\u30015\u756a\u306e\u4f5c\u696d\u3092\u3055\u3089\u306b\u7d30\u304b\u304f\u5206\u3051\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n

    1. \u4f55\u3092\u304d\u3063\u304b\u3051\u306b\u753b\u50cf\u4fdd\u5b58\u3092\u3059\u308b\u304b\uff1f<\/li>
    2. \u4fdd\u5b58\u5148\u306e\u6307\u5b9a\u306f\uff1f<\/li>
    3. \u30d5\u30a1\u30a4\u30eb\u540d\u306f\uff1f<\/li>
    4. \u753b\u50cf\u5f62\u5f0f\u306f\u4f55\u306b\u3059\u308b\u304b\uff1f<\/li>
    5. \u30b3\u30fc\u30c9\u3092\u4f5c\u6210<\/li><\/ol>\n\n\n\n

      \u305d\u308c\u3067\u306f\u3001\u305d\u308c\u305e\u308c\u6c7a\u3081\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n


      <\/p>\n\n\n\n

      \u4f55\u3092\u304d\u3063\u304b\u3051\u306b\u753b\u50cf\u4fdd\u5b58\u3092\u3059\u308b\uff1f<\/h3>\n\n\n\n

      \u307e\u305a\u306f\u3001\u4f55\u3092\u304d\u3063\u304b\u3051\u306b\u753b\u50cf\u4fdd\u5b58\u3092\u3059\u308b\u304b\uff1f<\/p>\n\n\n\n

      \u305b\u3063\u304b\u304f\u524d\u56de\u30de\u30a6\u30b9\u30a4\u30d9\u30f3\u30c8\u3067\u4f5c\u696d\u3092\u3057\u305f\u306e\u3067\u4eca\u56de\u3082\u30de\u30a6\u30b9\u30a4\u30d9\u30f3\u30c8\u3067\u753b\u50cf\u4fdd\u5b58\u3059\u308b\u65b9\u6cd5\u3092\u3084\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n

      \u53f3\u30af\u30ea\u30c3\u30af\u3092\u62bc\u3057\u305f\u6642\u306b\u3001\u753b\u50cf\u4fdd\u5b58\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002\uff08\u904e\u53bb\u306e\u30de\u30a6\u30b9\u30a4\u30d9\u30f3\u30c8\u306e\u8a18\u4e8b\u306f\u3053\u3061\u3089<\/a>\uff09<\/p>\n\n\n\n

      \nhttp:\/\/radiology-technologist.info\/2019\/11\/18\/post-306\/\n<\/div><\/figure>\n\n\n\n

      \u53f3\u30af\u30ea\u30c3\u30af\u3092\u62bc\u3057\u305f\u6642\u306e\u6307\u5b9a\u306f<\/p>\n\n\n\n

      if event == cv2.EVENT_RBUTTONDOWN:<\/p>\n\n\n\n

      \u3067\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n

      \u524d\u56de\u306e\u30de\u30a6\u30b9\u30db\u30a4\u30fc\u30eb\u3092\u56de\u3057\u305f\u6642\u306e\u95a2\u6570\u306e\u5f8c\u306b\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n\n\n\n

      \u30a4\u30f3\u30c7\u30f3\u30c8\u306e\u4f4d\u7f6e\u306f<\/p>\n\n\n\n

      if event == cv2.EVENT_MOUSEWHEEL:<\/p>\n\n\n\n

      \u3068\u540c\u3058\u4f4d\u7f6e\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n


      <\/p>\n\n\n\n

      \u4fdd\u5b58\u5148\u306e\u6307\u5b9a\u306f\uff1f<\/h3>\n\n\n\n

      \u65b0\u3057\u304f\u4f5c\u6210\u3059\u308b\u753b\u50cf\u306e\u4fdd\u5b58\u5148\u306e\u6307\u5b9a\u306f\u3069\u306e\u3088\u3046\u306b\u3059\u308b\u304b\uff1f<\/p>\n\n\n\n

      \u305d\u308c\u306f\u30e6\u30fc\u30b6\u30fc\u304c\u6307\u5b9a\u3067\u304d\u308b\u3088\u3046\u306b\u7d44\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n

      \u53f3\u30af\u30ea\u30c3\u30af\u3092\u62bc\u3057\u305f\u6642\u306b\u3001\u30d5\u30a1\u30a4\u30eb\u30c0\u30a4\u30a2\u30ed\u30b0\u304c\u958b\u3044\u3066\u753b\u50cf\u306e\u4fdd\u5b58\u30d5\u30a9\u30eb\u30c0\u3092\u6307\u5b9a\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n

      \u3053\u308c\u3082\u4ee5\u524d\u3001\u8a18\u4e8b\u3067\u66f8\u3044\u305f\u30d5\u30a9\u30eb\u30c0\u9078\u629e\u3067\u3084\u3063\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n

      \nhttp:\/\/radiology-technologist.info\/2019\/12\/21\/post-371\/\n<\/div><\/figure>\n\n\n\n

      \u4ee5\u524d\u306e\u8a18\u4e8b\u3067\u306f\u3001\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u30d5\u30a1\u30a4\u30eb\u5168\u90e8\u3092\u9078\u629e\u3059\u308b\u5f62\u3068\u306a\u3063\u3066\u3044\u305f\u306e\u3067\u5c11\u3057\u305d\u3053\u3092\u4fee\u6b63\u3001\u8ffd\u52a0\u3057\u3066\u4f7f\u3044\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002\u524d\u56de\u306e\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n

      \n# -*- coding: utf-8 -*-\n\nimport tkinter  \nfrom tkinter import filedialog as tkFileDialog\nimport glob\n\n#\u30d5\u30a1\u30a4\u30eb\u3092\u4e00\u3064\u9078\u629e::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::\ndef single_fileselect():\n    root = tkinter.Tk()\n    root.withdraw()\n\n    fTyp = [('', '*')]\n\n    iDir = 'C:\/Desktop'\n\n    filename = tkFileDialog.askopenfilename(filetypes=fTyp, initialdir=iDir)\n    return filename\n\n#\u30d5\u30a1\u30a4\u30eb\u3092\u8907\u6570\u9078\u629e:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::\ndef multi_fileselect():\n    root = tkinter.Tk()\n    root.withdraw()\n\n    fTyp = [('', '*')]\n    iDir = 'C:\/Desktop'\n\n    filenames = tkFileDialog.askopenfilenames(filetypes=fTyp, initialdir=iDir)\n\n    return filenames\n\n#\u30d5\u30a1\u30a4\u30eb\u3092\u30d5\u30a9\u30eb\u30c0\u3067\u4e00\u62ec\u9078\u629e:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::\ndef folder_fileselect():\n    root = tkinter.Tk()  \n    root.withdraw()  \n\n    iDir = 'C:\/Desktop'  \n\n    dirname = tkFileDialog.askdirectory(initialdir=iDir)\n\n    filenames = glob.glob(dirname +\"\/*\")\n    return filenames\n<\/code><\/pre>\n\n\n\n

      \u30d5\u30a9\u30eb\u30c0\u3060\u3051\u9078\u629e\u3067\u304d\u308c\u3070\u3044\u3044\u306e\u3067<\/p>\n\n\n\n

      #\u30d5\u30a1\u30a4\u30eb\u3092\u30d5\u30a9\u30eb\u30c0\u3067\u4e00\u62ec\u9078\u629e\u306e\u4e0b\u304b\u30892\u6bb5\u76ee<\/p>\n\n\n\n

      filenames = glob.glob(dirname +”\/*”)<\/p>\n\n\n\n

      \u3092\u524a\u9664\u3059\u308c\u3070\u30d5\u30a9\u30eb\u30c0\u306e\u30d1\u30b9\u306e\u307f\u53d6\u5f97\u3067\u304d\u307e\u3059\u306e\u3067<\/p>\n\n\n\n

      \u95a2\u6570\u540d\u3000folder\u3000\u3068\u3057\u3066\u4f5c\u6210\u3057\u3066\u3057\u307e\u3044\u307e\u3057\u3087\u3046<\/p>\n\n\n\n

      \n# -*- coding: utf-8 -*-\n\nimport tkinter  \nfrom tkinter import filedialog as tkFileDialog\nimport glob\n\n#\u30d5\u30a1\u30a4\u30eb\u3092\u4e00\u3064\u9078\u629e::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::\ndef single_fileselect():\n    root = tkinter.Tk()\n    root.withdraw()\n\n    fTyp = [('', '*')]\n\n    iDir = 'C:\/Desktop'\n\n    filename = tkFileDialog.askopenfilename(filetypes=fTyp, initialdir=iDir)\n    return filename\n\n#\u30d5\u30a1\u30a4\u30eb\u3092\u8907\u6570\u9078\u629e:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::\ndef multi_fileselect():\n    root = tkinter.Tk()\n    root.withdraw()\n\n    fTyp = [('', '*')]\n    iDir = 'C:\/Desktop'\n\n    filenames = tkFileDialog.askopenfilenames(filetypes=fTyp, initialdir=iDir)\n\n    return filenames\n\n#\u30d5\u30a1\u30a4\u30eb\u3092\u30d5\u30a9\u30eb\u30c0\u3067\u4e00\u62ec\u9078\u629e:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::\ndef folder_fileselect():\n    root = tkinter.Tk()  \n    root.withdraw()  \n\n    iDir = 'C:\/Desktop'  \n\n    dirname = tkFileDialog.askdirectory(initialdir=iDir)\n\n    filenames = glob.glob(dirname +\"\/*\")\n    return filenames\n\n#\u30d5\u30a9\u30eb\u30c0\u3092\u9078\u629e:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::\ndef folder():\n    root = tkinter.Tk()  \n    root.withdraw()  \n\n    iDir = 'C:\/Desktop'  \n\n    dirname = tkFileDialog.askdirectory(initialdir=iDir)\n\n    return filenames\n\n<\/code><\/pre>\n\n\n\n

      \u3053\u306e\u95a2\u6570\u3092\u547c\u3073\u51fa\u3059\u3053\u3068\u3067\u30d5\u30a9\u30eb\u30c0\u306e\u6307\u5b9a\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n

      \u30d5\u30a9\u30eb\u30c0\u30d1\u30b9\u306ffol\u3068\u3044\u3046\u5909\u6570\u540d\u3067\u53d7\u3051\u53d6\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n

      if event == cv2.EVENT_RBUTTONDOWN:<\/p>\n\n\n\n

      \u306e\u5f8c\u306b<\/p>\n\n\n\n

      fol = fs.folder()<\/p>\n\n\n\n

      \u3068\u3059\u308b\u3053\u3068\u3067fol\u306e\u5909\u6570\u5185\u306b\u6307\u5b9a\u3057\u305f\u30d5\u30a9\u30eb\u30c0\u30d1\u30b9\u3092\u5165\u308c\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n


      <\/p>\n\n\n\n

      \u30d5\u30a1\u30a4\u30eb\u540d\u306f\uff1f<\/h3>\n\n\n\n

      \u30d5\u30a1\u30a4\u30eb\u540d\u3067\u3059\u304c\u3001DICOM\u753b\u50cf\u3068\u540c\u3058\u540d\u524d\u3067\u4fdd\u5b58\u3059\u308b\u65b9\u6cd5\u3068\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n

      \u30d5\u30a1\u30a4\u30eb\u9078\u629e\u3057\u305f\u30d1\u30b9\u304b\u3089\u30d5\u30a1\u30a4\u30eb\u540d\u3060\u3051\u3092\u62bd\u51fa\u3059\u308b\u65b9\u6cd5\u306f\u4ee5\u4e0b\u306e\u8a18\u4e8b\u306b\u8a18\u8f09\u3057\u3066\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n

      \nhttp:\/\/radiology-technologist.info\/2020\/01\/28\/post-417\/\n<\/div><\/figure>\n\n\n\n

      .rfind(“\/”)<\/p>\n\n\n\n

      \u3067\u6700\u5f8c\u304b\u3089\u6570\u3048\u3066 “\/” \u304c\u4f55\u6587\u5b57\u76ee\u306b\u3042\u308b\u304b\u3092\u8abf\u3079\u307e\u3059\u3002<\/p>\n\n\n\n

      \u305d\u3057\u3066\u305d\u306e\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\u304b\u3089\u3001\u305d\u306e\u6587\u5b57\u5206\u3060\u3051\u5207\u308a\u629c\u3044\u3066\u3042\u3052\u3001\u5148\u307b\u3069\u9078\u629e\u3057\u305f\u30d5\u30a9\u30eb\u30c0\u306e\u5f8c\u308d\u306b\u3064\u3051\u3066\u3042\u3052\u308c\u3070\u3044\u3044\u308f\u3051\u3067\u3059\u3002<\/p>\n\n\n\n

      \u5909\u6570cou\u3068\u3057\u3066\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u540d\u306e\u524d\u306b\u3042\u308b”\/”\u307e\u3067\u306e\u6587\u5b57\u6570\u3092\u5165\u308c\u307e\u3059\u3002<\/p>\n\n\n\n

      cou = filenames[i].rfind(“\/”)<\/p>\n\n\n\n

      \uff08\u306a\u304a\u3001[i]\u306f\u5f8c\u3067for\u6587\u306e\u4e2d\u3067\u3053\u306e\u30b3\u30fc\u30c9\u3092\u4f7f\u3046\u306e\u3067\u5165\u308c\u3066\u3044\u307e\u3059\u3002\uff09<\/p>\n\n\n\n

      \u305d\u306e\u6570\u5b57\u6587\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\u304b\u3089\u629c\u304d\u51fa\u305b\u3070\u3044\u3044\u306e\u3067<\/p>\n\n\n\n

      filenames[i][cou:]<\/p>\n\n\n\n

      \u3053\u308c\u3067\u3001\u30d5\u30a1\u30a4\u30eb\u540d\u306e\u629c\u304d\u51fa\u3057\u304c\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n\n\n\n


      <\/p>\n\n\n\n

      \u753b\u50cf\u5f62\u5f0f\u306f\u4f55\u306b\u3059\u308b\u304b\uff1f<\/h3>\n\n\n\n

      \u753b\u50cf\u5f62\u5f0f\u306f\u3001jpg,png,bmp,tiff\u3069\u306e\u5f62\u5f0f\u306b\u3059\u308b\u304b\u6c7a\u307e\u3063\u305f\u3089\u3001\u4fdd\u5b58\u3059\u308b\u6642\u3001\u30d1\u30b9\u306e\u6700\u5f8c\u306b\u4ed8\u3051\u3066\u3042\u3052\u308c\u3070\u3044\u3044\u3060\u3051\u3067\u3059\u3002<\/p>\n\n\n\n

      \u306a\u306e\u3067<\/p>\n\n\n\n

      “.jpg” “.png” “.bmp” “.tiff”<\/p>\n\n\n\n

      \u3053\u308c\u3060\u3051\u3067\u3001\u753b\u50cf\u5f62\u5f0f\u306e\u6307\u5b9a\u304c\u7d42\u308f\u308a\u3067\u3059\u3002<\/p>\n\n\n\n


      <\/p>\n\n\n\n

      <\/p>\n\n\n\n

      \u753b\u50cf\u4fdd\u5b58<\/h3>\n\n\n\n

      \u6b21\u306f\u3001\u753b\u50cf\u3092\u4fdd\u5b58\u3057\u3066\u3044\u304f\u5de5\u7a0b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n

      cv2.imwrite(\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9,\u30c7\u30fc\u30bf)<\/p>\n\n\n\n

      \u306e\u30b3\u30fc\u30c9\u3067\u884c\u3044\u307e\u3059\u3002<\/p>\n\n\n\n

      \u307e\u305a\u306f\u4fdd\u5b58\u5148\u306e\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n\n\n\n

      \u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\u306f\u3001\u753b\u50cf\u4fdd\u5b58\u306e\u30d5\u30a9\u30eb\u30c0\u306b\u30d5\u30a1\u30a4\u30eb\u540d\u3001\u62e1\u5f35\u5b50\u3092\u4ed8\u3051\u3066\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n\n\n\n

      \u4fdd\u5b58\u30d5\u30a9\u30eb\u30c0\u306ffol\u306e\u5909\u6570\u540d\u3067\u53d6\u5f97\u3057\u307e\u3057\u305f\u306d\u3002<\/p>\n\n\n\n

      \u6b21\u306b\u30d5\u30a1\u30a4\u30eb\u540d\u306f<\/p>\n\n\n\n

      cou = filenames[i].rfind(“\/”)<\/p>\n\n\n\n

      filenames[i][cou:]<\/p>\n\n\n\n

      \u306e2\u6587\u3067\u629c\u304d\u51fa\u3057\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n\n\n\n

      \u753b\u50cf\u5f62\u5f0f\u306fjpeg\u3068\u3057\u307e\u3059\u3068”.jpg”\u3068\u306a\u308a\u307e\u3059\u306e\u3067<\/p>\n\n\n\n

      \u30d5\u30a1\u30a4\u30eb\u30d1\u30b9fname\u306f<\/p>\n\n\n\n

      fname = fol + filenames[i][cou:] + “.jpg”<\/p>\n\n\n\n

      \u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n

      \u753b\u50cf\u30c7\u30fc\u30bf\u306fdcm_copy\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n

      <\/p>\n\n\n\n

      \u5f8c\u306ffor\u6587\u306e\u4e2d\u306b\u4e0a\u306e\u30b3\u30fc\u30c9\u3092\u5165\u308c\u3066\u3042\u3052\u308c\u3070\u3044\u3044\u306e\u3067\u3001\u30de\u30a6\u30b9\u30a4\u30d9\u30f3\u30c8\u306e\u6587\u3082\u5408\u308f\u305b\u308b\u3068<\/p>\n\n\n\n

      \nif event == cv2.EVENT_RBUTTONDOWN:\n\tfol = fs.folder()\n\n\tfor i in range(len(dcm_copy)):\n\n\t\tcou = filenames[i].rfind(\"\/\")\n\t\tfname = fol + filenames[i][cou:] + \".jpg\"\n\n\t\tcv2.imwrite(fname,dcm_copy[i])\n<\/code><\/pre>\n\n\n\n

      \u3053\u308c\u3067\u30b3\u30fc\u30c9\u306f\u5b8c\u6210\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n


      <\/p>\n\n\n\n

      \u305f\u3060\u3001\u3053\u3053\u3067\u554f\u984c\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n

      \u4eca\u4f5c\u6210\u3057\u3066\u3044\u308b\u30b3\u30fc\u30c9\u306f\u30de\u30a6\u30b9\u30a4\u30d9\u30f3\u30c8\u306e\u95a2\u6570\u5185\u3067\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u95a2\u6570\u5916\u3067\u5ba3\u8a00\u3057\u3066\u3044\u308bfilenames\u304a\u3088\u3073\u3001\u753b\u50cf\u8868\u793a\u306b\u4f5c\u6210\u3057\u305f\u914d\u5217dcm_copy\u306f\u4f7f\u7528\u3067\u304d\u307e\u305b\u3093\u3002\u306a\u306e\u3067\u3053\u308c\u3092\u4f7f\u3046\u306b\u306fglobal\u3067\u5ba3\u8a00\u3057\u3066\u304a\u304b\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002\u306a\u306e\u3067\u3001\u30de\u30a6\u30b9\u30a4\u30d9\u30f3\u30c8\u306e\u95a2\u6570\u3092\u5ba3\u8a00\u3057\u305f\u76f4\u4e0b\u306b\u5ba3\u8a00\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002\u524d\u56de\u306e\u30b3\u30fc\u30c9\u3067g\u3068\u3044\u3046\u5909\u6570\u3092\u5ba3\u8a00\u3057\u305f\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u305d\u306e\u5f8c\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n\n\n\n

      <\/p>\n\n\n\n

      def onMouse(event, x, y, flag, params):
      global g,dcm_copy,filenames<\/p>\n\n\n\n

      \u3053\u308c\u3067\u3001\u95a2\u6570\u5916\u3067\u5ba3\u8a00\u3057\u3066\u3044\u305ffilenames\u304a\u3088\u3073\u3001dcm_copy\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n

      <\/p>\n\n\n\n


      <\/p>\n\n\n\n

      \u5b8c\u6210\u3057\u305f\u30b3\u30fc\u30c9<\/h2>\n\n\n\n
      \n# coding: UTF-8\nimport fileselect as fs   #\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\u53d6\u5f97\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\nimport numpy as np\nimport pydicom\nimport math\nimport copy\nimport cv2\n\ndef onMouse(event, x, y, flag, params):\n    global g,dcm_copy,filenames\n    g = params\n\n    if event == cv2.EVENT_MOUSEWHEEL:\n        if flag > 0:\n            g -= 1\n        elif flag < 0:\n            g += 1\n\n        if g <= 0:\n            g = 0\n        elif g >= len(filenames)-1:\n            g = len(filenames)-1\n\n    if event == cv2.EVENT_RBUTTONDOWN:\n        fol = fs.folder()\n\n        for i in range(len(dcm_copy)):\n\n            cou = filenames[i].rfind(\"\/\")\n            fname = fol + filenames[i][cou:] + \".jpg\"\n\n            cv2.imwrite(fname,dcm_copy[i])\n\ndef make_LUT(val):\n    global lookup_tbl, dcm_copy\n    wl = cv2.getTrackbarPos('WL', 'dcm_image')\n    ww = cv2.getTrackbarPos('WW', 'dcm_image')\n\n    ww_low = wl - ww \/\/ 2\n    ww_high = wl + ww \/\/ 2\n    lookup_tbl[0:ww_low] = 0\n    lookup_tbl[ww_high:maxvalue] = 255\n    for i in range(ww_low, ww_high, 1):\n        lookup_tbl[i] = math.ceil((i - ww_low) * (256 \/ (ww_high - ww_low)))\n\n    dcm_copy = lookup_tbl[dcm_main]\n\n    dcm_copy =cv2.convertScaleAbs(dcm_copy, alpha=255\/dcm_copy.max())\n\nfilenames = fs.multi_files()\n\ndcm = pydicom.dcmread(filenames[0])\nrow,columns = dcm.pixel_array.shape[0],dcm.pixel_array.shape[1]\n\ndcm_copy = np.zeros((len(filenames), row, columns),dtype = 'int16')\n\nfor i in range(len(filenames)):\n    dcm = pydicom.dcmread(filenames[i])\n    dcm_arr = dcm.pixel_array\n    dcm_copy[i] = dcm_arr\n\ndcm_main = copy.deepcopy(dcm_copy)\n\ncv2.namedWindow('dcm_image',cv2.WINDOW_NORMAL)\n\nmaxvalue = dcm_copy.max()\nlookup_tbl = np.zeros(maxvalue+1, dtype='int16')\n\ncv2.createTrackbar(\"WL\", \"dcm_image\", (maxvalue \/\/ 2), maxvalue, make_LUT)\ncv2.createTrackbar(\"WW\", \"dcm_image\", (maxvalue \/\/ 4), maxvalue, make_LUT)\n\nmake_LUT(0)\ng = 0\n\nwhile 1:\n    params = g\n    cv2.setMouseCallback('dcm_image', onMouse, params)\n    cv2.imshow('dcm_image', dcm_copy[g])\n\n    k = cv2.waitKey(1)\n    if k == ord('q'):\n        break\n\n<\/code><\/pre>\n\n\n\n

      \u3068\u306a\u308a\u307e\u3059\u3002\u3044\u304b\u304c\u3067\u3057\u305f\u304b\uff1f<\/p>\n\n\n\n

      \u304a\u75b2\u308c\u69d8\u3067\u3057\u305f\u3002<\/p>\n\n\n\n


      <\/p>\n\n\n\n

      \u74b0\u5883<\/h2>\n\n\n\n
      • windows10<\/li>
      • python3.6.1 <\/li>
      • Anaconda custom(64-bit)<\/li>
      • PyCharm2020.2(Communication Edition)<\/li><\/ul>\n\n\n\n

        <\/p>\n","protected":false},"excerpt":{"rendered":"

        \u524d\u56de\u3001OpenCV\u3092\u7528\u3044\u3066\u30de\u30a6\u30b9\u30db\u30a4\u30fc\u30eb\u3092\u4f7f\u3063\u3066\u753b […]<\/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":[6,4],"tags":[9,56,45,57,7,58],"class_list":["post-413","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-opencv","category-python","tag-dicom","tag-jpeg","tag-opencv","tag-png","tag-python","tag-tiff"],"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\/413","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=413"}],"version-history":[{"count":18,"href":"http:\/\/radiology-technologist.info\/wp-json\/wp\/v2\/posts\/413\/revisions"}],"predecessor-version":[{"id":581,"href":"http:\/\/radiology-technologist.info\/wp-json\/wp\/v2\/posts\/413\/revisions\/581"}],"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=413"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/radiology-technologist.info\/wp-json\/wp\/v2\/categories?post=413"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/radiology-technologist.info\/wp-json\/wp\/v2\/tags?post=413"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}