บทความนี้อธิบายวิธี Java ในการแยกวิเคราะห์ไฟล์ภาพการแพทย์ DCM และการแยกข้อมูลไฟล์ แบ่งปันสำหรับการอ้างอิงของคุณดังนี้:
1. การติดตั้ง
ก่อนอื่นให้ไปที่ GitHub เพื่อดาวน์โหลดซอร์สโค้ดแล้วดำเนินการติดตั้ง MVN สำหรับการติดตั้งในพื้นที่ พื้นที่เก็บข้อมูลกลาง Maven ไม่มีขวด - หลังจากการติดตั้งที่ประสบความสำเร็จสิ่งต่อไปนี้มีดังนี้:
จากนั้นแนะนำแพ็คเกจ JAR ในไฟล์ pom.xml:
<Ederency> <roupID> org.dcm4che </groupId> <ratifactid> dcm4che-core </artifactid> <cersion> 3.3.2 </version> </derness>
2. การทดสอบหมวดหมู่
/** * ProjectName: XXX * ชื่อไฟล์: displayTag.java * packagename: com.xxxx.xxxx.common.util * วันที่: 2018-03-26 10:07 * Copyright (C) 2017-2020 XXX Company */Package Com.gz. java.io.file; นำเข้า java.io.ioexception; นำเข้า java.sql.time นำเข้า java.util.arrays; นำเข้า java.util.date นำเข้า java.util.logging.level; นำเข้า Java.util.logging.logger; org.dcm4che3.data.elementDictionary; นำเข้า org.dcm4che3.data.fragments; นำเข้า org.dcm4che3.data.equence; นำเข้า org.dcm4che3.data.tag; org.dcm4che3.io.dicominputstream; นำเข้า org.dcm4che3.io.dicomoutputstream; นำเข้า org.dcm4che3.util.safeclose; นำเข้า java.awt.image.raster; นำเข้า Java.io.ioexception; @className: DisplayTag * @packagename: com.xxxx.xxxx.common.util * @description: แท็กการแยกวิเคราะห์ * @data: 2018-03-26 10:07 **/คลาสสุดท้ายของสาธารณะ DICOMOMPUTSTREAM DIN; ผลการเรียนการสอนแบบสองเท่าส่วนตัว; สตริงส่วนตัวผลลัพธ์ = null; ผลการเรียนสองครั้งส่วนตัว 2 = NULL; Private String nom = null; สตริงส่วนตัว nounstring = null; ส่วนตัว int val2 = 0; Valeurreturn ส่วนตัว; noununit สตริงส่วนตัว = null; ส่วนตัวคงที่ double resultfacteurdix = 0; ค่าสองค่าส่วนตัว paterpatial = null; สตริงส่วนตัว noununitRatio = null; dicominputstream ส่วนตัว; ถ่านสุดท้ายคงที่ [] hex_digits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; dicomencodingoptions ส่วนตัว cencopts = dicomencodingoptions.default; เอกชน elementDictionary dict = elementDictionary.getStandardelementDictionary (); Public DisplayTag (ไฟล์ไฟล์) {ลอง {setObject (loadDicOmObject (ไฟล์)); } catch (ioexception ex) {logger.getLogger (displaytag.class.getName ()). log (level.severe, null, ex); }} / ** * อ่านข้อมูลเมตาของ dicom 3.0 * @param f: ไฟล์อินพุต * @return แอตทริบิวต์ * @throws ioexception * / แอตทริบิวต์คงที่สาธารณะ loaddicomobject (ไฟล์ f) โยน ioexception {if (f == null) {return null; } else {dicominputstream dis = new dicominputstream (f); //attr.setspecificaracterset("gbk "); return dis.readDataset (-1, -1); }} / ** * ใส่การรวมตัว * @param obj * / โมฆะสาธารณะ setObject (แอตทริบิวต์ obj) {this.obj = obj; } / ** * การให้คุณลักษณะของข้อมูลเมตา * @return * / แอตทริบิวต์คงที่สาธารณะ getObject () {return obj; } / ** * แสดงข้อมูลเมตา * @param ไฟล์: ไฟล์ inout * @throws ioexception * / สตริงสาธารณะ readtagdicom (ไฟล์ไฟล์) พ่น IOException {din = new dicominputStream (ไฟล์); Object = din.readFileMetainformation (); ค่าสตริง = object.toString (); Object = din.readDataset (-1, -1); ค่าส่งคืน; } / ** * Permet d'Afficher l'heure d'une valeur dicom en มาตรฐานสากล yyyy.mm.dd / อนุญาตเวลาแสดงในรูปแบบ yyyy.mm.dd * @param แท็ก: valeur du แท็ก / int tag * @param valuebool DD.MM.YYYYY * @Param ValuEnoun: "dot" mettre la วันที่ en รูปแบบ yyyyy.mm.dd ou dd.mm.yyyyy sinon en รูปแบบ yyyy mm dd ou dd mm yyyyy/ "dot" mm yyyyy * @return afficher le string du แท็ก Selon le มาตรฐานสากล/ สตริงส่งคืนวันที่ * @throws ioexception */ สตริงสาธารณะ dicomdate (แท็ก int, boolean valueBool, string valuenoun) พ่น IOException {ถ้า (getObject (getObject () String tagdayFomat = formatDate (tagValue, valueBool, valuEnoun); กลับ tagdayfomat; } else {return null; }}/ ** * Permet d'Afficher l'heure d'une valeur dicom en มาตรฐานสากล yyyy.mm.dd/ ใบอนุญาตแสดงเวลาในข้อมูลเมตาสำหรับ yyyy.mm.dd * @param Object * @param แท็ก: Valeur du แท็ก/ ค่าของแท็ก @param ค่า รูปแบบจริง yyyy.mm.dd else dd.mm.yyyy * @param valuenoun: "dot" mettre la วันที่ en รูปแบบ yyyyy.mm.dd ou dd.mm.yyyyy sinon en รูปแบบ yyyy mm dd ou dd mm yyyy/dot yyyy mm หรือ dd mm yyyy * @return afficher le string du tag selon le standard นานาชาติ/ return สตริงวันที่ * @throws ioexception */ สตริงคงที่สาธารณะ dicomdate (แอตทริบิวต์วัตถุ, แท็ก int, boolean valuebool, สตริง Valuenoun) FormatDate (TagValue, ValueBool, ValuEnoun); return tagdayfomat; yyyy mm dd หรือ dd mm yyyyy *@return */public String String FormatDate (สตริง numero, boolean valueBool, string valuenoun) {ถ้า (numero.matches ("^[0-9] *$")) == true) {// รูปแบบ yyyy.mm.dd สำหรับ (int i = 0, j = numero.length (); i <j; i ++) {r.append (numero.charat (i)); R.Append ('.'); Valuenoun.equals ("dot")) {r.append ('.'); ) {ถ้า (valuenoun == null? "dot" == null: valuenoun.equals ("dot") {r.append ('.'); ถัดไปที่ดัชนีหนึ่งและอื่น ๆ สำหรับการจัดทำดัชนีอาร์เรย์ GetheaderDateValue (String tagnr) {return getheaderDateValue (totagint (tagnr)); แปลงการแสดงสตริงของหมายเลขส่วนหัว * เช่น 0008,0010 เป็นจำนวนเต็มที่สอดคล้องกันเป็น 0x00080010 * ตามที่ใช้ใน @See org.dcm4che2.data.tag * @param Headernr เช่น 0008,0010 * @return 0x00080010 integer.parseint (headernr.replaceall (",", ""), 16); แท็กของ vr = da * @param tagnr: "0000,0010" * @param dicomobj * @return * / วันที่สาธารณะ getheaderdatevalue (สตริง tagnr, แอตทริบิวต์ dicomobj) {return getheaderdatevalue (totagint (tagnr), dicomobj); */String สาธารณะ textDicom (สตริง num) {num = num.replaceall ("//^+", ""); Object.getStrings (TAG); // ตารางการแปลงในรายการสตริง String tagvalue = arrays.aslist (tagValue2) .toString (); TagValue2 [] = Object.getStrings (Tag); // ตารางการแปลงในรายการสตริงสตริง tagvalue = displaytag.arraytoString (tagvalue2, "//"); ArrayToString (String [] A, String Separator) {StringBuffer Result = New StringBuffer (); hh.mm.ss * (0008,0030) ในเวลาการศึกษา * (0008,0031) ในเวลาซีรีย์ S * (0008,0032) ในเวลาการซื้อกิจการ * (0008,0033) ที่เวลาภาพ * @param แท็ก: การให้แท็ก * @return * @throws if (getObject (). มี (แท็ก) == true) {String tagvalue = getObject (). getString (แท็ก); * (0008,0030) ในเวลาการศึกษา * (0008,0031) ในเวลาซีรีย์ S * (0008,0032) เวลาการซื้อกิจการ S * (0008,0033) ที่เวลาภาพ S * @param แท็ก: การให้แท็ก * @return * @throws ioexception */ สตริงสาธารณะ ) {String tagvalue = getObject (). getString (แท็ก); * (0008,0033) ที่เวลาภาพ * @param วัตถุ: metadata * @param แท็ก: ค่า dicom * @return สตริงค่าใหม่ * @throws ioexception */ สตริงสาธารณะ dicomtime2 System.out.println (formattime (tagvaluenotdot)); (0008,0033) ที่เวลาภาพ * @param วัตถุ: metadata * @param แท็ก: ค่า dicom * @return สตริงค่าใหม่ * @throws ioexception */ สตริงสาธารณะ dicomtime3 /** * อ่านค่า int จาก dicomheader * @param tagnr แท็กเพื่ออ่าน * @กลับค่าค่าเป็น int * /public int getheaderintegervalue (int tagnr) {return getObject () getint (tagnr, 0); "0008,0102#0054,0220" เพื่อรับการออกแบบรูปแบบการเข้ารหัสหลังจากดูลำดับรหัส * @return int */ public int getheaderintegervalue (String tagnr) {return getheaderintegervalue (totagint (tagnr)); CONTERESEDERTAG (String tagnr) {return contentsheadertag (totagint (tagnr));} /** * ตรวจสอบว่าส่วนหัวมีแท็กที่กำหนด * @param tagnr * @return * /บูลีนสาธารณะ @return */ สตริงคงที่ getheadername (int tagnr) {return dict.keywordof (tagnr); กลับมา ";}} / ** * ส่งคืนการแสดงสตริงของฟิลด์ส่วนหัวที่กำหนด * ถ้ามันมีอยู่ในส่วนหัว * @param tagnr * @return * / สตริงสาธารณะ getheader }} string private String toElementString (สตริง dcmele, int tag) {StringBuffer SB = new StringBuffer (); . Append (Object.tags ()). ต่อ (: ") .append (dcmele); แปลงการแสดงสตริงของหมายเลขส่วนหัว * เช่น 0008,0010 เป็นจำนวนเต็มที่สอดคล้องกันเป็น 0x00080010 * ตามที่ใช้ใน @See org.dcm4che2.data.tag * @param Headernr เช่น 0008,0010 * @return 0x00080010 integer.parseint (headernr.replaceall (",", ""), 16); ";} return num; R.Append (numero.charat (i)); (numero.matches ("^[0-9].*$")) {StringBuilder r = new StringBuilder (); R.ToString ();} return numero; SetFactorPower (10,2) // 10^2 * @param result3 * @param factor * @return * @return */สาธารณะ setfactorpower แบบคงที่ (สองผลลัพธ์ 3, ปัจจัยสองเท่า) @param dcmobj * @return */ สาธารณะคงที่ int [] lattricepixeldata (แอตทริบิวต์ dcmobj) {int [] data = dcmobj.getints (tag.pixeldata); ioexception {int [] data = getObject (). getints (tag.pixeldata); dcmobj.getbytes (tag.pixeldata); Pixeldata * @param Raster ของ Dicom * @return */private int [] [] ExtractData (แรสเตอร์แรสเตอร์) {int w = raster.getWidth (); getMyImage (); int [] [] data = new int [h] [w]; getPixelData (int [] [] data2) {int h = data2.length; } return Array; *dicomobject obj = dis.readdicomobject (); *สตริง nounvalue [] = getValue (obj, แท็ก); (i <ผู้ป่วย ณ additional_tags.length) {สำหรับ (int tag: penter_additional_tags) {ค่า [i] = object.getString (แท็ก); * @param tag: vr = sq * @return */ public string [] readitem (file inputfile, int tag) {displaytag dcm = new DisplayTag (InputFile); แอตทริบิวต์ attr = seq.get (i); Valuestring = null; vr = sq * @param tag: * - regionspatialformat * - regionDatatype * - physicalUnitsxdirection * - physicalUnitsxDirection * - PixelComponentPhysicalUnits * * * @Param ผล: ค่าสตริง */ หน่วย void สาธารณะ Integer.valueof (ผลลัพธ์) .intvalue (); // convertie en int สวิตช์ (val2) {กรณีที่ 5: setnoununit ("กราฟิก"); this.setNoununit ("M-mode (เนื้อเยื่อหรือการไหล)"); Integer.valueof (ผลลัพธ์). intvalue (); // convertie en int สวิตช์ (val2) {กรณีที่ 12: setnoununit ("Orther ทางสรีรวิทยา (แอมพลิจูด); SetNounUnit ("DT TRACE"); setNounUnit("CW Spectral Doppler"); break; case 3: this.setNounUnit("PW Spectral Doppler"); break; case 2: this.setNounUnit("Color Flow"); break; case 1: this.setNounUnit("Tissue"); break; case 0: this.setNounUnit("None or not applicable"); break; default: break; } switch (result) {Case "A" กรณี "f": this.setNoununit ("backscatter แบบรวม"); Switch (Val2) {กรณีที่ 9: SetNounUnit ("CM*CM.PIXEL/SEC"); สิ่งนี้ SetNounUnit ("Hertz/Pixel"); ; setNouneNUNIT ("ไม่ได้ใช้งานได้ }} ถ้า (tag == tag.pixelComponentDatatype) {val2 = integer.valueof (ผลลัพธ์) .intvalue (); BREAK; สิ่งนี้ SetNounUnit ("เนื้อเยื่อ"); รายการ/ ความเป็นเอกภาพของรายการ * @param noununit * @return this.noununit = noununit */ สตริงสาธารณะ setNoununit (สตริงคำนาม) {ส่งคืนสิ่งนี้ noununit = noununit; / ** * อัตราส่วนพิเศษเชิงพื้นที่ toutes les units sont en mm/ ให้อัตราส่วนแท็กเชิงพื้นที่ของ mm * @param แท็ก: entree choisi * - physicalunitsxdirection * - physterunitsydirection * -pixelcomponentphysicalunits * * @param ผล tag.physicalunitsxdirection || tag == tag.physicalunitsydirection || tag == tag.pixelComponentPhysicalUnits) SetFacteurpuissance (10,1); Settagitemdoubleratio (ค่า Patial2); // Prend La Valeur Setnoununitratio ("mm*mm/pixel"); สิ่งนี้ SetNoununitratio ("Hertz/Pixel"); สิ่งนี้ SetNoununitratio ("DB/Pixel"); SetFacteurpuissance (10,2); SettagiteMdoubleratio (ค่า patial4); // prend la valeur this.setnoununit ("mm*mm*mm*pixel/sec"); @return */Public SettagiteMdoubleratio (ค่าสองค่า patial) {return this.valuespatial = valuepatial; Put and Computing Power * @param result3 * @param fasteur * @return * @return */ สาธารณะ setfacteurpuissance แบบคงที่ (สองผลลัพธ์ 3, fasteur สองครั้ง) {return resultfacteurdix = math.pow (ผลลัพธ์ 3, facteur); ResultFacteeUrdix; รายการ DESS./Giving Unity รายการ * @return le nom de l'unité */ สตริงสาธารณะ getNoununitRatio () {return noununitRatio; }/ ** * Prend la valeur interne d'un tag item/ ใส่รายการแท็ก * @param result * @return */ public String settagitem (ผลลัพธ์สตริง) {return this.result = ผลลัพธ์; }/** * Donne la Valeur du tag rachercher/ให้ค่าของแท็ก seek * @return le string de la valeur rachercher du tag dans un รายการ */สตริงสาธารณะ getvaleurtagitem () {ผลการส่งคืน; }/ ** * Prend la valeur interne d'un tag item/ ใส่ tag value itemù * @return */ public double settagitemdouble (double result2) {return this.result2 = result2; }/** * donne la valeur du tag rachercher/ให้ค่าแท็ก * @return le double de la valeur rachercher du tag dans un รายการ */สาธารณะ double getvaleurtagitemdouble () {ผลตอบแทน 2; } / ** * อ่านค่าสตริงจากแท็ก dicom (dcm4che2) * @param tagnr แท็กเพื่ออ่าน * @return ค่าเป็นสตริง * ส่งคืนชุดอักขระเฉพาะที่กำหนดโดยชุดอักขระเฉพาะแอตทริบิวต์ (0008,0005) * ของชุดข้อมูลนี้ แอตทริบิวต์ elem = getObject (); Elem.SetSpecificCharacterset ("GB18030"); String val = elem.getString (tagnr); if (val == null) {val = ""; } return val; } catch (exception e) {return ""; }} / ** * อ่านค่าสตริงจากแท็ก DICOM (dcm4che2) * @param tagnr แท็กเพื่ออ่าน * @กลับค่าค่าสตริง * ส่งคืนชุดอักขระเฉพาะที่กำหนดโดยชุดอักขระเฉพาะ (0008,0005) * ของชุดข้อมูลนี้ {system.out.println (222); แอตทริบิวต์ elem = getObject (); Elem.SetSpecificCharacterset ("GB18030"); String [] val = elem.getStrings (tagnr); กลับมาวาล; } catch (exception e) {return null; }} / ** * อ่านค่าสตริงจาก dicomheader * @param tagnr แท็กที่จะอ่าน * @param dcmelement * @ @ @ส่งกลับค่าเป็นสตริง * / สตริงสาธารณะ getheaderstringValue (แอตทริบิวต์ dcmelement, int tagnr) /* dcmelement.setspecificaracterset ("iso_ir 100"); */ dcmelement.setspecificaracterset ("GB18030"); String val = dcMelement.getString (tagnr); if (val == null) {val = ""; } return val; } catch (exception e) {return ""; }} / ** * อ่านแท็ก (กลุ่ม, องค์ประกอบ) * @param Headernr เช่น "0018,0050" เพื่อรับความหนาของชิ้น <br> * @@Return String * / สตริงสาธารณะ getheaderstringValue กลับ getheaderstringValue (totagint (headernr)); } / ** * ให้เวลากับแท็ก ("xxxx,") * @param tagnr * @return * / เวลาสาธารณะ GetheaderTimeValue (String tagnr) {return getheadertimeValue (totagint (tagnr)); } / ** * ให้เวลากับแท็ก * @param tagnr * @return time * / เวลาสาธารณะ getheadertimevalue (int tagnr) {time time = getheaderstringValue (tagnr); if (time.length ()! = 6) {return null; } ลอง {int hour = integer.parseint (time.substring (0,2)); int min = integer.parseint (time.substring (2,4)); int sec = integer.parseint (time.substring (4,6)); กลับมาเวลาใหม่ (ชั่วโมง, นาที, วินาที); } catch (exception e) {} return null; } /** * ดึงหัวเฉพาะที่อยู่ในแท็ก anotehr * หรือ "0008,0102, 0054,0220" เพื่อรับตัวออกแบบรูปแบบการเข้ารหัสหลังจากลำดับรหัสดู * @return สตริง * * @param taghierarchy; เช่น {tag.uid, tag.sopinstanceuid, tag.codemeaning} * @return */ สตริงสาธารณะ getheadervalueinsidetag (int [] taghierarchy) {ลอง {สำหรับ (int i = 0; i <taghierarchy.length-1; i ++) }} catch (exception e) {String tags = ""; สำหรับ (int i = 0; i <taghierarchy.length; i ++) {tags += totagstring (taghierarchy [i]) +""; } กลับ ""; } return null; } / ** * แปลงการแสดง int ของหมายเลขส่วนหัว * เช่น 0x00080010 เป็นสตริงที่สอดคล้องกัน 0008,0010 * @return 0008,0010 เป็นสตริง * / สตริงคงที่สาธารณะ totagstring (int tagnr) {return shorttohex (tagnr >> 16) + ' } สตริงคงที่สาธารณะ shorttohex (int val) {char [] ch = char ใหม่ [4]; shorttohex (val, ch, 0); ส่งคืนสตริงใหม่ (CH); } public StringBuffer ShorttoHex (int val, StringBuffer SB) {sb.append (hex_digits [(val >> 12) & 0xf]); sb.append (hex_digits [(val >> 8) & 0xf]); sb.append (hex_digits [(val >> 4) & 0xf]); sb.append (hex_digits [val & 0xf]); กลับ SB; } โมฆะคงที่สาธารณะ ShorttoHex (int val, char [] ch, int ปิด) {ch [ปิด] = hex_digits [(val >> 12) & 0xf]; ch [ปิด+1] = hex_digits [(val >> 8) & 0xf]; ch [ปิด+2] = hex_digits [(val >> 4) & 0xf]; ch [ปิด+3] = hex_digits [val & 0xf]; } / ** * สร้างไฟล์เอาต์พุต dicom * @param fileoutput: ไฟล์เอาท์พุท * @throws ioexception * * * * * * * * * * * * / โมฆะสาธารณะ writeto (ไฟล์ fileoutput, แอตทริบิวต์ fmi, แอตทริบิวต์วัตถุ) dos.setencodingoptions (encopts); dos.writedataset (fmi, วัตถุ); dos.finish (); dos.flush (); } / ** * writting * @param fileOutput * @param h * @param w * @throws ioexception * / โมฆะสาธารณะ writeTosegment (ไฟล์ fileoutput, int h, int w) พ่น IOException {dicomoutputStream dos = dicomoutputtream ใหม่ (ไฟล์ใหม่ dos.setencodingoptions (encopts); } / ** * สร้างการซ้อนทับใน PixelData * @Param Object * / Public Void OverlayCreate (วัตถุแอตทริบิวต์) {int position = Object.getInt (tag.overlaybitposition, 0); ถ้า (ตำแหน่ง == 0) {return; } int บิต = 1 << ตำแหน่ง; int [] pixels = object.getInts (tag.pixeldata); จำนวน int = 0; สำหรับ (int pix: pixels) {int overlay = pix & bit; พิกเซล [นับ ++] = Pix - ซ้อนทับ; } Object.setInt (tag.pixeldata, vr.ow, พิกเซล); } /*** dicom.setstring (tag.performingPhysicianName, vr.pn, "ฌอง"); dicom.setstring (tag.admittingdiagnosesdescription, vr.lo, "chu"); ลำดับ seq = diCom.newence (tag.anatomicregionequence, 0); แอตทริบิวต์ dicom2 = แอตทริบิวต์ใหม่ (); * @param dicom */ public void setitem (แอตทริบิวต์ dicom, int tagequencename) {ลำดับ seq = dicom.newence (tagequencename, 0); dicom.setstring (tag.codingschemedesignator, vr.sh, "srt"); dicom.setstring (tag.codevalue, vr.sh, "t-aa000"); dicom.setstring (tag.codemeaning, vr.lo, "eye"); seq.add (dicom); } โมฆะคงที่สาธารณะหลัก (สตริง [] args) พ่นข้อยกเว้น {ไฟล์ไฟล์ = ไฟล์ใหม่ ("c: // ผู้ใช้ // fendo // เอกสาร // ไฟล์ wechat // fen_do // files // 1234.dcm"); displayTag d = new DisplayTag (ไฟล์); @suppresswarnings ("การเข้าถึงแบบคงที่") แอตทริบิวต์ attrs = d.loaddicomobject (ไฟล์); // เอาต์พุต System.out.out.println ("ข้อมูลทั้งหมด:" + attrs); // รับแถว int แถว = attrs.getInt (tag.rows, 1); // รับคอลัมน์คอลัมน์ int = attrs.getInt (tag.columns, 1); // หน้าต่างความกว้างหน้าต่างลอย win_center = attrs.getFloat (tag.windowCenter, 1); float win_width = attrs.getFloat(Tag.WindowWidth, 1); System.out.println("" + "row=" + row + ",columns=" + row + ",row*columns = " + row * columns); String patientName = attrs.getString(Tag.PatientName, ""); System.out.println("Name:" + patientName); //Birthday String patientBirthDate = attrs.getString(Tag.PatientBirthDate, ""); System.out.println("Birthday: " + patientBirthDate); //Institution String institution = attrs.getString(Tag.InstitutionName, ""); System.out.println("Institution: " + institution); //Site String station = attrs.getString(Tag.StationName, ""); System.out.println("Site: " + station); //Manufacturer String Manufacturer = attrs.getString(Tag.Manufacturer, ""); System.out.println("Manufacturer: " + Manufacturer); //Manufacturer Model String ManufacturerModelName = attrs.getString(Tag.ManufacturerModelName, ""); System.out.println("ManufacturerModelName: " + ManufacturerModelName); //Description--Atrial String description = attrs.getString(Tag.StudyDescription, ""); System.out.println("Description--Atrial: " + Description); //Description--Specific String SeriesDescription = attrs.getString(Tag.SeriesDescription, ""); System.out.println("Description--Specific: " + SeriesDescription); //Description time String studyData = attrs.getString(Tag.StudyDate, ""); System.out.println("Description time: " + studyData); byte[] bytename = attrs.getBytes(Tag.PatientName); System.out.println("Name: " + new String(bytename,"gb18030")); byte[] bytesex = attrs.getBytes(Tag.PatientSex); System.out.println("Gender: " + new String(bytesex,"gb18030")); -输出如下:
所有信息: (0008,0005) CS [ISO_IR 100] SpecificCharacterSet
(0008,0008) CS [ORIGINAL/PRIMARY] ImageType
(0008,0016) UI [1.2.840.10008.5.1.4.1.1.1.1] SOPClassUID
(0008,0018) UI [1.2.840.113619.2.203.4.2147483647.1486521160.448521] SOPInstan
(0008,0020) DA [20170208] StudyDate
(0008,0021) DA [20170208] SeriesDate
(0008,0022) DA [20170208] AcquisitionDate
(0008,0023) DA [20170208] ContentDate
(0008,002A) DT [20170208103237.000000] AcquisitionDateTime
(0008,0030) TM [103154.000] StudyTime
(0008,0031) TM [103158.000] SeriesTime
(0008,0032) TM [103237.000] AcquisitionTime
(0008,0033) TM [103240.000] ContentTime
(0008,0050) SH [T77792] AccessionNumber
(0008,0060) CS [DX] Modality
(0008,0068) CS [FOR PRESENTATION] PresentationIntentType
(0008,0070) LO ["GE Healthcare"] Manufacturer
(0008,0080) LO [HeFei RICH] InstitutionName
(0008,0081) ST [Not Initialized
Not Initialized
HeFei
AnHui
Not Initialize(0008,0090) PN [] ReferringPhysicianName
(0008,1010) SH [082407110134] StationName
(0008,1030) LO [ACHEST] StudyDescription
(0008,103E) LO [Chest] SeriesDescription
(0008,1040) LO [Not Initialized] InstitutionalDepartmentName
(0008,1050) PN [] PerformingPhysicianName
(0008,1090) LO ["Definium 6000"] ManufacturerModelName
(0008,1110) SQ [] ReferencedStudySequence
(0008,1120) SQ [] ReferencedPatientSequence
(0008,2112) SQ [1 Items] SourceImageSequence
>Item #1
>(0008,1150) UI [1.2.840.10008.5.1.4.1.1.1.1.1] ReferencedSOPClassUID
>(0008,1155) UI [1.2.840.113619.2.203.4.2147483647.1486521157.927189] Referenc
(0008,2218) SQ [1 Items] AnatomicRegionSequence
>Item #1
>(0008,0100) SH [T-D3000] CodeValue
>(0008,0102) SH [SNM3] CodingSchemeDesignator
>(0008,0104) LO [Chest] CodeMeaning
(0010,0010) PN [zhang^xiao di] PatientName
(0010,0020) LO [T77792] PatientID
(0010,0030) DA [19860618] PatientBirthDate
(0010,0032) TM [] PatientBirthTime
(0010,0040) CS [F] PatientSex
(0010,1010) AS [030Y] PatientAge
(0010,1030) DS [] PatientWeight
(0011,0010) LO [GEMS_GDXE_FALCON_04]
(0011,1003) UI [1.2.840.113619.2.203.4.2147483647.1486521118.562807]
(0011,1004) CS [SE]
(0011,1005) UI [1.2.840.113619.2.203.4.2147483647.1486521152.970120]
(0011,1006) DS [0.083936]
(0011,1009) SL [0]
-
row=2021,columns=2021,row*columns = 4084441
姓名:zhang^xiao di
生日:19860618
机构:HeFei RICH
站点:082407110134
制造商:"GE Healthcare"
制造商模型:"Definium 6000"
描述--心房:ACHEST
描述--具体:Chest
描述时间:20170208
姓名: zhang^xiao di
性别: F
更多关于java算法相关内容感兴趣的读者可查看本站专题:《Java文件与目录操作技巧汇总》、《Java数据结构与算法教程》、《Java操作DOM节点技巧总结》和《Java缓存操作技巧汇总》
ฉันหวังว่าบทความนี้จะเป็นประโยชน์กับการเขียนโปรแกรม Java ของทุกคน