ホーム » 「pydicom 2.2 User Guide」タグがついた投稿
タグアーカイブ: pydicom 2.2 User Guide
pydicom 2.2 : ユーザガイド : Pixel データの操作
pydicom 2.2 : ユーザガイド : Pixel データの操作 (翻訳/解説)
翻訳 : (株)クラスキャット セールスインフォメーション
作成日時 : 09/27/2021 (v2.2.1)
* 本ページは、pydicom の以下のドキュメントを翻訳した上で適宜、補足説明したものです:
- User Guide : Working with Pixel Data
* サンプルコードの動作確認はしておりますが、必要な場合には適宜、追加改変しています。
* ご自由にリンクを張って頂いてかまいませんが、sales-info@classcat.com までご一報いただけると嬉しいです。
- 人工知能研究開発支援
- 人工知能研修サービス(経営者層向けオンサイト研修)
- テクニカルコンサルティングサービス
- 実証実験(プロトタイプ構築)
- アプリケーションへの実装
- 人工知能研修サービス
- PoC(概念実証)を失敗させないための支援
- テレワーク & オンライン授業を支援
- お住まいの地域に関係なく Web ブラウザからご参加頂けます。事前登録 が必要ですのでご注意ください。
- ウェビナー運用には弊社製品「ClassCat® Webinar」を利用しています。
◆ お問合せ : 本件に関するお問い合わせ先は下記までお願いいたします。
株式会社クラスキャット セールス・マーケティング本部 セールス・インフォメーション |
E-Mail:sales-info@classcat.com ; WebSite: https://www.classcat.com/ ; Facebook |
pydicom 2.2 : ユーザガイド : Pixel データの操作
pydicom の pixel データを操作する方法。
イントロダクション
多くの DICOM SOP クラスはバルク pixel データを含みます、これは通常は 1 つ以上の画像フレームを表わすために使用されます (但し 他のデータ型 も可能です)。これらの SOP クラスでは pixel データは (殆ど) 常に (7FE0,0010) Pixel Data 要素に含まれます。これに対する唯一の例外は Parametric Map Storage です、これは代わりに (7FE0,0008) Float Pixel Data か (7FE0,0009) Double Float Pixel Data 要素にデータを含む場合があります。
Note : In the following the term pixel data will be used to refer to the bulk data from Pixel Data, Float Pixel Data and Double Float Pixel Data elements. While the examples use PixelData, FloatPixelData or DoubleFloatPixelData could also be used interchangeably provided the dataset contains the corresponding element.
デフォルトでは pydicom は pixel データをファイル内の raw バイトとして読み込みます :
from pydicom import dcmread
from pydicom.data import get_testdata_file
filename = get_testdata_file("MR_small.dcm")
ds = dcmread(filename)
ds.PixelData
b'\x89\x03\xfb\x03\xcb\x04\xeb\x04\xf9\x02\x94\x01\x7f\x02\x92\x038\x05a\x08g\x04%\x04=\x03\x1e\x02\x86\x01i\x01l\x01\x7f\x01\x8d\x01\x92\x01\x90\x01`\x01C\x011\x01,\x01;\x01Z\x016\x01\x8b\x01\xb7\x01\xcb\x01\xa6\x01?\x01i\x01\x83\x01\xb1\x01s\x010\x01+\x01\x10\x01\x13\x01x\x01J\x02\xfb\x02\x9f\x03\xa4\x04\xe2\x03\xc9\x02\x17\x02\x89\x01\xb5\x01\xa1\x01Q\x01\\\x01\r\x01\x17\x01!\x01)\x01\x18\x01\x11\x01\x03\x01.\x010\x01H\x01t\x02\x02\x03\x8b\x03\x8e\x04(\x04H\x02\x89\x01g\x02\x8c\x03\xff\x05\xcc\x07\xd7\x04\x81\x03}\x02\xc4\x01S\x01e\x01g\x01n\x01\x8e\x01\x88\x01s\x01C\x01+\x01=\x01D\x01e\x01L\x01@\x01[\x01x\x01\xb4\x01G\x01+\x01I\x01\x90\x01<\x01\x15\x01\x08\x01\x04\x01\x13\x01\x13\x01v\x01>\x02\xfe\x02s\x04\x80\x04\xed\x02\xfa\x01m\x01\x9f\x01\x92\x01o\x01 \x01\x08\x01\xf6\x00\xf5\x00\x03\x01\x19\x01\xfd\x00\xff\x00*\x01K\x01c\x01\xf2\x016\x02\xc2\x02S\x03~\x04%\x03\xc3\x01\xa0\x01p\x02\x94\x03\xef\x05T\x06\x15\x04\xc0\x02\x96\x02\x8d\x01K\x01O\x01b\x01z\x01\x9b\x01|\x01G\x01.\x01\x1b\x01H\x01\\\x01b\x01\\\x01I\x01R\x01X\x01\x84\x01\x1f\x01&\x01e\x01"\x01\x07\x01\n\x01\x03\x01\xfc\x00\x07\x01,\x01\x82\x01x\x02\xe4\x03\xa3\x04{\x03.\x02d\x01q\x01V\x01K\x01 \x01\xfb\x00\xff\x00\xeb\x00\xe0\x00\xfe\x00\x07\x01\xf7\x00\x18\x01\x1d\x01@\x01\xf4\x01\xd6\x01\x1a\x02\xab\x02L\x03:\x04\xc3\x02z\x01\xdb\x01\xf7\x021\x04*\x05\xe7\x03\x9a\x03\xfa\x02*\x02^\x01D\x01\x87\x01\xa3\x01\xab\x01t\x01^\x01A\x01\x1a\x01\x18\x01<\x011\x01&\x01B\x01\\\x01o\x016\x01\x1b\x01\x18\x01.\x01\x0b\x01\xf8\x00\xeb\x00\xed\x00\xef\x00\xf7\x00\x0b\x01\x08\x01\xb7\x01\xf7\x02p\x04\xb2\x03m\x02\xb3\x01\xb4\x01w\x01H\x012\x01\xf9\x00\xf6\x00\xec\x00\xef\x00\xd4\x00\xed\x00\xe4\x00\x01\x01\x0b\x01/\x01\xc0\x01\xbd\x01\xd6\x010\x02\xaf\x02^\x03\xcf\x03[\x02V\x01T\x02t\x03\x81\x03\xee\x03\x8a\x03\x0c\x03\x03\x02}\x01@\x01\x8a\x01\xbc\x01\xb4\x01\x84\x01s\x01T\x01"\x01\x10\x01\x06\x01\x12\x01(\x01K\x01X\x01U\x01\x15\x01%\x01=\x01&\x01\x19\x01\xf3\x00\xea\x00\x1b\x01\x07\x01\x08\x01<\x01\x1a\x01\x14\x01\x13\x02\xc6\x03\x98\x03\xa2\x03?\x02\xeb\x01\x8e\x01A\x01%\x01\xfc\x00\xdc\x00\xd0\x00\xce\x00\xdb\x00\xd3\x00\xda\x00\xef\x00\x0c\x01>\x01\xaa\x01\xb1\x01\xbe\x01\xf7\x01\x8a\x02\xd3\x02L\x03O\x03\xdc\x01U\x01\x88\x02\xf3\x03\xdf\x03~\x03\xbc\x02\x1a\x02\xab\x01C\x01\x83\x01\xcd\x01\xb7\x01\xa7\x01d\x01J\x01,\x01\x19\x01\r\x01\x07\x01\x1a\x015\x01$\x01-\x01C\x01B\x016\x01#\x01\x0f\x01\x0b\x01\xf7\x005\x01@\x01\x1a\x01#\x01,\x012\x01]\x01\xf2\x02\x14\x03.\x043\x03+\x02\x7f\x01N\x01#\x01\x1d\x01\x02\x01\xd0\x00\xd2\x00\xe0\x00\xd1\x00\xd6\x00\xe7\x00\x05\x01$\x01\x9d\x01\xab\x01\xbe\x014\x02N\x02e\x02\xbd\x021\x03]\x02\xb9\x01\x86\x01\xec\x02 \x04\xf9\x03\xde\x02,\x02\x9c\x01M\x01}\x01\xcb\x01\x9e\x01t\x01\x8a\x01Z\x019\x013\x01\'\x01\x1d\x01\xfb\x00\x13\x01\x03\x01\x14\x016\x01\'\x01\x18\x01\x0c\x01!\x01\x00\x01\xf2\x00\xed\x00\x03\x01\x1d\x012\x01!\x01 \x015\x01\xc2\x01\x90\x02\x82\x03\x06\x04\xc9\x02\xec\x01b\x01.\x01$\x01\x18\x01\xdf\x00\xf1\x00\xde\x00\xd9\x00\xe5\x00\xf6\x00#\x01.\x01\xae\x01\xb2\x01\xc3\x01\x0e\x02,\x02\x15\x02s\x02\xb4\x02\xa0\x02\x84\x02\xa6\x01\xd2\x01\xf6\x02\n\x04\xa2\x02\x90\x02\xca\x01|\x01t\x01\xc1\x01\x81\x01t\x01\x85\x01|\x01a\x014\x01\x19\x01&\x01\x06\x01\xef\x00\x12\x01\x1f\x01)\x01\x13\x01\x06\x01\t\x01\x14\x01\x16\x01\x13\x01\t\x01\xf3\x00\x1e\x012\x012\x01\'\x015\x01\xc1\x01\x86\x021\x03(\x04\xe5\x03\x9a\x02\xd2\x01\\\x01\x1f\x01\x00\x01\xf8\x00\x18\x01\xed\x00\xe2\x00\xf5\x00\x15\x01E\x01q\x01\x98\x01\x93\x01\xc9\x01\xf5\x01\xb6\x01\xc2\x01\xd9\x01\xf8\x01\x83\x02\x03\x03\x83\x02\xa7\x01-\x02\x83\x03y\x03\xfd\x02!\x02\x9c\x01\x9b\x01\x97\x01n\x01G\x01J\x018\x010\x01\x14\x01\x08\x01\xff\x00"\x01\x12\x01\xf0\x00\x02\x01\x1b\x01\x05\x01\x03\x01\x05\x01\xfe\x00\x07\x01\xfc\x00\n\x01\xf3\x00\xfe\x00\n\x01\x19\x010\x01[\x01\xaa\x01@\x02\xea\x02\'\x04Z\x04M\x03\x95\x02\xcc\x01m\x01V\x01X\x01]\x01U\x01#\x01t\x01\x83\x01\x91\x01}\x01\x87\x01\x83\x01\xbb\x01\xc6\x01\x92\x01\x81\x01\x90\x01\xc2\x01\x1c\x02\xe9\x02\xe2\x02\x0b\x02\xce\x01\xac\x02[\x03[\x03\xc5\x02O\x02\xad\x01\x8a\x01c\x016\x01R\x01(\x019\x01*\x01\x05\x01\xfa\x00\x1a\x01\x1f\x01\xf7\x00\xf9\x00\xff\x00\xfc\x00\xfd\x00\x14\x01\x03\x01\xfc\x00\t\x01\x04\x01\xfc\x00&\x010\x01,\x01C\x01K\x01\xa3\x01\xf5\x01\xcb\x02\xd0\x03\x8a\x04\x19\x04\x94\x03\xef\x02\xeb\x01\x07\x02\xca\x01o\x01\x85\x01l\x01K\x01+\x01\x0f\x01\x07\x01\x94\x01|\x01\xa1\x01\x88\x01s\x01k\x01r\x01\x98\x01\xdd\x01v\x02\xf8\x02\x8d\x02\xcf\x01\x13\x02\xfe\x02\xc1\x03\x8b\x02\x0f\x02\x9e\x01b\x01<\x01*\x01=\x01\n\x01\xf9\x00\xeb\x00\xf1\x00\xf8\x00\x03\x01%\x01\x02\x01\xfe\x00\x12\x01\xfe\x00\x1a\x01;\x01\xff\x00\xf1\x00\x07\x01\x08\x01\x1b\x014\x01.\x01M\x01E\x01_\x01\x87\x01\xbc\x01\xcb\x02\n\x04P\x04\x05\x04y\x03\xc3\x02\xc0\x01\x89\x01-\x01\xfc\x00\xd8\x00\xca\x00\xd3\x00\xe9\x00\x01\x01\x03\x01p\x01~\x01r\x01v\x01g\x01W\x01s\x01\xa2\x01\xb8\x019\x02\xcd\x02\xd8\x02\x10\x02\x9f\x01\xb2\x02\xe2\x03\x92\x02J\x02\xba\x01e\x014\x01(\x014\x01\x08\x01\xf3\x00\xf5\x00\xed\x00\x00\x01\xf9\x00\x1f\x01\x19\x01\x07\x01\x19\x01\x12\x01\x11\x01B\x01\x07\x01\xf6\x00\xfa\x00\xfe\x00\x10\x01;\x01>\x01l\x01\xaa\x01\xbd\x01\xdc\x01\xa1\x01\xf8\x02\xbf\x03l\x04\x1b\x04\xc2\x02\xa9\x01J\x01\xf8\x00\xd0\x00\xc1\x00\xc8\x00\xd3\x00\xe9\x00\xcf\x00\xc8\x00\xc7\x00\x84\x01\x95\x01\x9a\x01\x8c\x01p\x01U\x01Q\x01\x82\x01\x8e\x01\xfb\x01j\x02\xef\x02V\x02\x8f\x01Y\x02\xdd\x03\xe5\x02]\x02\n\x02w\x01M\x015\x01$\x01\x13\x01\xfd\x00\xea\x00\xe5\x00\xe7\x00\xf1\x00\xfc\x00\r\x01\x06\x01\x1f\x01,\x01L\x01:\x01\x1e\x01\xfb\x00\x08\x01\x11\x01-\x01;\x01Z\x01o\x01V\x01^\x01\x89\x01\xe5\x01)\x03M\x04K\x04\x05\x03\x88\x01\x1f\x01\xfc\x00\xe0\x00-\x01\'\x01\xfd\x00+\x019\x01Q\x01\x1f\x01>\x01_\x01\x93\x01\x98\x01y\x01J\x016\x01E\x01N\x01n\x01\x95\x01\x05\x02\xd4\x02\xcc\x02\xda\x01\r\x02|\x03\xb7\x02:\x02(\x02\x8a\x01Q\x01\x0b\x01\xfc\x00\xf9\x00\xeb\x00\xed\x00\xf6\x00\x12\x01\x17\x01\x17\x01\x03\x01 \x01*\x01,\x01$\x01\x13\x01\x00\x01$\x01\x0e\x01*\x011\x01\'\x01<\x01j\x01J\x01h\x01\x89\x01-\x02\xcc\x03\x04\x04\x94\x02\xb8\x01\x06\x01,\x01\x13\x01\xfc\x00g\x01J\x01G\x011\x01$\x01\x86\x01\xa4\x014\x02W\x01\\\x01b\x01\x86\x01[\x01-\x01\\\x01=\x01P\x01q\x01\xab\x01,\x02\xeb\x02g\x02\x06\x02\t\x037\x03&\x02!\x02p\x01.\x01\xf7\x00\xfe\x00\x01\x01\xeb\x00\xf2\x00\xfe\x00\xf7\x00\xf9\x00\x0f\x01\x1b\x01W\x01_\x01S\x01\x1d\x01\x13\x01\x04\x01\x15\x01\x1e\x01)\x01\x17\x01\x1f\x01O\x017\x01n\x01z\x01\x8e\x01\x19\x03]\x03O\x02D\x01\x1d\x01\xa8\x01k\x01W\x01\x9f\x01\xfd\x00*\x01C\x01N\x01"\x01I\x01\xba\x01\xfa\x01P\x01a\x01\x82\x01\x8e\x01\x82\x01C\x01 \x01,\x01;\x01Q\x01\x81\x01\xc0\x01\xaf\x02\xc1\x02\t\x02\x8e\x02\x98\x03%\x02\xfb\x01b\x01)\x01\xf5\x00\xe9\x00\x00\x01\xee\x00\xe7\x00\xf0\x00\xeb\x00\xf6\x00\xed\x00\xfd\x00)\x01/\x01D\x01\x15\x01\x17\x01\x0e\x01\n\x01\x0b\x01\x17\x01\xff\x004\x01T\x01r\x01\x7f\x01m\x01\xb3\x01\x12\x02\x83\x01\x16\x01@\x01\x90\x01\xf5\x01\xcd\x01\xaf\x01\x94\x01D\x01\t\x01Z\x012\x01(\x01\'\x01F\x01}\x01]\x01\x8e\x01\x84\x01\\\x01\x84\x01f\x01+\x01(\x01\x18\x01=\x01\\\x01\xa6\x01\xfd\x01\x84\x02L\x02M\x02\xa1\x03)\x02\xc2\x01{\x01:\x01\xff\x00\xe3\x00\xe5\x00\x00\x01\xe9\x00\xef\x00\xf6\x00\x02\x01\x07\x01\xe1\x00\x13\x01\x1f\x01!\x01\x02\x01\t\x01!\x01\x16\x01\x07\x01\x07\x01\xf6\x00\x17\x01Q\x01n\x01\x89\x01\x86\x01|\x01g\x01+\x01\xa0\x01\xb8\x01\x1b\x02P\x02+\x02\xfe\x01\x9a\x01\x81\x01[\x010\x01O\x01C\x01\xc3\x01A\x02\xfc\x02\x7f\x01}\x01W\x01T\x01u\x01h\x01>\x01(\x01\x12\x01\x02\x01+\x01\x7f\x01\x03\x02\xfb\x01g\x02)\x02p\x03%\x02\xc4\x01q\x01N\x01\x1b\x01\xf3\x00\xee\x00\xff\x00\xf6\x00\x01\x01\x0b\x01\xf9\x00\xec\x00\r\x01\xe5\x00\x02\x01\x11\x01\x01\x01\'\x01,\x01\x1c\x01\r\x01\xfd\x00\xf9\x00\x19\x01M\x01\\\x01|\x01\x9d\x01Z\x01\x1b\x01\x83\x01\xda\x01`\x02\xb8\x02l\x02\x0b\x02\xb1\x01\x98\x01i\x010\x014\x01z\x019\x02 \x03\xc3\x03\x05\x04y\x01X\x01M\x01J\x01A\x01L\x01\x1b\x01\r\x01\x10\x01\x17\x01\x00\x01\x86\x01\xb8\x01\xbc\x01\n\x02\x11\x02\xf1\x02m\x02\x88\x01\xbe\x01\x80\x016\x01\x18\x01\x14\x01\x18\x01\x12\x01\x12\x01\xfb\x00\xf2\x00\xf4\x00\x10\x01\x0e\x01\xea\x00\x0c\x01\x02\x015\x01)\x01\x1c\x01\x0b\x01\x05\x01\x0c\x012\x01G\x01o\x01\x88\x01k\x01B\x01`\x01\xe1\x01\x88\x02\xea\x02g\x02\xfb\x01\xad\x01{\x01g\x01O\x01:\x01\x0e\x02|\x03=\x04\xb7\x04\xad\x04v\x04Q\x01c\x01F\x01Z\x01S\x01:\x01\x15\x01\xfa\x00\xfb\x00\xff\x00\xf1\x00\xf0\x00f\x01s\x01\xb4\x01\t\x02)\x02W\x02\x8a\x01k\x01\xbb\x01|\x01M\x01V\x01\x0c\x01\x0f\x01\x16\x01\r\x01\xfe\x00\x01\x01\x0f\x01\x0b\x01\xfa\x00\xf4\x00\x0e\x017\x01\x13\x01\x19\x01\x1a\x01\xfe\x00\x10\x01%\x01@\x01j\x01%\x01\x0b\x01E\x01\xbe\x01\x91\x02\xdc\x02\xe7\x02\x9f\x02(\x02w\x01a\x01}\x01h\x01b\x01\xcb\x02\xdb\x03\xb8\x03\xed\x03\x0e\x04y\x04\\\x01Z\x01D\x01^\x015\x01\x1f\x01\xfb\x00\xec\x00\xe7\x00\xf2\x00\xe4\x00\xe4\x00\xf0\x00-\x01r\x01\xec\x01\xe0\x01"\x02\x8c\x01c\x01\xa8\x01\xb2\x01\x83\x01K\x01\x11\x01\x11\x01\x14\x01\n\x01\xf8\x00\x05\x01\t\x01\x17\x01\x12\x01\xfa\x00\x17\x01.\x01\t\x01\x16\x01\xfb\x00\xfa\x00(\x01g\x01\x8c\x01s\x01\x0f\x01C\x01\xc5\x01w\x02H\x02\xea\x01I\x028\x02\x08\x02Y\x01C\x01@\x01W\x01\x9a\x01+\x03Q\x04\x02\x04"\x04{\x04\xad\x04Y\x01F\x01N\x01S\x01:\x01\r\x01\xf5\x00\xeb\x00\xde\x00\xe5\x00\xff\x00\xe2\x00\xe6\x00\xf5\x007\x01\xbd\x01\xd3\x01\xa1\x01\xbf\x01h\x01n\x01\xbe\x01\xb1\x01F\x01\x1c\x01\x19\x01\x08\x01\xf8\x00\xfb\x00\n\x01\xfa\x00\x0f\x01\xf3\x00\x01\x01 \x01\x0b\x01\x13\x01\t\x01\xef\x005\x01g\x01\x88\x01w\x01/\x01\x99\x01\x84\x01>\x02\xf0\x01\xd3\x01\xcc\x01\xa8\x01\xcc\x01S\x01A\x014\x01E\x01f\x01\n\x02s\x03p\x04k\x04\x89\x04\xb3\x04\xce\x04R\x01=\x015\x01B\x015\x01\x05\x01\xfe\x00\xf1\x00\xe3\x00\xe7\x00\xf6\x00\x0e\x01\xdb\x00\xec\x00\x07\x01x\x01\xba\x01\x88\x01\xc8\x01P\x01N\x01\xa5\x01\xc8\x01[\x01\x10\x01\x07\x01\xfa\x00\xf6\x00\x06\x01\x05\x01\xfc\x00\xeb\x00\xe5\x00\n\x01\x18\x01\x18\x01\x0b\x01\xfa\x00\x04\x01S\x01s\x01g\x01 \x01(\x01S\x01\xe2\x01\xe3\x01s\x01n\x01y\x01_\x01S\x01e\x01F\x01J\x01X\x01\x1d\x01\x8c\x02\x00\x04\x85\x04\x92\x04\xa5\x04\xbb\x04\xb4\x04b\x018\x01(\x01%\x011\x01\x07\x01\x04\x01\xf4\x00\xe4\x00\xf5\x00\x1a\x01\xed\x00\xdf\x00\xdf\x00\xf9\x00"\x01\x95\x01n\x01\xbf\x01`\x01?\x01y\x01\xce\x01u\x01%\x01\x10\x01\x0c\x01\xf0\x00\xf4\x00\xeb\x00\xf3\x00\xd7\x00\xe0\x00\xfc\x00\xec\x00\xea\x00\xde\x00\xfe\x003\x01B\x01M\x01(\x01!\x01\x1c\x01h\x01\x9d\x01\xaf\x01@\x01\x1d\x01\x18\x017\x01F\x01q\x01x\x01Q\x01\x15\x01l\x01\xda\x02W\x04\x98\x04\xa6\x04\xa8\x04r\x04`\x04I\x01F\x01\x1f\x01(\x01!\x01\x12\x01\x08\x01\xec\x00\xf3\x00"\x01\x12\x01\xee\x00\xe6\x00\xdd\x00\xf6\x00\x10\x01H\x01\x87\x01\x9b\x01r\x01C\x01`\x01\xbe\x01`\x01<\x010\x01 \x01\x11\x01\xe6\x00\xf2\x00\xd7\x00\xea\x00\xf3\x00\xfb\x00\xfa\x00\xd4\x00\xf5\x00\x08\x01\xff\x00\xfc\x00 \x011\x013\x013\x01\x13\x01[\x018\x01#\x01\x08\x01\n\x01\x11\x01,\x01,\x01\x1b\x01\xf9\x00<\x01\xe5\x01\xc6\x02\x8f\x04\x8d\x04_\x04m\x04|\x04\xdd\x04\x83\x01`\x01\x1f\x01\x1f\x01 \x01\x1e\x01\x14\x01\x19\x01\x1c\x01\r\x01\x06\x01\x00\x01\xf1\x00\xe1\x00\x0b\x01\t\x010\x01c\x01k\x01\x80\x01U\x01Y\x01\xa3\x01\xd1\x01\xa1\x01\x06\x01\x1e\x01\x12\x01\xf7\x00\xde\x00\xd5\x00\xe8\x00\xe2\x00\xf5\x00\xd2\x00\xdd\x00\xf5\x00\xd6\x00\xd2\x00\xd9\x00\xe1\x00\xee\x00\x02\x01\x02\x01"\x01B\x01]\x01O\x01\x18\x013\x017\x01\x14\x01\t\x01\x0e\x02\xde\x02h\x03\xc1\x03p\x04\xba\x04\xfd\x04\r\x05\xff\x04\xbd\x04n\x04\x90\x01Q\x01+\x01\x12\x01\x02\x01\xff\x00\x00\x01\x16\x01\x06\x01\x06\x01\xf7\x00\xf2\x00\xec\x00\xf1\x00\xf5\x00\x06\x01C\x019\x01T\x01\x83\x01[\x01l\x01{\x01\xe8\x01\xa4\x01\x0c\x01\xe5\x00\xeb\x00\x02\x01\xd7\x00\xcf\x00\xe5\x00\xde\x00\xd0\x00\xe1\x00\xda\x00\xe5\x00\xe3\x00\xc9\x00\xc1\x00\xc3\x00\xe6\x006\x01\n\x01\x1a\x01\x93\x01\xf9\x00\xe3\x00\xd6\x00\xfc\x00\r\x01D\x01\xe8\x01;\x03\x02\x04g\x04S\x04\xe7\x03\x1a\x04\x14\x04Z\x04\xb1\x04\xa4\x04\x17\x04\x8e\x01C\x016\x01\x1f\x01\x13\x01\x0e\x01\x02\x01\n\x01\x15\x01\x02\x01\x11\x01\xf4\x00\xe9\x00\xf5\x00\xff\x00\x12\x01\x16\x01:\x01>\x01H\x01\x81\x01\x94\x01\x8c\x01\xad\x01\xba\x01\x02\x01\xe2\x00\xda\x00\xd5\x00\xec\x00\xc9\x00\xdf\x00\xd8\x00\xcc\x00\xd2\x00\xcc\x00\xd9\x00\xe1\x00\xa7\x00\xc2\x00\xfe\x00\x88\x01T\x02t\x02V\x02c\x02T\x02\x8f\x01-\x01\x12\x01d\x01\x19\x02\x1f\x03!\x04\x04\x04\xfc\x03\x0c\x04\xdc\x03 \x04\xbd\x03\xd0\x03\xde\x03\x1a\x04S\x04p\x01D\x01D\x01&\x01(\x01\x1d\x01\x0e\x01\x06\x01\x0c\x01\x1c\x01\x03\x01\x0b\x01\xe6\x00\xe5\x00\xf1\x00\xfd\x00\x04\x01(\x01:\x01?\x01O\x01\x87\x01\xb2\x01\xcd\x01\xb4\x01\x18\x01\xde\x00\xe0\x00\xc5\x00\xef\x00\xca\x00\xc4\x00\xb8\x00\xb4\x00\xb7\x00\xb4\x00\x9f\x00\xaa\x00\x00\x01\xac\x01\xcb\x02"\x03\xaa\x03\xfc\x03\xfa\x03\xb8\x03\x8c\x03\xd0\x029\x03V\x03X\x03\xe7\x03\x9f\x04\xb0\x04\x89\x047\x04\t\x04\xf5\x037\x04W\x04t\x04?\x04\xa6\x04\xa8\x04\x82\x01L\x019\x01=\x01,\x01\x15\x01#\x01\x18\x01&\x01\x0e\x01\xe9\x00\x1b\x01\x02\x01\xe7\x00\xe9\x00\xfb\x00\xfa\x00\xf8\x007\x01\x18\x01(\x01O\x01M\x01\xbe\x01\xdc\x018\x01\xe8\x00\xbd\x00\xb3\x00\xe4\x00\xd5\x00\xb0\x00\xc4\x00\xc0\x00\xbd\x00\xc8\x00\xbd\x00H\x01\xeb\x02X\x04G\x05\xb6\x05\x91\x05\r\x05\x15\x04]\x04\xbf\x04\xff\x04\x07\x05\x08\x05\x91\x04\xed\x04\xee\x04\xe7\x04\xbe\x04\x92\x04\\\x04Z\x04U\x04D\x04i\x04s\x04s\x04[\x04x\x01j\x01J\x01!\x01!\x01$\x01+\x01%\x01#\x01\xed\x00\xe2\x00\xea\x00%\x01\xf9\x00\xef\x00\xf6\x00\x00\x01\x00\x01\xeb\x00(\x01\xfb\x00\xfd\x00\x1a\x01\x84\x01\xca\x01l\x01\x18\x01\xbd\x00\xa7\x00\xc1\x00\xa9\x00\xd9\x00\xc8\x00\xee\x00\xf6\x00\xc1\x00\x0c\x02E\x03<\x04\xfc\x040\x05\'\x05\x93\x05m\x05\xb4\x04\xcf\x046\x05;\x05\xab\x04\x8b\x04\x87\x04\xf5\x04\x0e\x05\xfb\x04\xca\x04\xaa\x04x\x04Q\x04$\x04\xea\x03\xaa\x03\xb6\x03\xba\x03\xe8\x03n\x01k\x01B\x01(\x01\x1c\x01\x1b\x012\x01\x1d\x01\x1c\x01\xe3\x00\xe6\x00\xf5\x00\n\x01#\x01\x14\x01\n\x01"\x01\x1f\x01\x05\x01\xdf\x00\xfa\x00\xde\x00\xed\x00\x16\x01\x9d\x01\x90\x01\x12\x01\xc0\x00\xa1\x00\xa7\x00\xc3\x00\xce\x00\xd2\x00\xc5\x00\xc6\x00m\x01\xdb\x02\xf9\x03\xb3\x04\x0c\x05;\x05>\x05\x8f\x05\xf3\x05n\x05\x7f\x05q\x05/\x05\x17\x05\xaf\x04\xab\x04\x08\x05\x06\x05\xd1\x04\xed\x04\xb7\x04\xa9\x04\x82\x04\xeb\x03M\x030\x03U\x03\x93\x03\xbc\x03\xe2\x01\xb1\x01~\x01B\x01C\x013\x01 \x01%\x01\x16\x01\xed\x00\r\x01\x12\x01%\x01\x05\x01\x18\x01\t\x01\x05\x01#\x01\x07\x01\xe7\x00\xd5\x00\xc8\x00\xf2\x00\xf5\x005\x01A\x01>\x01\xc3\x00\xa3\x00\xad\x00\xa8\x00\xce\x00\xb6\x00\xca\x00\xe1\x00>\x02I\x03\x12\x04\x95\x04\xe3\x04\x01\x05\x0b\x05\xea\x04$\x05\xf6\x05\xb9\x05\xa5\x05]\x05<\x05\n\x05\xe4\x04\xbc\x04\xe3\x04\xdd\x04\xdc\x04\xd4\x04\xba\x04\x0c\x03\x99\x02.\x03:\x03\xe7\x02\xc8\x02\xae\x02[\x01E\x01-\x01O\x018\x01P\x01K\x01!\x01\x11\x01\x08\x01\x0e\x01\x11\x01\x1b\x01\r\x01\x08\x01\x0b\x01\x10\x01\x15\x01\x16\x01\xee\x00\xd5\x00\xc6\x00\xd6\x00\xf0\x00 \x01\xed\x00\xd0\x00\xb8\x00\xaf\x00\xc9\x00\xb7\x00\xac\x00\xc8\x00\xdc\x00\xf4\x00g\x02Z\x03\xcc\x03E\x04.\x049\x04{\x04\x94\x04\x9b\x04X\x05\xf4\x05\xc4\x05\x9d\x05X\x05\x1d\x05\x18\x05\x07\x05\xd9\x04\xe4\x04\xf2\x04\xd6\x04<\x04\xc8\x02\xca\x01\xde\x01s\x02\xbc\x02\xd7\x02\x9b\x02@\x01-\x01%\x012\x01\'\x014\x01D\x01Q\x01G\x01@\x01E\x01J\x01\\\x018\x01\n\x01\x1a\x01!\x01\x04\x01\xd6\x00\x02\x01\xe3\x00\xc7\x00\xed\x00\xeb\x00\xf5\x00\xea\x00\xdc\x00\xc3\x00\xc4\x00\xd6\x00\xb8\x00\xdd\x00\xbc\x00\xf9\x00$\x01=\x02M\x03s\x03\xf4\x02\x88\x02\x8b\x02\xe6\x02\xe8\x03\xd2\x03\xa6\x040\x05\xd8\x05z\x05K\x05<\x051\x05 \x05\xfb\x04\xf3\x04\xf3\x04H\x04\xa9\x03N\x02B\x01\r\x01,\x01\x9d\x01)\x02\x9b\x02\x1c\x01\x1a\x01\x10\x01\x11\x01\x19\x01/\x014\x01S\x01\xa5\x01\xdb\x01\xd2\x01\xae\x01)\x01\'\x01\x12\x01(\x01\xf6\x00\xda\x00\xf6\x00\x17\x01\xe4\x00\xe1\x00\xdc\x00\xd8\x00\xc5\x00\xbd\x00\xc1\x00\xc9\x00\xd8\x00\xc4\x00\xe6\x00\xe7\x00\xbe\x00\xe2\x00-\x01\xfe\x01%\x03\x0e\x03\xe6\x01v\x01\x93\x01%\x02b\x03\xc1\x03]\x03j\x04\x7f\x05\xa6\x05d\x05.\x059\x052\x05\r\x05\xed\x04\xe8\x04y\x04\xef\x03`\x02\x03\x01\xe2\x00\xde\x00\xf5\x002\x01h\x01\x0c\x01#\x01\x1c\x01\x15\x01\x17\x01(\x01;\x01b\x01A\x019\x01,\x01.\x01\x1c\x01\x1e\x01#\x01\x1a\x01\xe5\x00\xdb\x00\x02\x01\x13\x01\xc3\x00\xcb\x00\xbf\x00\xb7\x00\xd7\x00\xe1\x00\xe6\x00\xd6\x00\xd1\x00\xcd\x00\xd5\x00\xeb\x00\xc7\x00\xdf\x00a\x01\xd6\x01\xe9\x02\xe2\x02k\x01\x05\x01\x06\x01g\x01\x8c\x02B\x03\xd9\x02\x00\x03\x19\x05\x92\x05\x85\x05N\x05\x13\x05*\x05\x19\x05\xf7\x04\xcc\x04e\x04\xe0\x03\xa8\x02\'\x01\xd9\x00\xd7\x00\xd4\x00\xe1\x00\x14\x01\x08\x01\'\x016\x015\x01(\x01*\x01/\x01H\x015\x016\x01K\x01A\x01\x15\x01\x07\x01\xfc\x00\x11\x01\xe6\x00\xe1\x00\x11\x01\x03\x01\xc0\x00\xc0\x00\xac\x00\xb6\x00\xbd\x00\xcb\x00\xd6\x00\xd4\x00\xd4\x00\xd0\x00\xd1\x00\xd1\x00\xdc\x00\xeb\x00$\x01\xf6\x01\xa3\x02\xb2\x02\x1b\x01\xf2\x00\xce\x00\xcd\x00\xc7\x01\xa0\x02\xcb\x02@\x02\x89\x03V\x05[\x05a\x05\x16\x05\x1d\x05\xf4\x04\xdd\x04\xa9\x047\x04\xd5\x03S\x02\xe9\x00\xcd\x00#\x01D\x01H\x017\x01\x05\x01\x13\x01*\x01B\x01G\x01O\x01R\x013\x01(\x01T\x01a\x01O\x011\x01\x13\x01\x0c\x01\x08\x01\xf5\x00\xf7\x00\x1a\x01\xdc\x00\xc2\x00\xad\x00\xa9\x00\xbd\x00\xc3\x00\xd3\x00\xba\x00\xbc\x00\xbc\x00\xd5\x00\xc3\x00\xc3\x00\xca\x00\xf7\x00\x0f\x01\xcd\x01=\x02\x95\x02C\x01\x11\x01\xc2\x00\xb4\x00\xc9\x00\xa6\x01\x89\x02\xc8\x01\xb4\x02\xb8\x04\xad\x05V\x05B\x05\xec\x04\xd9\x04\x9d\x04e\x04\xd9\x03_\x03\x84\x02\xeb\x00\xbd\x00\xde\x00\x1a\x01\x03\x01\xfe\x00"\x01\x1f\x01;\x01.\x01I\x01T\x01N\x01-\x019\x01E\x01n\x01U\x01 \x01&\x01\x19\x01\n\x01\x07\x01\x13\x01\x05\x01\xed\x00\xe5\x00\xe6\x00\xa5\x00\xb6\x00\xd1\x00\xe2\x00\xad\x00\xad\x00\xb5\x00\xc4\x00\xd0\x00\xbe\x00\xbe\x00\xe3\x00\x08\x01k\x01\x0c\x02i\x02\x8d\x019\x01\xdb\x00\xb7\x00\xc8\x00\x18\x01\xbd\x01\xf9\x01\x96\x02\xc1\x03\xd4\x05>\x05$\x05\n\x05\xb7\x04\xac\x04z\x04\xd9\x03\xc6\x03z\x02\x00\x01\xd1\x00\xcb\x00\xd8\x00\xd4\x00\xe1\x00S\x01Q\x01E\x01"\x01>\x01D\x01@\x01,\x01Y\x01E\x01k\x01R\x01#\x01\x18\x01\x02\x01\xfa\x00\x11\x01 \x010\x01#\x01\x13\x01\xda\x00\xd7\x00\xab\x00\xdd\x00\xd9\x00\xa6\x00\xa9\x00\xab\x00\xb4\x00\xc6\x00\xc0\x00\xb6\x00\xce\x00\xd7\x00"\x01\xc0\x01\x8b\x02\xec\x01x\x01!\x01\xfb\x00\x1a\x01%\x01|\x01\x11\x02\x1c\x03-\x04\xda\x05=\x05)\x05\xd3\x04\xb3\x04\xa1\x04k\x04\xd6\x03\xe0\x035\x02?\x01\xfa\x00\xd9\x00\xd1\x00\xde\x00\xe6\x00N\x01W\x01N\x01O\x01\x19\x01(\x01\'\x01:\x01g\x01R\x01V\x01=\x01\x1f\x01E\x01\x17\x01\xfa\x00\x1b\x01\xfc\x00=\x01=\x01\xfd\x00\xd9\x00\xc2\x00\xd1\x00\xb6\x00\xb6\x00\xaa\x00\xbd\x00\xaf\x00\xb0\x00\xb4\x00\xc7\x00\xb8\x00\xb7\x00\xba\x00\xea\x00Q\x01\x00\x02\xd3\x02O\x02\xbd\x01\xa8\x01\xab\x01\xed\x01w\x027\x03\x80\x04\x8f\x05\xc8\x05A\x05\xfe\x04\xd8\x04\xb9\x04\x83\x04C\x04\xed\x03\xef\x03\xeb\x01k\x01K\x01\xd5\x00\xd7\x00\xd3\x00\xd4\x00_\x01O\x01O\x01h\x01\\\x01\x18\x01$\x01<\x01c\x01?\x013\x01K\x01\'\x01Q\x01?\x01\x1a\x01\xfd\x00\xff\x007\x01D\x01\x1a\x01\xe6\x00\xbe\x00\xbb\x00\xc3\x00\xc0\x00\xb4\x00\xce\x00\xc4\x00\xd9\x00\xc8\x00\xd7\x00\xc5\x00\xb5\x00\xb5\x00\xb1\x00\xec\x00^\x010\x02\xe8\x02\xca\x02x\x02\x11\x03\x80\x03\xdd\x03\xa6\x041\x05\x91\x05\x86\x054\x056\x05\xef\x04\xd4\x04\xa4\x04)\x04\xe4\x033\x04\xbe\x01\xa8\x01k\x01?\x01\xda\x00\xe6\x00\xd2\x00\x9b\x01X\x01Q\x01q\x01I\x01X\x01\x1c\x017\x01G\x01.\x011\x011\x01G\x01V\x01)\x01\x1d\x01?\x01\x05\x01)\x01/\x01\x13\x01\xd2\x00\xc6\x00\xb9\x00\xb2\x00\xba\x00\xd9\x00\xe8\x00\xea\x00\xd7\x00\xb6\x00\xe0\x00\xea\x00\xe0\x00\xc4\x00\xb1\x00\xb0\x00\xe8\x00\x8f\x01:\x02\xca\x02>\x03\x96\x03\xd8\x03Q\x04\xc6\x04 \x05_\x05M\x05\x8a\x05\\\x05\x15\x05\xe6\x04\xa0\x04\x12\x04\xc9\x03]\x04\xbe\x01X\x01\x13\x01\xea\x00\xf7\x00\xf0\x00\xd1\x00\xd1\x01\xb2\x01U\x01_\x01d\x01Z\x01J\x01$\x01(\x01:\x013\x01#\x01.\x01A\x01?\x01W\x01_\x01U\x01%\x01\xfa\x00\xd4\x00\xbe\x00\xab\x00\xbf\x00\xaa\x00\xbe\x00\xcf\x00\xe6\x00\xcb\x00\xd5\x00\xaf\x00\xc1\x00\xe7\x00\xe1\x00\xbc\x00\xac\x00\xbf\x00\xb2\x00\xda\x00\x82\x01\x05\x02k\x02\xce\x020\x03,\x03]\x04\x00\x05\x89\x05\xb2\x05\xb9\x05\x98\x05Y\x05\xed\x04\x8c\x04\xfd\x03\xd6\x03~\x04\xfd\x01B\x01\x1b\x01\x04\x01\xfc\x00\xe2\x00\xd9\x00\xe6\x01\xb3\x01\x97\x01^\x01c\x01B\x01F\x014\x01)\x01@\x01%\x01 \x01\x1f\x01;\x01*\x01_\x01r\x01j\x01K\x01\xda\x00\xb3\x00\x9f\x00\xa0\x00\xa3\x00\xbc\x00\xca\x00\xd2\x00\xcd\x00\xce\x00\xca\x00\xaa\x00\xa7\x00\xd3\x00\xc7\x00\xba\x00\xaf\x00\xce\x00\xcb\x00\xba\x00\xd4\x00\xf4\x00!\x01Q\x01~\x01\xc9\x01\x08\x02\xaf\x02o\x02\xe4\x02l\x03x\x04\xc3\x04\x9e\x04\x90\x04x\x04F\x04\x92\x04b\x02P\x01\'\x01#\x01\xf8\x00\xe2\x00\xea\x00\xf8\x01\xd0\x01\x9b\x01i\x01O\x01>\x01\x1d\x01J\x01=\x01=\x012\x013\x01(\x01-\x01 \x01Q\x01j\x01o\x01T\x01\xf6\x00\x9c\x00\xae\x00\xb5\x00\xb4\x00\x9f\x00\xaf\x00\xaa\x00\xb1\x00\xcc\x00\xb6\x00\xaa\x00\xab\x00\x9d\x00\xa2\x00\xa7\x00\xbe\x00\xc7\x00\xc2\x00\xe5\x00\xac\x00\xf0\x00\xf5\x00\xe8\x00\xde\x00\xd9\x00\xed\x00O\x01\xe5\x01\xb5\x02\xb5\x03\xce\x03\xf1\x03\x86\x03Z\x03\x12\x03#\x04\x90\x04\xb8\x02\xb5\x01)\x01P\x01\xff\x00\xff\x00\x06\x01^\x02\xea\x01\x8f\x01Z\x014\x01\x1c\x01!\x01T\x01b\x01H\x01\x1f\x01\x1a\x013\x013\x01\x14\x01=\x01(\x01N\x01F\x01\xd5\x00\x98\x00\x9c\x00\xaa\x00\xb7\x00\xa5\x00\xa4\x00\xa5\x00\xb2\x00\xcc\x00\xb2\x00\xb3\x00\xb3\x00\xa4\x00\xab\x00\xb9\x00\xbf\x00\xb9\x00\xcb\x00\xd1\x00\xd0\x00\xac\x00\xa6\x00\xa3\x00\xab\x00\xc0\x00\'\x01\x88\x01G\x02\x8b\x02\x05\x03P\x03\xe2\x04\xd5\x04\xa2\x03\xca\x02\xea\x03\x95\x04\xed\x03n\x02Y\x01\xa1\x01%\x01\xf9\x00\x03\x01\xf7\x02M\x02\xe1\x01f\x019\x01<\x01\'\x01e\x01m\x01H\x01)\x01\x14\x015\x013\x01\x15\x013\x01\x12\x01\t\x01!\x01\xbd\x00\x9c\x00\x9a\x00\x9a\x00\xa4\x00\xb3\x00\xac\x00\xaa\x00\xbb\x00\xc3\x00\xb8\x00\xa5\x00\xc0\x00\xa0\x00\x8d\x00\x84\x00\x8d\x00\x99\x00\xc9\x00\xb6\x00\xdc\x00\xc7\x00\xb2\x00\xcc\x00\xc5\x00\x85\x01\x87\x02\x98\x03t\x03X\x02\xa8\x02/\x04\xfd\x04\x1b\x05f\x04\xf6\x02\x95\x045\x04T\x04h\x03\xfc\x01D\x018\x01\x1d\x01M\x01W\x03\xc5\x02\xf4\x01\x8f\x01C\x01v\x01@\x01\x1e\x01\\\x01w\x01G\x01\x16\x01.\x013\x01\x1b\x013\x01\xf1\x00\x0f\x01\xe6\x00\xbf\x00\xa6\x00\x9c\x00\xb4\x00\x9b\x00\xa2\x00\xad\x00\xb1\x00\xc5\x00\xbe\x00\xa3\x00\xa2\x00\xa8\x00\xb0\x00\xc1\x00\x93\x00\x9b\x00\xc7\x00\xa8\x00\xcb\x00\xd0\x00\xd1\x00\xb9\x00\xf4\x00\x14\x02n\x03@\x04\x8d\x03\xfe\x01?\x02\xf7\x02m\x04\xcf\x04\x02\x05\xae\x04\x94\x03\xd9\x04\xbb\x04\x83\x04.\x04\xc9\x02\xe2\x01{\x01M\x01%\x01\x7f\x03\xc0\x02\x1b\x02\xba\x01}\x01\x89\x01E\x01,\x01\x16\x013\x01e\x01%\x01\x1a\x01\x1c\x018\x01*\x01\x08\x01\xd4\x00\xb0\x00\xc3\x00\xc0\x00\xa8\x00\xba\x00\xa1\x00\x9b\x00\xac\x00\xb8\x00\xc4\x00\xa2\x00\xb4\x00\xde\x00\xeb\x00\xe1\x00\xbc\x00\x9c\x00\xb7\x00\xb2\x00\xab\x00\xac\x00\xae\x00\xe8\x00T\x01\xca\x02+\x04\x9e\x04\x8b\x03\xe7\x018\x02\xde\x02\'\x03\xca\x03\xc5\x03\xee\x03w\x04\x07\x05\x11\x05\xe8\x04\x92\x040\x04\x98\x03\xc5\x02\xb3\x01\xd6\x01\xbf\x01 \x03\xf4\x02r\x02\x1a\x02~\x01\x7f\x01L\x01*\x01L\x01\x15\x01L\x01:\x01\'\x010\x01;\x01\xf3\x00\xeb\x00\xb2\x00\xad\x00\xb7\x00\xc0\x00\xa9\x00\xb3\x00\xa9\x00\x9e\x00\xa0\x00\xb6\x00\xba\x00\xb8\x00\xaf\x00\xca\x00\xd6\x00\xae\x00\xa8\x00\xbc\x00\xcf\x00\xa7\x00\xab\x00\xcc\x007\x01\xfc\x015\x03\xc1\x04\x93\x047\x03E\x02\xab\x02\xa5\x03q\x03J\x03\x88\x03\x02\x04\xc9\x04\xef\x04\x10\x05\xfc\x04\xec\x04\x03\x05\x95\x04L\x04\xc4\x03)\x03\xe3\x01b\x01\xa9\x02\x1b\x03\xb5\x02\'\x02\xaf\x01\x91\x01\x87\x01Z\x01\x0f\x01\x08\x01+\x01?\x01F\x01D\x01\x10\x01\xda\x00\xb9\x00\xa0\x00\xb9\x00\xbf\x00\xc0\x00\xb1\x00\xae\x00\xa4\x00\xa1\x00\x9c\x00\x9c\x00\xa1\x00\x9f\x00\xa5\x00\xba\x00\xb7\x00\xc2\x00\xc7\x00\xc8\x00\xc3\x00\xb5\x00 \x01\xb6\x01\xbd\x025\x03\xfc\x04F\x04\t\x03\xb5\x02q\x03\xd0\x03y\x03\xe7\x02\x9b\x02\xe5\x03>\x05\xc2\x04\xf4\x04\x06\x05;\x05\x12\x05\x01\x05\xf1\x04\xb3\x04G\x04\x89\x03\xae\x02H\x01r\x02\t\x03\xff\x02c\x02\xea\x01\x90\x01u\x01~\x01E\x01\x03\x01@\x014\x012\x01\xf5\x00\xd5\x00\xcb\x00\xa9\x00\x97\x00\xa6\x00\xb1\x00\xa0\x00\x9a\x00\x96\x00\x96\x00\xa1\x00\x9c\x00\x9f\x00\xae\x00\x94\x00\x93\x00\x98\x00\x9c\x00\xa9\x00\xa1\x00\xa4\x00\xe9\x00\xe9\x00n\x02\xa0\x03`\x04&\x05\x9e\x035\x03\xaf\x03\xd1\x03\xa5\x03\x01\x03\xb8\x01Z\x02\x95\x04y\x05W\x05\x9b\x05\xae\x05\xa6\x05\x82\x05:\x05>\x057\x05\xf7\x04\x97\x04\xac\x03\xc2\x02Q\x01A\x02\xeb\x02\xed\x02\xbd\x02A\x02\xb0\x01\x80\x01\x8c\x01c\x01=\x01\x03\x01!\x01\xf1\x00\xe0\x00\xba\x00\xb7\x00\x9b\x00\x8f\x00\xa1\x00\x95\x00\xb8\x00\x99\x00\xaa\x00\xa8\x00\xb0\x00\xba\x00\xb6\x00\xaf\x00\x96\x00\x8b\x00\x8a\x00\x99\x00\x8e\x00\x95\x00\x9d\x00\xf4\x00\x9e\x01\x93\x03\xa0\x04\xd1\x04\x9e\x03]\x03\x95\x03[\x03\xeb\x02\xf6\x01O\x01?\x02_\x05\xef\x05\x9a\x05\x96\x05w\x05\x8f\x05\x9c\x05\xa5\x05\xa9\x05\x92\x05b\x05\x01\x05\x9f\x04#\x04\x9a\x02|\x01Y\x02\xb3\x02\x9f\x02\xb6\x02b\x02\xc7\x01\xbc\x01\x8d\x01:\x01\x05\x01\x12\x01\x08\x01\xdd\x00\xd0\x00\xa8\x00\x9a\x00\x9a\x00\x8f\x00\x90\x00\x9f\x00\x9f\x00\xc5\x00\xa6\x00\xd6\x00\xe1\x00\xdf\x00\xc7\x00\xa3\x00\x96\x00\x95\x00\x8b\x00\x9c\x00\xa2\x00\x94\x00\x9d\x00\xaa\x00_\x01\xa6\x03\xaa\x04\x07\x05O\x04`\x03d\x02\x99\x01A\x01h\x01\xcc\x02\x01\x06"\x06\xdf\x05\x94\x05\xa2\x05\x85\x05w\x05u\x05\x7f\x05\x8e\x05\x99\x05\x92\x05i\x05\x15\x05\x9c\x04K\x03\x07\x02\x11\x02o\x02`\x02\x81\x02S\x02\xf4\x01\xb5\x01A\x01\xff\x00\x03\x01\n\x01\xf0\x00\xe1\x00\xb6\x00\xa2\x00\x9a\x00\x94\x00\x90\x00\x90\x00\xa1\x00\xa6\x00\xba\x00\xc9\x00\xa9\x00\xdb\x00\xbe\x00\xb5\x00\xa7\x00\xbe\x00\xa2\x00\x9a\x00\x94\x00\xaa\x00\xa0\x00\xa2\x00\xc1\x00\xc0\x002\x02o\x03,\x03[\x02\xbd\x01`\x01t\x01%\x02\xa0\x03|\x06K\x06\xe0\x05\xc9\x05\x9f\x05\xdc\x05\xdb\x05\xcc\x05\x93\x05o\x05E\x05 \x05\x08\x05\xfa\x04\xfd\x04\xfd\x04W\x04\xc6\x02\xcb\x01\'\x02\xf7\x01\'\x02\x1a\x02\xca\x01o\x01\x16\x01\xf5\x00\x11\x01\xe8\x00\xe2\x00\xc3\x00\xb1\x00\xa0\x00\x9a\x00\x96\x00\xa0\x00\x95\x00\xa3\x00\xb9\x00\xb2\x00\xb8\x00\xc8\x00\xb3\x00\xcb\x00\xb8\x00\xc8\x00\xb5\x00\xa2\x00\x97\x00\x9c\x00\xa3\x00\xc7\x00\xbe\x00\xbf\x00\xa2\x00\x86\x00\x7f\x00\x92\x00\xcd\x00i\x01V\x02\x89\x03\r\x05\xc0\x06\x1d\x06\x06\x06\xd7\x05\xaf\x05\x96\x05\x87\x05\xb5\x05\x88\x05\x8d\x05\x9a\x05\xca\x05\xa1\x05s\x05\xac\x05\x9f\x05i\x05\xb7\x04\xf5\x03\x94\x01\xe2\x01\xb6\x01\xaa\x01\xca\x01\xa6\x016\x01-\x01\xf7\x00\xd6\x00\x0b\x01\xc8\x00\xd5\x00\xad\x00\xab\x00\xa1\x00\xa5\x00\xa9\x00\xa1\x00\xa7\x00\xbb\x00\xc3\x00\xcb\x00\xca\x00\xcc\x00\xc8\x00\xbb\x00\xb8\x00\x9d\x00\xa6\x00\xa7\x00\xa2\x00\x9a\x00\xa5\x00\x00\x01u\x01\xbb\x028\x02\x95\x02\xf8\x02\xae\x03i\x04]\x05\xb1\x06O\x07\x7f\x06:\x06\xef\x05\xb5\x05\xa5\x05\xc9\x05\xd7\x05\x93\x05\x9f\x05\x0c\x06?\x06S\x060\x06\xde\x05}\x05\xff\x04\xc7\x04m\x04\xfb\x03y\x01\x8a\x01|\x01k\x01U\x01@\x01\x1d\x01\x01\x01\xda\x00\xd4\x00\xd5\x00\xff\x00\xdd\x00\xbf\x00\x9b\x00\xc2\x00\xac\x00\xa7\x00\xb7\x00\xae\x00\x9a\x00\xcb\x00\xb6\x00\xc7\x00\xc2\x00\xb1\x00\xa2\x00\x91\x00\x8f\x00\x97\x00\xb8\x007\x01\xd0\x01\xb4\x02\xde\x03\r\x05\x1b\x06\xfe\x06\x97\x07\xde\x07\n\x082\x08\r\x08\xe1\x07\xb5\x06\x98\x06\xf8\x05\xd7\x05\xc5\x05\xce\x05\x1f\x06\'\x06\x15\x06\xb0\x05\xa4\x05\x9c\x05\xb2\x05\x97\x05;\x05\xfa\x04\xba\x04\xa0\x04\xff\x03\x7f\x03^\x01\x86\x01\xa8\x01\x95\x01b\x01A\x01\x19\x01\xfc\x00\xee\x00\xe9\x00\xef\x00\xfc\x00\xe6\x00\xb0\x00\x94\x00\xa0\x00\xd0\x00\xbb\x00\xad\x00\xba\x00\xca\x00\xa5\x00\xb0\x00\xbd\x00\xc1\x00\xbb\x00\xad\x00\xe8\x00~\x01G\x02\xa3\x03\xa6\x04\x12\x06%\x07\xdf\x07\x05\x08\xe0\x07\xe6\x06]\x074\x07\x06\x07\xd8\x06\x7f\x06?\x06\x04\x06\xfe\x05\x0c\x06*\x06\xf3\x05\xaf\x05\x8b\x05\xa5\x05\xb9\x05\xb5\x05\xa3\x05M\x05N\x05@\x05\x02\x05\xc8\x04\xa9\x04U\x04\xcb\x03\x8e\x03N\x01\x90\x01\xaf\x01\x9e\x01n\x01J\x01#\x01\x0c\x01\x01\x01\x07\x01#\x01\xfb\x00\xcf\x00\xb7\x00\x9c\x00\xc0\x00\xcd\x00\xda\x00\xbc\x00\xad\x00\xa5\x00\xa6\x00\x9e\x00\xa5\x00\xd3\x00Q\x01\x1e\x02U\x03\xf1\x044\x06-\x07\xc9\x07\xfe\x07\xf1\x07\xb2\x07W\x07\xcb\x06\xde\x06A\x07A\x07#\x07\x9a\x06a\x066\x06G\x06i\x06j\x06E\x06\xd7\x05\xbf\x05s\x05t\x05n\x05\x84\x05@\x05\x1d\x05\r\x05\xdf\x04\xbc\x04\xa0\x04a\x04F\x04,\x04;\x04S\x01y\x01\x9d\x01\x94\x01\x89\x01x\x01a\x01G\x01\x1f\x01<\x01*\x01\xf4\x00\xf8\x00\xbf\x00\xb2\x00\xc0\x00\xd4\x00\xda\x00\xdf\x00\xc7\x00\xb6\x00\xb4\x00\x0e\x01c\x016\x02\x8d\x03\xc9\x04\xd7\x05\x8e\x06\xea\x06\xff\x06\xd7\x06\xb2\x06\x90\x06\x83\x06\x93\x06\xfe\x06\x02\x07\xd2\x06\xb3\x06\x8f\x06x\x06\x10\x06h\x06l\x06m\x06*\x06\t\x06\xc5\x05s\x05O\x054\x05\x10\x05\x12\x05\xd3\x04\xbd\x04\xb4\x04\xbd\x04\xc9\x04\xea\x04\x1c\x05&\x05B\x058\x05z\x01v\x01\xa6\x01\x9d\x01q\x01X\x01`\x01M\x01R\x01?\x01&\x01\xfb\x00\xf0\x00\xeb\x00\xcd\x00\xbb\x00\xb4\x00\xb8\x00\xbf\x00\xe4\x00\xc3\x00\t\x01\xf2\x01]\x03\x9c\x04\x9e\x05I\x06\xac\x06\x87\x06\xd5\x06\xa5\x06\xc2\x06\xc1\x06\xa9\x06d\x06\xaf\x06\xc3\x06\xc9\x06\xa3\x06\xb1\x06\x94\x06S\x06\xe8\x05\xd3\x05\xc3\x05\xcc\x05\xaf\x05\x9e\x05\x88\x05r\x05\xe6\x05\xeb\x05\xbf\x05\xab\x05\xa6\x05\xba\x05\xae\x05*\x05\xbe\x05\xc7\x05\xa9\x05Y\x05i\x04^\x03'
PixelData はデータが様々な異なる方法でストアされる場合があるため、すぐには役立たない場合が多いです。
- pixel 値は符号付き (= signed) or 符号なし (= unsigned) 整数 or 浮動小数点である可能性があります。
- 複数の画像フレームがある場合があります。
- フレーム毎に複数のプレーン (i.e. RGB) がある場合があり ピクセルの順序 が異なる場合があります。
- 画像データは利用可能な圧縮標準 (1.2.840.10008.1.2.4.50 JPEG Baseline, 1.2.840.10008.1.2.5 RLE Lossless 等) の一つを使用してエンコードされているかもしれません。エンコードされた画像データはまた カプセル化 されて各カプセル化された画像フレームは1 つ以上のフラグメントに分割されている場合があります。
pixel データの解釈における複雑性ゆえに、pydicom は便利な形式でそれを取得する簡単な方法を提供しています : Dataset.pixel_array です。
Dataset.pixel_array
Warning : Dataset.pixel_array は NumPy を必要とします。
Dataset.pixel_array は pixel データを含む numpy.ndarray を返します :
ds.pixel_array
ds.pixel_array.shape
array([[ 905, 1019, 1227, ..., 302, 304, 328], [ 628, 770, 907, ..., 298, 331, 355], [ 498, 566, 706, ..., 280, 285, 320], ..., [ 334, 400, 431, ..., 1094, 1068, 1083], [ 339, 377, 413, ..., 1318, 1346, 1336], [ 378, 374, 422, ..., 1369, 1129, 862]], dtype=int16) (64, 64)
pixel データが圧縮されている場合、必要な pixel データハンドラ の依存性が利用可能であると仮定すれば、pixel_array は圧縮されていないデータを返します。より多くの情報については handling compressed image data を参照してください。
データを変更するために NumPy を使用できますが、変更が保存される場合は、データセットの PixelData 要素に書き戻されなければなりません。
Warning : ndarray からバイトにデータを変換し戻すことは、特に multi 平面画像や圧縮が必要な場合には以下の例でのように簡単ではない場合があります。
# example: zero anything < 300
arr = ds.pixel_array
arr[arr < 300] = 0
ds.PixelData = arr.tobytes()
ds.save_as("temp.dcm")
幾つかの変更は他の DICOM タグが変更されることを必要とする場合があります。例えば、画像サイズが縮小される場合 (e.g., 512x512 画像が 256x256 に縮小される) Rows と Columns は適切に設定される必要があります。これらを貴方自身で明示的に設定しなければなりません ; pydicom はそれを自動的には行ないません。
例として Downsize MRI image using pydicom を参照してください。
pixel_array はまた表示のためにグラフィクスライブラリに画像データを渡すために使用できます。詳細は 画像の表示 を参照してください。
カラー空間
3 の (0028,0002) Samples per Pixel 値を持つ Pixel Data で pixel_array を使用するとき、返される pixel データは (0028,0004) Photometric Interpretation (e.g. RGB, YBR_FULL, YBR_FULL_422, etc) により与えられるカラー空間になります。
pydicom は convert_color_space() 関数を通して 8-bits/チャネルの YBR と RGB カラー空間の間の変換をする限定的な機能を提供します。カラー空間を変更するときは、一致させるために Photometric Interpretation の値も変更する必要があります。
Note : カラー空間の詳細については、DICOM Standard, Part 3, Section C.7.6.3.1 を参照してください。
パレットカラー
幾つかの DICOM データセットは検索テーブル (LUT) で出力画像ピクセル値をストアします、そこではピクセルデータの値は対応する LUT エントリへのインデックスです。データセットの Photometric Interpretation 値が PALETTE COLOR であれば RGB 画像を生成するために palette color LUT をピクセルデータに適用するために apply_color_lut() 関数が使用できます。
from pydicom.pixel_data_handlers.util import apply_color_lut
fname = get_testdata_file("OBXXXX1A.dcm")
ds = dcmread(fname)
arr = ds.pixel_array
rgb = apply_color_lut(arr, ds)
ピクセルデータの bit-depth が 8 ビットであれば、DICOM の良く知られたカラーパレット の一つを適用することも可能です。
from pydicom.pixel_data_handlers.util import apply_color_lut
fname = get_testdata_file("OBXXXX1A.dcm")
ds = dcmread(fname)
arr = ds.pixel_array
# You could also use the corresponding well-known SOP Instance UID
rgb = apply_color_lut(arr, palette='PET')
Note : 詳細は DICOM Standard, Part 3, Annexes C.7.6.3 と C.7.9 参照。
Modality LUT or Rescale 操作
DICOM Modality LUT モジュールは raw ピクセルデータ値を CT のための Hounsfield ユニットのような特定の (possibly unitless) 物理量に変換します。apply_modality_lut() 関数は変換された値を返すために raw 値の入力配列と Modality LUT モジュールを含むデータセットと共に使用できます。データセットが複数の grayscale 変換を必要とするとき、Modality LUT は常に最初に適用されます。
from pydicom.pixel_data_handlers.util import apply_modality_lut
fname = get_testdata_file("CT_small.dcm")
ds = dcmread(fname)
arr = ds.pixel_array
hu = apply_modality_lut(arr, ds)
VOI LUT or Windowing 操作
DICOM VOI LUT モジュールは入力値に VOI or windowing 操作を適用します。apply_voi_lut() 関数は VOI LUT or windowing を適用した値を返すために入力配列と void LUT モジュールを含むデータセットと共に使用できます。データセットが複数の VOI や windowing ビューを含むとき、index キーワード・パラメータを使用して特定のビューを返すことができます。
データセットが複数の grayscale 変換を必要とするとき、modality LUT か rescale 操作が既に適用されたことを仮定しています。
from pydicom.pixel_data_handlers.util import apply_voi_lut
fname = get_testdata_file("MR-SIEMENS-DICOM-WithOverlays.dcm")
ds = dcmread(fname)
arr = ds.pixel_array
out = apply_voi_lut(arr, ds, index=0)
以上
pydicom 2.2 : ユーザガイド : 画像の表示
pydicom 2.2 : 画像の表示 (翻訳/解説)
翻訳 : (株)クラスキャット セールスインフォメーション
作成日時 : 09/26/2021 (v2.2.1)
* 本ページは、pydicom の以下のドキュメントを翻訳した上で適宜、補足説明したものです:
- User Guide : Viewing Images
* サンプルコードの動作確認はしておりますが、必要な場合には適宜、追加改変しています。
* ご自由にリンクを張って頂いてかまいませんが、sales-info@classcat.com までご一報いただけると嬉しいです。
- 人工知能研究開発支援
- 人工知能研修サービス(経営者層向けオンサイト研修)
- テクニカルコンサルティングサービス
- 実証実験(プロトタイプ構築)
- アプリケーションへの実装
- 人工知能研修サービス
- PoC(概念実証)を失敗させないための支援
- テレワーク & オンライン授業を支援
- お住まいの地域に関係なく Web ブラウザからご参加頂けます。事前登録 が必要ですのでご注意ください。
- ウェビナー運用には弊社製品「ClassCat® Webinar」を利用しています。
◆ お問合せ : 本件に関するお問い合わせ先は下記までお願いいたします。
株式会社クラスキャット セールス・マーケティング本部 セールス・インフォメーション |
E-Mail:sales-info@classcat.com ; WebSite: https://www.classcat.com/ ; Facebook |
pydicom 2.2 : 画像の表示
DICOM 画像を見るために pydicom で他のパッケージを使用する方法
イントロダクション
pydicom はファイルの DICOM データ要素を取得することに主として関連していますが、ピクセルデータを画像として表示することが望まれる場合もよくあります。幾つかのオプションがあります :
- 利用可能な多くの DICOM ビュアー プログラムのいずれかを利用する
- matplotlib と共に pydicom を使用する
- Python の stdlib Tkinter モジュールと共に pydicom を使用する
- Python Imaging ライブラリ (PIL) と共に pydicom を使用する
- wxPython と共に pydicom を使用する
matplotlib と共に pydicom を使用する
matplotlib は https://matplotlib.org/ で利用可能です。それは Dataset.pixel_array から 2D 画像情報を取得してそれを表示することができます。ここにサンプルがあります :
import matplotlib.pyplot as plt
import pydicom
from pydicom.data import get_testdata_files
filename = get_testdata_files("CT_small.dcm")[0]
ds = pydicom.dcmread(filename)
ds.PatientID
'1CT1'
ds.PatientAge
'000Y'
ds.pixel_array
array([[175, 180, 166, ..., 203, 207, 216], [186, 183, 157, ..., 181, 190, 239], [184, 180, 171, ..., 152, 164, 235], ..., [906, 910, 923, ..., 922, 929, 927], [914, 954, 938, ..., 942, 925, 905], [959, 955, 916, ..., 911, 904, 909]], dtype=int16)
type(ds.pixel_array)
numpy.ndarray
plt.imshow(ds.pixel_array, cmap=plt.cm.bone)
plt.imshow(ds.pixel_array, cmap='gray')
plt.imshow(65535 - ds.pixel_array, cmap='gray')
Tkinter と共に pydicom を使用する
contrib-pydicom レポジトリのプログラム pydicom_Tkinter.py は、殆どの Python インストールでデフォルトで装備される Tkinter グラフィクス・システムを使用して画像を表示する方法を実演します。それは Label ウィジェットかユーザ提供のウィジェットで Tkinter PhotoImage を作成します。
Python Imaging ライブラリ (PIL) と共に pydicom を使用する
contrib-pydicom レポジトリのモジュール pydicom_PIL.py は、pixel データとそれについての幾つかの基本的な情報 (bit depth, LUTs, etc) から Image インスタンスを作成した後、PIL の Image.show() メソッドを使用します。
wxPython と共に pydicom を使用する
contrib-pydicom レポジトリのモジュール imViewer-Simple.py は wxPython (PIL も、しかし厳密には必要ないかもしれないと記されています) を使用して pydicom データセットから画像を表示します。
以上
pydicom 2.2 : ユーザガイド : コア要素
pydicom 2.2 : ユーザガイド : コア要素 (翻訳/解説)
翻訳 : (株)クラスキャット セールスインフォメーション
作成日時 : 09/20/2021 (v2.2.1)
* 本ページは、pydicom の以下のドキュメントを翻訳した上で適宜、補足説明したものです:
- User Guide : Core elements in pydicom
* サンプルコードの動作確認はしておりますが、必要な場合には適宜、追加改変しています。
* ご自由にリンクを張って頂いてかまいませんが、sales-info@classcat.com までご一報いただけると嬉しいです。
- 人工知能研究開発支援
- 人工知能研修サービス(経営者層向けオンサイト研修)
- テクニカルコンサルティングサービス
- 実証実験(プロトタイプ構築)
- アプリケーションへの実装
- 人工知能研修サービス
- PoC(概念実証)を失敗させないための支援
- テレワーク & オンライン授業を支援
- お住まいの地域に関係なく Web ブラウザからご参加頂けます。事前登録 が必要ですのでご注意ください。
- ウェビナー運用には弊社製品「ClassCat® Webinar」を利用しています。
◆ お問合せ : 本件に関するお問い合わせ先は下記までお願いいたします。
株式会社クラスキャット セールス・マーケティング本部 セールス・インフォメーション |
E-Mail:sales-info@classcat.com ; WebSite: https://www.classcat.com/ ; Facebook |
pydicom 2.2 : ユーザガイド : コア要素
Dataset は直接扱う主要オブジェクトです。Dataset は辞書をラップします、そこではキーは DICOM タグ (下で説明される、BaseTag オブジェクトとして) で、値は対応する DataElement インスタンス (これも下で説明されます) です。それは dict の殆どのメソッドを実装していますので、殆どの場合それはラップされた dict のように動作します。これは以下で示されるように、タグを介してデータ要素への直接アクセスを可能にします。
Dataset は直接作成できますが、通常は既存の DICOM ファイルを読むことにより取得します :
import pydicom
from pydicom.data import get_testdata_file
# get some test data
filename = get_testdata_file("rtplan.dcm")
ds = pydicom.dcmread(filename)
その文字列 (str() or reprt()) 値を単純にプリントすることによりデータセット全体を表示できます :
ds
Dataset.file_meta ------------------------------- (0002, 0000) File Meta Information Group Length UL: 156 (0002, 0001) File Meta Information Version OB: b'\x00\x01' (0002, 0002) Media Storage SOP Class UID UI: RT Plan Storage (0002, 0003) Media Storage SOP Instance UID UI: 1.2.999.999.99.9.9999.9999.20030903150023 (0002, 0010) Transfer Syntax UID UI: Implicit VR Little Endian (0002, 0012) Implementation Class UID UI: 1.2.888.888.88.8.8.8 ------------------------------------------------- (0008, 0012) Instance Creation Date DA: '20030903' (0008, 0013) Instance Creation Time TM: '150031' (0008, 0016) SOP Class UID UI: RT Plan Storage (0008, 0018) SOP Instance UID UI: 1.2.777.777.77.7.7777.7777.20030903150023 (0008, 0020) Study Date DA: '20030716' (0008, 0030) Study Time TM: '153557' (0008, 0050) Accession Number SH: '' (0008, 0060) Modality CS: 'RTPLAN' (0008, 0070) Manufacturer LO: 'Manufacturer name here' (0008, 0080) Institution Name LO: 'Here' (0008, 0090) Referring Physician's Name PN: '' (0008, 1010) Station Name SH: 'COMPUTER002' (0008, 1040) Institutional Department Name LO: 'Radiation Therap' (0008, 1070) Operators' Name PN: 'operator' (0008, 1090) Manufacturer's Model Name LO: 'Treatment Planning System name here' (0010, 0010) Patient's Name PN: 'Last^First^mid^pre' (0010, 0020) Patient ID LO: 'id00001' (0010, 0030) Patient's Birth Date DA: '' (0010, 0040) Patient's Sex CS: 'O' (0018, 1020) Software Versions LO: 'softwareV1' (0020, 000d) Study Instance UID UI: 1.22.333.4.555555.6.7777777777777777777777777777 (0020, 000e) Series Instance UID UI: 1.2.333.444.55.6.7777.8888 (0020, 0010) Study ID SH: 'study1' (0020, 0011) Series Number IS: '2' (300a, 0002) RT Plan Label SH: 'Plan1' (300a, 0003) RT Plan Name LO: 'Plan1' (300a, 0006) RT Plan Date DA: '20030903' (300a, 0007) RT Plan Time TM: '150023' (300a, 000c) RT Plan Geometry CS: 'PATIENT' (300a, 0010) Dose Reference Sequence 2 item(s) ---- (300a, 0012) Dose Reference Number IS: '1' (300a, 0014) Dose Reference Structure Type CS: 'COORDINATES' (300a, 0016) Dose Reference Description LO: 'iso' (300a, 0018) Dose Reference Point Coordinates DS: [239.531250000000, 239.531250000000, -741.87000000000] (300a, 0020) Dose Reference Type CS: 'ORGAN_AT_RISK' (300a, 0023) Delivery Maximum Dose DS: '75.0' (300a, 002c) Organ at Risk Maximum Dose DS: '75.0' --------- (300a, 0012) Dose Reference Number IS: '2' (300a, 0014) Dose Reference Structure Type CS: 'COORDINATES' (300a, 0016) Dose Reference Description LO: 'PTV' (300a, 0018) Dose Reference Point Coordinates DS: [239.531250000000, 239.531250000000, -751.87000000000] (300a, 0020) Dose Reference Type CS: 'TARGET' (300a, 0026) Target Prescription Dose DS: '30.826203' --------- (300a, 0070) Fraction Group Sequence 1 item(s) ---- (300a, 0071) Fraction Group Number IS: '1' (300a, 0078) Number of Fractions Planned IS: '30' (300a, 0080) Number of Beams IS: '1' (300a, 00a0) Number of Brachy Application Setups IS: '0' (300c, 0004) Referenced Beam Sequence 1 item(s) ---- (300a, 0082) Beam Dose Specification Point DS: [239.531250000000, 239.531250000000, -751.87000000000] (300a, 0084) Beam Dose DS: '1.0275401' (300a, 0086) Beam Meterset DS: '116.0036697' (300c, 0006) Referenced Beam Number IS: '1' --------- --------- (300a, 00b0) Beam Sequence 1 item(s) ---- (0008, 0070) Manufacturer LO: 'Linac co.' (0008, 0080) Institution Name LO: 'Here' (0008, 1040) Institutional Department Name LO: 'Radiation Therap' (0008, 1090) Manufacturer's Model Name LO: 'Zapper9000' (0018, 1000) Device Serial Number LO: '9999' (300a, 00b2) Treatment Machine Name SH: 'unit001' (300a, 00b3) Primary Dosimeter Unit CS: 'MU' (300a, 00b4) Source-Axis Distance DS: '1000.0' (300a, 00b6) Beam Limiting Device Sequence 2 item(s) ---- (300a, 00b8) RT Beam Limiting Device Type CS: 'X' (300a, 00bc) Number of Leaf/Jaw Pairs IS: '1' --------- (300a, 00b8) RT Beam Limiting Device Type CS: 'Y' (300a, 00bc) Number of Leaf/Jaw Pairs IS: '1' --------- (300a, 00c0) Beam Number IS: '1' (300a, 00c2) Beam Name LO: 'Field 1' (300a, 00c4) Beam Type CS: 'STATIC' (300a, 00c6) Radiation Type CS: 'PHOTON' (300a, 00ce) Treatment Delivery Type CS: 'TREATMENT' (300a, 00d0) Number of Wedges IS: '0' (300a, 00e0) Number of Compensators IS: '0' (300a, 00ed) Number of Boli IS: '0' (300a, 00f0) Number of Blocks IS: '0' (300a, 010e) Final Cumulative Meterset Weight DS: '1.0' (300a, 0110) Number of Control Points IS: '2' (300a, 0111) Control Point Sequence 2 item(s) ---- (300a, 0112) Control Point Index IS: '0' (300a, 0114) Nominal Beam Energy DS: '6.0' (300a, 0115) Dose Rate Set DS: '650.0' (300a, 011a) Beam Limiting Device Position Sequence 2 item(s) ---- (300a, 00b8) RT Beam Limiting Device Type CS: 'X' (300a, 011c) Leaf/Jaw Positions DS: [-100.00000000000, 100.000000000000] --------- (300a, 00b8) RT Beam Limiting Device Type CS: 'Y' (300a, 011c) Leaf/Jaw Positions DS: [-100.00000000000, 100.000000000000] --------- (300a, 011e) Gantry Angle DS: '0.0' (300a, 011f) Gantry Rotation Direction CS: 'NONE' (300a, 0120) Beam Limiting Device Angle DS: '0.0' (300a, 0121) Beam Limiting Device Rotation Direc CS: 'NONE' (300a, 0122) Patient Support Angle DS: '0.0' (300a, 0123) Patient Support Rotation Direction CS: 'NONE' (300a, 0125) Table Top Eccentric Angle DS: '0.0' (300a, 0126) Table Top Eccentric Rotation Direct CS: 'NONE' (300a, 0128) Table Top Vertical Position DS: None (300a, 0129) Table Top Longitudinal Position DS: None (300a, 012a) Table Top Lateral Position DS: None (300a, 012c) Isocenter Position DS: [235.711172833292, 244.135437110782, -724.97815409918] (300a, 0130) Source to Surface Distance DS: '898.429664831309' (300a, 0134) Cumulative Meterset Weight DS: '0.0' (300c, 0050) Referenced Dose Reference Sequence 2 item(s) ---- (300a, 010c) Cumulative Dose Reference Coefficie DS: '0.0' (300c, 0051) Referenced Dose Reference Number IS: '1' --------- (300a, 010c) Cumulative Dose Reference Coefficie DS: '0.0' (300c, 0051) Referenced Dose Reference Number IS: '2' --------- --------- (300a, 0112) Control Point Index IS: '1' (300a, 0134) Cumulative Meterset Weight DS: '1.0' (300c, 0050) Referenced Dose Reference Sequence 2 item(s) ---- (300a, 010c) Cumulative Dose Reference Coefficie DS: '0.9990268' (300c, 0051) Referenced Dose Reference Number IS: '1' --------- (300a, 010c) Cumulative Dose Reference Coefficie DS: '1.0' (300c, 0051) Referenced Dose Reference Number IS: '2' --------- --------- (300c, 006a) Referenced Patient Setup Number IS: '1' --------- (300a, 0180) Patient Setup Sequence 1 item(s) ---- (0018, 5100) Patient Position CS: 'HFS' (300a, 0182) Patient Setup Number IS: '1' (300a, 01b2) Setup Technique Description ST: '' --------- (300c, 0002) Referenced RT Plan Sequence 1 item(s) ---- (0008, 1150) Referenced SOP Class UID UI: RT Plan Storage (0008, 1155) Referenced SOP Instance UID UI: 1.9.999.999.99.9.9999.9999.20030903145128 (300a, 0055) RT Plan Relationship CS: 'PREDECESSOR' --------- (300c, 0060) Referenced Structure Set Sequence 1 item(s) ---- (0008, 1150) Referenced SOP Class UID UI: RT Structure Set Storage (0008, 1155) Referenced SOP Instance UID UI: 1.2.333.444.55.6.7777.88888 --------- (300e, 0002) Approval Status CS: 'UNAPPROVED'
Note : サンプルプログラム dcm_qt_tree.py を使用して DICOM ファイルを折り畳み式のツリーで見ることもできます。
DICOM キーワードやタグナンバーにより特定の要素にアクセスできます :
ds.PatientName
ds[0x10,0x10].value
'Last^First^mid^pre' 'Last^First^mid^pre'
タグナンバーを直接使用するとき DataElement インスタンスが返されますので、値を得るために DataElement.value が使用される必要があります。
Warning : pydicom では、private データ要素は名前を角括弧で囲んで表示されます (名前が pydicom に知れている場合)。これらは便宜上表示されているだけです ; 括弧内の記述的な名前はデータ要素を取得するためには使用できません。Private Data Elements の詳細を見てください。
要素のキーワードやタグナンバーを使用して要素の値を設定することもできます :
ds.PatientID = "12345"
ds.SeriesNumber = 5
ds[0x10,0x10].value = 'Test'
pydicom はメンバー変数のリクエストをインターセプトして、それらが DICOM 辞書にあるか確認しますので、名前の使用が可能です。それはキーワードを (group, element) タグに変換してそのタグの対応する値を (それがデータセットに存在すれば) 返します。
データ要素の削除と割当ての使用例については Anonymize DICOM data を参照してください。
Note : pydicom の Sequence の使用を理解するには、このオブジェクトモデルを参照してください :
- Dataset (Python dict をラップする)
- DataElement インスタンスを含みます、各要素の値は以下の一つです :
- int, float, str, bytes 等の通常の数値、文字列またはテキスト値
- 通常の値のリスト (e.g. a 三次元座標)
- Sequence インスタンス、ここで Sequence は Dataset インスタンスのリストです。
- Where each Dataset contains DataElement instances, and so on…
- DataElement インスタンスを含みます、各要素の値は以下の一つです :
シークエンス要素の値は Python リストをラップする Sequence インスタンスです。シークエンスの項目は Python の慣習のようにインデックス 0 で始まる、番号で参照されます。
ds.BeamSequence[0].BeamName
# Or, set an intermediate variable to a dataset in the list
beam1 = ds.BeamSequence[0] # First dataset in the sequence
beam1.BeamName
'Field 1'
Working with sequences を参照してください。
DICOM キーワードの使用はデータ要素にアクセスするために推奨される方法ですが、以下のように、タグナンバーを直接使用することもできます :
# Same thing with tag numbers - much harder to read:
# Really should only be used if DICOM keyword not in pydicom dictionary
ds[0x300a,0xb0][0][0x300a,0xc2].value
'Field 1'
正確な要素タグやキーワードを覚えていないか知らない場合、Dataset は便利な Dataset.dir() メソッドを提供しています、対話的セッションの間 Python プロンプトで役立ちます :
ds.dir()
['AccessionNumber', 'ApprovalStatus', 'BeamSequence', 'DoseReferenceSequence', 'FractionGroupSequence', 'InstanceCreationDate', 'InstanceCreationTime', 'InstitutionName', 'InstitutionalDepartmentName', 'Manufacturer', 'ManufacturerModelName', 'Modality', 'OperatorsName', 'PatientBirthDate', 'PatientID', 'PatientName', 'PatientSetupSequence', 'PatientSex', 'RTPlanDate', 'RTPlanGeometry', 'RTPlanLabel', 'RTPlanName', 'RTPlanTime', 'ReferencedRTPlanSequence', 'ReferencedStructureSetSequence', 'ReferringPhysicianName', 'SOPClassUID', 'SOPInstanceUID', 'SeriesInstanceUID', 'SeriesNumber', 'SoftwareVersions', 'StationName', 'StudyDate', 'StudyID', 'StudyInstanceUID', 'StudyTime']
ds.dir("pat")
['PatientBirthDate', 'PatientID', 'PatientName', 'PatientSetupSequence', 'PatientSex']
Dataset.dir() は、キーワード (case insensitive) で指定された文字列を任意の場所に持つ、データセット内部の非プライベート要素キーワードを返します。
Note : 引数を渡さずに Dataser.dir() を呼び出すとデータセットの総ての非プライベート要素キーワードのリストを返します。
_dicom_dict.py ファイルを参照することにより pydicom が知る総ての名前を見ることもできます。それは通常は必要ないはずですが、add_dict_entry() や add_dict_entries() を使用して独自のエントリを DICOM 辞書に実行時に追加することができます。同様に、using add_private_dict_entry() か add_private_dict_entries() を使用してプライベートデータ要素をプライベート辞書に追加できます。
内部的には、Dataset は各項目に対する DataElement オブジェクトをストアしますが、キーワード (e.g. ds.PatientName) によりアクセスされるときは DataElement の値だけが返されます。オブジェクト自身が必要な場合には、(公式 DICOM 要素のための) キーワードかタグナンバーのいずれかを使用して項目にアクセスできます。
# reload the data
ds = pydicom.dcmread(filename)
elem = ds['PatientName']
elem.VR, elem.value
# an alternative is to use:
elem = ds[0x0010,0x0010]
elem.VR, elem.value
('PN', 'Last^First^mid^pre')
Dataset が特定の要素を含むか確認するには要素のキーワードかタグで in 演算子を使用します :
"PatientName" in ds # or (0x0010,0x0010) in ds
True
Dataset から要素を削除するには del 演算子を使用します :
del ds.SoftwareVersions # or del ds[0x0018, 0x1020]
(7FE0,0010) Pixel Data を扱うには、PixelData キーワードで raw バイトが利用可能です :
# read data with actual pixel data
filename = get_testdata_file("CT_small.dcm")
ds = pydicom.dcmread(filename)
pixel_bytes = ds.PixelData
けれども numpy.ndarray を返す Dataset.pixel_array を使用するほうが遥かに便利です (NumPy ライブラリが必要です) :
arr = ds.pixel_array
arr
array([[175, 180, 166, ..., 203, 207, 216], [186, 183, 157, ..., 181, 190, 239], [184, 180, 171, ..., 152, 164, 235], ..., [906, 910, 923, ..., 922, 929, 927], [914, 954, 938, ..., 942, 925, 905], [959, 955, 916, ..., 911, 904, 909]], dtype=int16)
詳細は、Pixel データの操作 を参照してください。
DataElement
DataElement クラスは通常はユーザコードで直接使用されませんが、Dataset により広範に使用されます。DataElement は単純なオブジェクトで以下のものをストアします :
- タグ – 要素のタグ (BaseTag オブジェクトとして)
- VR – 要素の値表現 – 保存されている値の形式に表わす 2 文字 str
- VM – 要素の int としての多重性 (= Value Multiplicity)。これは value の内容から自動的に決定されます。
- value – 要素の実際の値。数字や文字列のような通常の値 (or VM > 1 ならばそれらのリスト)、または Sequence。
タグ
一般には Tag() はユーザコードでは直接使用されません、上記のセクションで示されたようにキーワードを使用して要素を割当てたり読むときに BaseTag が自動的に作成されるからです。
BaseTag クラスは int から派生してるので、実際には、幾つかの追加動作を伴う単なる数値です :
- Tag() は BaseTag のインスタンスを作成するために使用され、DICOM タグが想定される 4 バイト (group, element) に収まることを強制します。
- BaseTag インスタンスは int または (group,element) を含むタプルからか、DICOM キーワードから作成できます :
from pydicom.tag import Tag t1 = Tag(0x00100010) # all of these are equivalent t2 = Tag(0x10,0x10) t3 = Tag((0x10, 0x10)) t4 = Tag("PatientName") t1 type(t1) t1==t2, t1==t3, t1==t4
(True, True, True)
- タグのグループと要素部分を返すための BaseTag.group と BaseTag.elem。
- BaseTag.is_private プロパティはタグがプライベート・タグを表わすか否か (i.e. グループ・ナンバーが奇数か) を確認します。
シークエンス
シークエンス は Python のリストから派生しています。追加された唯一の機能は文字列表現をより良くする (= prettier) ことです。それ以外の項目の選択、append 等のリストの通常の総てのメソッドは利用可能です。
以上