Cet article décrit la méthode Java pour analyser les fichiers d'image médicale DCM et extraire les informations de fichier. Partagez-le pour votre référence, comme suit:
1. Installation
Tout d'abord, allez sur GitHub pour télécharger le code source, puis exécutez MVN Installer pour l'installation locale. Le référentiel Maven Central n'a pas le pot. . Après une installation réussie, ce qui suit est le suivant:
Présentez ensuite le package JAR dans le fichier pom.xml:
<dependency> <proupId> org.dcm4che </rompuprid> <letifactive> dcm4che-core </refactive> <version> 3.3.2 </-version> </dependency>
2. Catégorie de test
/ ** * projectName: xxx * nom de fichier: displaytag.java * packageName: com.xxxx.xxxx.common.util * Date: 2018-03-26 10:07 * Copyright (c) 2017-2020 xxx Company * / package com.gz.aster java.io.file; import java.io.ioexception; import java.sql.time; import java.util.array org.dcm4che3.data.elementDictionary; import org.dcm4che3.data.fragments; import org.dcm4che3.data.sence; import org.dcm4che3.data.tag; import org.dcm4che3.data.vr; org.dcm4che3.io.dicominputStream; import org.dcm4che3.io.dicomoutputStream; import org.dcm4che3.util.safeclose; import java.awt.image.raster; import java.io.ioException; import java.util. * @classname: displaytag * @packagename: com.xxxx.xxxx.common.util * @description: tag analyse * @data: 2018-03-26 10:07 ** / public final class displaytag {private static attributs obj = null, object = null; Din de dicominputStream statique privé; STATIQUE STATIQUE privé Double ResultFactordix; Résultat de chaîne privée = null; Double résultat privé2 = null; String privé nom = null; String privé NounString = null; private int val2 = 0; Int privé Valeurreturn; chaîne privée nomnit = null; STATIQUE STATIQUE privé Double ResultFactEurDix = 0; Private double valeurspatial = null; chaîne privée nomnitratio = null; privé dicominputstream dis; Char final statique privé [] hex_digits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; Incoptions privées dicomencodingOptions = dicomencodingoptions.default; Private Static ElementDictionary dict = elementDictionary.getStandDarementDictionary (); public displayTag (fichier file) {try {setObject (loadDicomObject (fichier)); } catch (ioException ex) {logger.getLogger (displaytag.class.getName ()). log (niveau.severe, null, ex); }} / ** * Lire les métadonnées de DICOM 3.0 * @param f: Fichier d'entrée * @return Attributes * @throws ioException * / public static Attributes LoadDicomObject (fichier f) lance ioException {if (f == null) {return null; } else {diCoMinputStream dis = new diCoMinputStream (f); //attr.setspecificCharacterset("gbk "); return dis.readDataset (-1, -1); }} / ** * put attribute * @param obj * / public void setObject (attributs obj) {this.obj = obj; } / ** * Attribut de métadonnées * @return * / Attributs statiques publics getObject () {return obj; } / ** * Afficher les métadonnées * @param fichier: file inout * @throws ioException * / public String readTagDicom (fichier file) lève ioException {din = new DiCcominputStream (fichier); object = din.readFileMetainFormation (); String value = object.toString (); object = din.readDataset (-1, -1); valeur de retour; } / ** * Permet d'Afficher l'Heure d'Un Valeur DICOM EN Standard International Yyy.mm.dd / permis Temps d'affichage au format Yyy.mm.dd * @param Tag: Valeur du Tag / Int Tag * @param Valuebool: Si True Format Yyyy.mm.dd Format Dd. yyyy.mm.dd else dd.mm.yyyyy * @param valluenoun: "dot" mettre la date en format yyyyy.mm.dd ou dd.mm.yyyyy sinon en format yyyy mm dd ou dd mm yyyyy / "dot" put yyyymm.ddd or dd.mm.dd or dd.mm. yyyy mm ou dd mm yyyyy * @return afficher le string du balise selon le standard international / return string date * @throws ioexception * / public String diComDate (int tag, boolean valuebool, string valluenoun) lance ioException {if (getObject (). continu (tag) ==) {string tagvalue = getTring (tag) ==) {String tagvalue = GetTring (tag) ==) {String TagValue = GetTring (GetTring); String TagDayFomat = FormatDate (TagValue, ValueBool, Valuenoun); return tagdayFomat; } else {return null; }} / ** * permet d'Afficher L'Heure d'Un Valeur DICOM en Standard International Yyyy.mm.dd / Permis Afficher un temps dans les métadonnées pour yyyy.mm.dd * @param objet * @Param Tag: Valeur Du Tag / Value of Tag * @param Valuebool: Si True Format Yyyy.mm.dd Format Dd.mm.Mm.M.M.MM.MM.DD Format Dd.mm. Si vrai format yyyy.mm.dd else dd.mm.yyyyy * @param valluenoun: "dot" mettre la date en format yyyyy.mm.dd ou dd.mm.yyyyy sinon en format yyyy mm dd ou dd mm yyyy / dot "put yyyy.mm.ddd or dd.m.dd or dd.mm.yyy.mm.ddd or dd.m.dd or dd.mm.yyy.mm.ddd or dd.mm.dd or dd.mm.yyy.mm.ddd or dd.m.dd or dd.mm.yyy.mm.ddd or dd.mm.dd Or Dd. else yyyy mm ou dd mm yyyy * @return afficher le string du tag selon le standard international / return string date * @throws ioexception * / public static string dicomDate (attributes objet, int balise, boolean dalebool, string valluenoun) lance ioexception {string tagValue = object.getString (tag); Formatdate (TagValue, ValueBool, Valuenoun); au format yyyy mm dd ou dd mm yyyyy * @return * / public static static formatdate (string numero, booléen babebool, string valluenoun) {if (numero.matches ("^ [0-9] * $")) {// if la chaîne de caractère est un nombre ou unifre. == true) {// Format yyyy.mm.dd pour (int i = 0, j = numero.length (); i <j; i ++) {r.append (numero.charat (i)); R.APPED ('. Valuenoun.equals ("DOT")) {R.APPED ('. ) {if (Valuenoun == null? "DOT" == NULL: Valuenoun.equals ("DOT")) {R.APPEND ('. à l'index, et ainsi de suite, comme pour l'indexation du tableau. GetHederDateValue (String Tagnr) {return getHenerDateValue (totagint (tagnr); La représentation de chaîne d'un numéro d'en-tête * par exemple 0008,0010 à l'entier correspondant comme 0x00080010 * comme utilisé dans @see org.dcm4che2.data.tag * @param headernr eg 0008,0010 * @return 0x00080010 comme int * / public static int totagint (String Headernr) {return {return Integer.parseint (Headernr.replaceAll ("," "), 16);} / ** * Lire la valeur de valeur de vr = da * @param tagnr * @param dicomobj * @return * / public GetHenerDateValue (INTÉ de vr = da * @param tagnr: "0000,0010" * @param dicomobj * @return * / public date getheaderDateValue (String tagnr, attributes diComObj) {return gethederDateValue (TOTAGINT (Tagnr), dicomobj); Static String TextDicom (String num) {num = num.replaceAll ("// ^ +", ""); Dans List to String String TagValue = Arrays.aslist (TagValue2) .ToString (); Object.getStrings (tag); // Tableau de conversion dans la liste en chaîne TagValue = affichagetag.arraytoString (tagvalue2, "//"); séparateur) {StringBuffer Result = new StringBuffer (); (0008,0030) Au moment de l'étude * (0008,0031) à l'heure de la série * (0008,0032) à S Time d'acquisition * (0008,0033) à l'image S Time * @param Tag: Giving Tag * @return * @throws ioException * / public String diComtime (int tag) lance ioException {if (getoBject (). TagVALUe = GetObject (). GetString (Tag); String TagValuenotDot = FormatNotDot (TagValue); (0008,0031) Aux S le moment de la série * (0008,0032) à S Time d'acquisition * (0008,0033) à l'image S Time * @param Tag: Giving Tag * @return * @throws ioException * / public String dicomtimeTotal (int) lance ioException {if (getObject (). Contiains (Tag) == GetObject (). GetString (tag); String TagTimeFomat = FormAttimes (TagValue); AT S Time d'image * @param objet: Metadata * @param Tag: Value DICOM * @return New Value String * @throws ioException * / public String diComTime2 (Attributs Object, int tag) lance ioException {String TagValue = Object.getString (Tag); System.out.println (FormAttime (TagValuenotDot); String TagTimeFomat = FormAttimes (TagValuenotdot); (0008,0033) AT SIGNIFICATION SUR L'IMAGE * @Param Objet: Metadata * @Param Tag: Value DICOM * @ReTurn NOUVELLE VALEUR * @throws ioException * / String TagValue = Object.getString (Tag); * lit une valeur int à partir du dicomheader * @param tagnr la balise à lire * @return la valeur comme int * / public int getheDerIntegerValue (int tagnr) {return getObject (). getInt (tagnr, 0); "0008,0102 # 0054,0220" Pour obtenir le concepteur du schéma de codage après la séquence de code de vue * @return int * / public int getHenerIntegerValue (String Tagnr) {return GetheDerIntegerValue (TotagInt (Tagnr)); contendsheadterag (string tagnr) {return contenantsheadertag (totagint (tagnr));} / ** * vérifie si l'en-tête contient la balise donnée * @param tagnr * @return * / public boolean ContatSheadtag (int tagnr) {return getObject (). Contient (Tagnr); * / public static String getHenername (int tagnr) {return dict.keywordof (tagnr);} / ** * Renvoie le nom du champ d'en-tête donné * @param tagnr * @return le nom du champ Eg Nom * / public String Getheadername (Tagnr); }} / ** * Renvoie la représentation de la chaîne du champ d'en-tête donné * Si il existe dans l'en-tête * @param tagnr * @return * / public String GetHeader (int tagnr) {try {String dcmele = getObject (). GetString (Tagnr); static String ToelementsTring (String dcmele, int tag) {stringBuffer sb = new StringBuffer (); int tag [] = getObject (). Tags (); ") .APPEND (dcmele); return sb.toString ();} / ** * vérifie que les deux en-tête sont vides ou non * @return * / public boolean isEempty () {if (getObject () == null || getObject (). isEempty ()) {return true;} return false;} / ** * converts la représentation de la chaîne * 0008,0010 à l'entier correspondant comme 0x00080010 * comme utilisé dans le @see org.dcm4che2.data.tag * @param headernr par exemple 0008,0010 * @return 0x00080010 en tant qu'int * / public static int totagint2 (string headhernr) {retour enter 16); rès @param Numero * @return * / public static String FormAttime (String Numero) {if (Numero.matches ("^ [0-9] * $")) {StringBuilder r = new StringBuilder (); 1))) {R.Anex pour (int i = 0, j = numero.Length (); i <j; i ++) {R.AnPEnd (Numero.Charat (i)); @return Nouvelle valeur * / Double plancher public (double a, int n) {double p = math.pow (10.0, n); Facteur) {return resultFactordix = math.pow (result3, factor);} / ** * donnant GetFactorPower * / public static Double GetFactorPower () {return resultFactordix; DCMOBJ.getInts (Tag.PixelData); dcmobj * @return * @throws ioException * / public byte [] lattrepixeldatabytes (attributs dcmobj) lance ioException {byte [] data = dcmobj.getbytes (tag.pixeldata); LATTRICEPIXELDATABYTE2 () lance ioException {Byte [] Data = GetObject (). GetBytes (Tag.Pixeldata); raster.getheight (); = raster.getsample (x, y, 0);}} Retourne les données;} / ** * x = 0; x <w; x ++) {int index = y * w + x; * FileInputStream fis = new FileInputStream (FileInput); Patient_additional_tags) {String [] value = new String [patient_additional_tags.Length]; int i = 0; } // System.out.print (valeur [0] + "/ n"); // System.out.print (valeur [1]);} RETOUR Seq = dcm.getObject (). InputFile: Fichier d'entrée * @Param Tagsq: Tag vr = SQ * @Param Tag: Tag à l'intérieur vr = SQ * @ReTurn * / Public String Tagitem (File InputObject, New Displaytag (InputFile); seq.get (0); PixelComponentPhysicalUnits * * * * @param Résultat: Valeur String * / public void Unit (int balise, string result) {if (tag == tag.RegionspatialFormat) {Val2 = Integer.Valueof (result) .IntNalunit ("Graphics"). Form (traces physiologiques, traces doppler, ... "); pause; cas 3: setNoununit (" Spectral (CW ou PW Doppler "); Break; Cas 2: this.setNoununit (" Mode M (tissu ou flux) "); Break; Cas 1: this.SetNoununit (" NONE ou non ou non; Break; SetNoun, "Trace"); Trace "); Break; Cas 4: setNounUnit (" CW Spectral Doppler "); Break; Cas 3: this.setNoununit (" PW Spectral Doppler "); Break; Cas 2: this.setNoununit (" Couleur Flow "); Break; Cas 1: This.SetNounit (" Tissue "); casque; Cas 0: This.Setnounnit (" None ou Not-application "); Case; Case 0: This. Break; Bar "); Break; case" f ": this.setNounUnit (" Intégration de rétrodiffusion "); Break; Default: return;}} else if (tag == tag.physicalunitsxdirection || tag == tag.physicalunitsxdirection || tag == tag.pixelcomponentPhysicalunits) {val2 = Integer.Valueof (Résultat) .IntVALUe (); // Convertit en intratignotant (VAL2) {case 9: SetNoununit (CM * CM.PIXEL / SEC "); Cet. this.setnounnit (pourcentage / pixel "); "C": this.setNounUnit ("Degrees"); br eak; case 7: setNounUnit("Color bar"); break; case 6: this.setNounUnit("Gray bar"); break; case 5: this.setNounUnit("Color Flow Intensity"); break; case 4: setNounUnit("Color Flow Variance"); break; case 3: this.setNounUnit("Color Flow Velocity"); break; case 2: this.setNounUnit("Spectral Doppler "); Break; Cas 1: this.setNoununit (" Tissue "); cass ERENCISTRE L'UNÉ des articles / Put Unity of Items * @param nomnit * @return this.noununit = nonenit * / public string setNoununit (String nonenit) {return this.noununit = nonunit; RETOURN NOUNIT;} / ** * RATION SPÉCIAL SPATIAL TOUTES LES UNITS SONT EN MM / RATION DE TAG (Tag == tag.physicalunitsxdirection || tag == tag.physicalunitsydirection || tag == tag.PixelComponentPhysicalUnits) {val2 = Integer.Valueof (result) .IntValue (); // convertie en int switch (Val2) {case 9: double valeurspatal1 = getValeUrtagitemDou publerat () * SetfacterpuiSse (10,1); SettagitemDoubleratio (ValuesPatial2); // Prend La Valeur SetNoununitratio (mm * mm / pixel "); this.setnounnitratio (Hertz / pixel "); this.setNoununitratio (DB / Pixel "); SetfacterpuiSse (10,2); SettagitemDoubleratio (ValuesPatial4); // Prend la Valeur this.setNoununit ("mm * mm * mm * pixel / sec"); @return * / public double settagitemdoubleratio (double valeurspatial) {return this.valuespatial = valeurspatial;} / ** * DONNE LA VALEUR DU RATIO / VALEUR DE LA PLANCHE Power de calcul * @param résultat3 * @param factEur * @return * @return * / public static double setfacteurpuiSse (Double result3, double factEur) {return resultFactEurdix = math.pow (result3, factEur); ResultFacTEurDix;} / ** * ERGISTRE L'unite des éléments / Put Unity Unity Item des items./giving items d'unité * @return le nom de l'unité * / public string getNoununitratio () {return nonunitratio; } / ** * PREND LA VALEUR INTERNE D'UN Élément de balise / élément de balise de put * @param résultat * @return * / public String Settagitem (String result) {return this.result = result; } / ** * DONNE LA VALEUR DU TAG RACHERCHER / DONNEUR UNE VALEUR DE TAG SECHER * @return le String de la Valeur Rachercher du Tag dans un élément * / Public String GetValeUrtagitem () {Retour Result; } / ** * PREND LA VALEUR INTERNE D'UN TAGE ITEM / PUT LE TAG VALEUR ITEMMù * @return * / public double settagitemDouble (Double Result2) {return this.result2 = result2; } / ** * DONNE LA VALEUR DU TAG RACHERCHER / Giving the Value Tag * @return le double de la valeur Rachercher du Tag dans un élément * / public double getValeUrtagitemDouble () {return result2; } / ** * lit une valeur de chaîne à partir de la balise diCom (dcm4che2) * @param tagnr la balise à lire * @return la valeur en tant que chaîne * Renvoie le jeu de caractères spécifique défini par un jeu de caractères spécifique à l'attribut (0008 0005) * de cet ensemble de données racine, s'il s'agit d'un ensemble de données imbriqué contenu dans une séquence * / publique GetheDitulesTringValue (TVRA elem = getObject (); elem.SetSpecificCharAtterset ("GB18030"); String val = elem.getString (tagnr); if (val == null) {val = ""; } return val; } catch (exception e) {return ""; }} / ** * Lire une valeur de chaîne à partir de la balise diCom (dcm4che2) * @param tagnr la balise à lire * @return la valeur en tant que chaîne * renvoie le jeu de caractères spécifique défini par un jeu de caractères spécifique d'attribut (0008 0005) * de cet ensemble de données racine, s'il s'agit d'un ensemble de données bizarres (Try Eleme * / Public String [] gethederstringStringSt {System.out.println (222); Attributs elem = getObject (); elem.SetSpecificCharAtterset ("GB18030"); String [] val = elem.getStrings (tagnr); Retour Val; } catch (exception e) {return null; }} / ** * Lire une valeur de chaîne à partir du dicomheader * @param tagnr la balise à lire * @param dcMelement * @return la valeur en tant que chaîne * / public string gethederstringValue (attributes dcMelement, int bagnr) {try {System.out.println (333); / * dcMelement.SetSpecificCharAtteTet ("ISO_IR 100"); * / dcMelement.SetSpecificCharAtteTet ("GB18030"); String val = dcMelement.getString (tagnr); if (val == null) {val = ""; } return val; } catch (exception e) {return ""; }} / ** * lit la balise (groupe, élément) * @param headernr par exemple "0018,0050" pour obtenir une épaisseur de tranche <br> * @return string * / public string gethederstringValue (String Headernr) {headernr = headernr.replaceall ("xx", "00"). Replateall ("xx", "00"); return getherstringValue (totagint (headernr)); } / ** * Donner du temps une balise ("xxxx,") * @param tagnr * @return * / public time getHenerTimeValue (string tagnr) {return getHenerTimeValue (totagint (tagnr)); } / ** * Donner du temps une balise * @param tagnr * @return Time * / public Time GetHenerTimeValue (int tagnr) {String Time = GethederstringValue (Tagnr); if (time.length ()! = 6) {return null; } essayez {int hour = Integer.ParseInt (time.substring (0,2)); int min = Integer.ParseInt (time.substring (2,4)); int sec = Integer.ParseInt (time.substring (4,6)); retourner le nouveau temps (heure, min, sec); } catch (exception e) {} return null; } / ** * Récupère une endire spécifique qui se trouve à l'intérieur de la balise anotehr * ou "0008,0102, 0054,0220" pour obtenir le concepteur de schéma de codage après la séquence de code de vue * @return String * * @param taghierarchy; par exemple {tag.uid, tag.sopinstanceUID, tag.codemeaning} * @return * / public string getheRervaluSidetag (int [] taghierarchy) {try {for (int i = 0; i <taghierarchy.length-1; i ++) {return getObject (). getString (tagHierarchy [i]); }} catch (exception e) {string tags = ""; for (int i = 0; i <taghierarchy.length; i ++) {tags + = totagString (taghierarchy [i]) + ""; } retour ""; } return null; } / ** * convertit la représentation INT d'un numéro d'en-tête * EG 0x00080010 en chaîne correspondante 0008,0010 * @return 0008,0010 en tant que chaîne * / chaîne statique publique totagString (int tagnr) {return shorttohex (tagnr >> 16) + ',' + shorttohex (tagnr); } String statique publique ShorttoHex (int Val) {char [] ch = new Char [4]; shorttohex (val, ch, 0); retourner la nouvelle chaîne (ch); } public static 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]); retourner sb; } public static void shorttohex (int val, char [] ch, int off) {ch [off] = hex_digits [(val >> 12) & 0xf]; ch [off + 1] = hex_digits [(val >> 8) & 0xf]; ch [off + 2] = hex_digits [(val >> 4) & 0xf]; ch [off + 3] = hex_digits [val & 0xf]; } / ** * Créer la sortie du fichier DICOM * @param fileoutput: sortie de fichier * @throws ioException * * * Exemple: * * * * * * / public void writeTo (fichier fileOutput, attributs fmi, attributes objet) lance ioException {dicomoutputStream doss = new dicomoutStream (new File (fileoutput + ". Dcm"); DOS.SetEncodingOptions (Incopts); Dos.WriteDataSet (FMI, objet); Dos.finish (); Dos.Flush (); } / ** * Écriture * @param fileoutput * @param h * @param w * @throws ioException * / public void writeTosegment (file fileoutput, int h, int w) lance ioException {diComOutputStream doss = new DiComOutputStream (nouveau file (fileoutput + ". Dcm")); DOS.SetEncodingOptions (Incopts); } / ** * Créer une superposition dans PixelData * @param objet * / public void overlayCreate (Attributs Object) {int position = object.getInt (tag.overlayBitPosition, 0); if (position == 0) {return; } int bit = 1 << position; int [] pixels = object.getInts (tag.pixeldata); int count = 0; for (int pix: pixels) {int tooklay = pix & bit; pixels [count ++] = pix - superposition; } object.setInt (tag.pixeldata, vr.ow, pixels); } / ** * diCom.SetString (tag.performingPhysicianName, vr.pn, "Jean"); diCom.SetString (tag.admittingDiagnossDescription, vr.lo, "chu"); Séquence seq = diCom.newSequence (tag.anatomicregionSequence, 0); Attributs diCom2 = nouveaux attributs (); * @param dicom * / public void setItem (attributs diCom, int tagsenceName) {Sequence seq = diCom.newSequence (TagSenenceName, 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); } public static void main (String [] args) lève une exception {file file = new File ("c: // utilisateurs // Fendo // documents // wechat files // Fen_do // files // 1234.dcm"); DisplayTag d = new DisplayTag (fichier); @SuppressWarnings ("STATIC-ACCESS") Attributs attrs = D.LoadDicomObject (fichier); // Sortie de tous les informations d'attribut System.out.println ("Toutes les informations:" + attrs); // Get Row int row = att.getInt (tag.Rows, 1); // Get Column int colonnes = att.getInt (tag.columns, 1); // Window Largeth Window float win_center = attrs.getFloat (tag.windowcenter, 1); float win_width = att.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缓存操作技巧汇总》
J'espère que cet article sera utile à la programmation Java de tous.