Produced by Araxis Merge on 12/5/2017 12:06:39 PM Central Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\DicomDataSet\main\src\java\gov\va\med\imaging\dicom\dataset | DataSet.java | Mon Dec 4 21:35:16 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\DicomDataSet\main\src\java\gov\va\med\imaging\dicom\dataset | DataSet.java | Mon Dec 4 21:59:25 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 1264 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | /** | |
| 2 | * | |
| 3 | */ | |
| 4 | package go v.va.med.i maging.dic om.dataset ; | |
| 5 | ||
| 6 | ||
| 7 | import gov .va.med.im aging.dico m.dataset. elements.D ataElement ; | |
| 8 | import gov .va.med.im aging.dico m.dataset. elements.D ataElement Tag; | |
| 9 | import gov .va.med.im aging.dico m.exceptio ns.ValueRe presentati onInterpre tationExce ption; | |
| 10 | ||
| 11 | import jav a.io.Seria lizable; | |
| 12 | import jav a.util.Col lection; | |
| 13 | import jav a.util.Com parator; | |
| 14 | import jav a.util.Dat e; | |
| 15 | import jav a.util.Ite rator; | |
| 16 | import jav a.util.Sor tedMap; | |
| 17 | import jav a.util.Sor tedSet; | |
| 18 | import jav a.util.Tre eMap; | |
| 19 | import jav a.util.Tre eSet; | |
| 20 | import org .apache.lo gging.log4 j.LogManag er; | |
| 21 | import org .apache.lo gging.log4 j.Logger; | |
| 22 | ||
| 23 | import com .google.gw t.user.cli ent.rpc.Is Serializab le; | |
| 24 | ||
| 25 | /** | |
| 26 | * This cl ass is a S et of all of the Dat aElement i nstances i n a single DICOM Par t 10 file. | |
| 27 | * The Dat aElement i nstances a re stored in a Map, using the DataElemen tTag (grou p and elem ent number s) as | |
| 28 | * the key to allow rapid acce ss by that attribute . Logical ly (withou t regard t o access t imes) this | |
| 29 | * is a Se t of DataE lement ins tances. | |
| 30 | * | |
| 31 | * From th e spec: | |
| 32 | * A Data Element is uniquely identified by a Data Element T ag. | |
| 33 | * The Dat a Elements in a Data Set shall be ordere d by incre asing Data Element T ag Number and shall | |
| 34 | * occur a t most onc e in a Dat a Set. | |
| 35 | * | |
| 36 | * @author
|
|
| 37 | * | |
| 38 | */ | |
| 39 | public cla ss DataSet | |
| 40 | implements Serializa ble, Sorte dSet<DataE lement<?>> , IsSerial izable | |
| 41 | { | |
| 42 | pr ivate stat ic final l ong serial VersionUID = 1L; | |
| 43 | pr otected So rtedMap<Da taElementT ag, DataEl ement<?>> wrappedMap = new Tre eMap<DataE lementTag, DataEleme nt<?>>(); | |
| 44 | pr ivate Tran sferSyntax Uid transf erSyntax; | |
| 45 | pr ivate fina l transien t Logger l ogger = Lo gManager.g etLogger(t his.getCla ss().getNa me()); | |
| 46 | ||
| 47 | /* * | |
| 48 | * Required no-arg con structor | |
| 49 | * / | |
| 50 | pu blic DataS et() | |
| 51 | { | |
| 52 | su per(); | |
| 53 | } | |
| 54 | ||
| 55 | public DataSet(T ransferSyn taxUid tra nsferSynta x) | |
| 56 | { | |
| 57 | this .transferS yntax = tr ansferSynt ax; | |
| 58 | } | |
| 59 | ||
| 60 | /* * | |
| 61 | * @re turn the t ransferSyn tax | |
| 62 | */ | |
| 63 | public TransferS yntaxUid g etTransfer Syntax() | |
| 64 | { | |
| 65 | re turn trans ferSyntax; | |
| 66 | } | |
| 67 | ||
| 68 | // === ========== ========== ========== ========== ========== ========== ========== ========== ========== ========== | |
| 69 | // | |
| 70 | // === ========== ========== ========== ========== ========== ========== ========== ========== ========== ========== | |
| 71 | /* * | |
| 72 | * | |
| 73 | * @param gr oupNumber | |
| 74 | * @param el ementNumbe r | |
| 75 | * @return | |
| 76 | * / | |
| 77 | pu blic DataE lement<?> get(int gr oupNumber, int eleme ntNumber) | |
| 78 | { | |
| 79 | retu rn wrapped Map.get(ne w DataElem entTag(gro upNumber, elementNum ber)); | |
| 80 | } | |
| 81 | ||
| 82 | pu blic DataE lement<?> get(DataEl ementTag d ataElement Tag) | |
| 83 | { | |
| 84 | retu rn wrapped Map.get(da taElementT ag); | |
| 85 | } | |
| 86 | ||
| 87 | // ========= ========== ========== ========== ========== ========== ========== ========== === | |
| 88 | // Set imple mentation | |
| 89 | // ========= ========== ========== ========== ========== ========== ========== ========== === | |
| 90 | /* * | |
| 91 | * @se e java.uti l.Set#add( java.lang. Object) | |
| 92 | */ | |
| 93 | @Overr ide | |
| 94 | public boolean a dd(DataEle ment<?> da taElement) | |
| 95 | { | |
| 96 | if ( wrappedM ap.get(dat aElement.g etDataElem entTag()) != null ) | |
| 97 | retu rn false; | |
| 98 | ||
| 99 | wr appedMap.p ut(dataEle ment.getDa taElementT ag(), data Element); | |
| 100 | re turn true; | |
| 101 | } | |
| 102 | ||
| 103 | /* * | |
| 104 | * @se e java.uti l.Set#addA ll(java.ut il.Collect ion) | |
| 105 | */ | |
| 106 | @Overr ide | |
| 107 | public boolean a ddAll(Coll ection<? e xtends Dat aElement<? >> dataEle ments) | |
| 108 | { | |
| 109 | bo olean this SetChanged = false; | |
| 110 | fo r(DataElem ent<?> dat aElement : dataEleme nts) | |
| 111 | this SetChanged |= add(da taElement) ; // if any elemen t was adde d then the set was c hanged | |
| 112 | ||
| 113 | return t hisSetChan ged; | |
| 114 | } | |
| 115 | ||
| 116 | /* * | |
| 117 | * @se e java.uti l.Set#cont ains(java. lang.Objec t) | |
| 118 | */ | |
| 119 | @Overr ide | |
| 120 | public boolean c ontains(Ob ject o) | |
| 121 | { | |
| 122 | if (o instanc eof DataEl ement<?>) | |
| 123 | retu rn wrapped Map.get( ( (DataEleme nt<?>)o).g etDataElem entTag() ) != null; | |
| 124 | ||
| 125 | return f alse; | |
| 126 | } | |
| 127 | ||
| 128 | /* * | |
| 129 | * @se e java.uti l.Set#cont ainsAll(ja va.util.Co llection) | |
| 130 | */ | |
| 131 | @Overr ide | |
| 132 | public boolean c ontainsAll (Collectio n<?> c) | |
| 133 | { | |
| 134 | fo r(Object o : c) | |
| 135 | if(! contains( o)) | |
| 136 | return false; | |
| 137 | re turn true; | |
| 138 | } | |
| 139 | ||
| 140 | /* * | |
| 141 | * @se e java.uti l.Set#iter ator() | |
| 142 | */ | |
| 143 | @Overr ide | |
| 144 | public Iterator< DataElemen t<?>> iter ator() | |
| 145 | { | |
| 146 | return w rappedMap. values().i terator(); | |
| 147 | } | |
| 148 | ||
| 149 | public Iterator< DataElemen tTag> keyI terator() | |
| 150 | { | |
| 151 | re turn wrapp edMap.keyS et().itera tor(); | |
| 152 | } | |
| 153 | ||
| 154 | /* * | |
| 155 | * @se e java.uti l.Set#remo veAll(java .util.Coll ection) | |
| 156 | */ | |
| 157 | @Overr ide | |
| 158 | public boolean r emoveAll(C ollection< ?> c) | |
| 159 | { | |
| 160 | bo olean this SetChanged = false; | |
| 161 | ||
| 162 | fo r(Object o : c) | |
| 163 | if(o instanceo f DataElem ent) | |
| 164 | if( wr appedMap.v alues().co ntains(o) ) | |
| 165 | thisSetC hanged |= (wrappedMa p.remove( ((DataElem ent<?>)o). getDataEle mentTag() ) != null) ; | |
| 166 | ||
| 167 | return t hisSetChan ged; | |
| 168 | } | |
| 169 | ||
| 170 | /* * | |
| 171 | * @se e java.uti l.Set#reta inAll(java .util.Coll ection) | |
| 172 | */ | |
| 173 | @Overr ide | |
| 174 | public boolean r etainAll(C ollection< ?> c) | |
| 175 | { | |
| 176 | bo olean this SetChanged = false; | |
| 177 | ||
| 178 | fo r(DataElem ent<?> dat aElement : this) | |
| 179 | if( ! c.contai ns(dataEle ment) ) | |
| 180 | { | |
| 181 | remove (dataEleme nt); | |
| 182 | thisSe tChanged = true; | |
| 183 | } | |
| 184 | ||
| 185 | re turn thisS etChanged; | |
| 186 | } | |
| 187 | ||
| 188 | /* * | |
| 189 | * @se e java.uti l.Set#toAr ray() | |
| 190 | */ | |
| 191 | @Overr ide | |
| 192 | public Object[] toArray() | |
| 193 | { | |
| 194 | re turn wrapp edMap.valu es().toArr ay(new Dat aElement<? >[wrappedM ap.size()] ); | |
| 195 | } | |
| 196 | ||
| 197 | /* * | |
| 198 | * @se e java.uti l.Set#toAr ray(T[]) | |
| 199 | */ | |
| 200 | @Overr ide | |
| 201 | public <T> T[] t oArray(T[] a) | |
| 202 | { | |
| 203 | re turn wrapp edMap.valu es().toArr ay(a); | |
| 204 | } | |
| 205 | ||
| 206 | /* * | |
| 207 | * @se e java.uti l.Set#clea r() | |
| 208 | */ | |
| 209 | @Overr ide | |
| 210 | public void clea r() | |
| 211 | { | |
| 212 | wr appedMap.c lear(); | |
| 213 | } | |
| 214 | ||
| 215 | /* * | |
| 216 | * @se e java.uti l.Set#isEm pty() | |
| 217 | */ | |
| 218 | @Overr ide | |
| 219 | public boolean i sEmpty() | |
| 220 | { | |
| 221 | return w rappedMap. isEmpty(); | |
| 222 | } | |
| 223 | ||
| 224 | /* * | |
| 225 | * @se e java.uti l.Set#remo ve(java.la ng.Object) | |
| 226 | */ | |
| 227 | @Overr ide | |
| 228 | public boolean r emove(Obje ct o) | |
| 229 | { | |
| 230 | if (o instanc eof DataEl ement<?>) | |
| 231 | retu rn wrapped Map.remove (((DataEle ment<?>)o) .getDataEl ementTag() ) != null; | |
| 232 | ||
| 233 | re turn false ; | |
| 234 | } | |
| 235 | ||
| 236 | /* * | |
| 237 | * @se e java.uti l.Set#size () | |
| 238 | */ | |
| 239 | @Overr ide | |
| 240 | public int size( ) | |
| 241 | { | |
| 242 | return w rappedMap. values().s ize(); | |
| 243 | } | |
| 244 | ||
| 245 | /* * | |
| 246 | * @se e java.uti l.SortedSe t#comparat or() | |
| 247 | * @re turn null, because t his always uses the natural or dering of DataElemen t | |
| 248 | */ | |
| 249 | @Overr ide | |
| 250 | public Comparato r<? super DataElemen t<?>> comp arator() | |
| 251 | { | |
| 252 | return n ull; | |
| 253 | } | |
| 254 | ||
| 255 | /* * | |
| 256 | * @se e java.uti l.SortedSe t#first() | |
| 257 | */ | |
| 258 | @Overr ide | |
| 259 | public DataEleme nt<?> firs t() | |
| 260 | { | |
| 261 | re turn wrapp edMap.get( wrappedMap .firstKey( )); | |
| 262 | } | |
| 263 | ||
| 264 | /* * | |
| 265 | * @se e java.uti l.SortedSe t#headSet( java.lang. Object) | |
| 266 | */ | |
| 267 | @Overr ide | |
| 268 | public SortedSet <DataEleme nt<?>> hea dSet(DataE lement<?> toElement) | |
| 269 | { | |
| 270 | re turn new T reeSet<Dat aElement<? >>( wrappe dMap.headM ap(toEleme nt.getData ElementTag ()).values () ); | |
| 271 | } | |
| 272 | ||
| 273 | /* * | |
| 274 | * @se e java.uti l.SortedSe t#last() | |
| 275 | */ | |
| 276 | @Overr ide | |
| 277 | public DataEleme nt<?> last () | |
| 278 | { | |
| 279 | re turn wrapp edMap.get( wrappedMap .lastKey() ); | |
| 280 | } | |
| 281 | ||
| 282 | /* * | |
| 283 | * @se e java.uti l.SortedSe t#subSet(j ava.lang.O bject, jav a.lang.Obj ect) | |
| 284 | */ | |
| 285 | @Overr ide | |
| 286 | public SortedSet <DataEleme nt<?>> sub Set(DataEl ement<?> f romElement , DataElem ent<?> toE lement) | |
| 287 | { | |
| 288 | re turn new T reeSet<Dat aElement<? >>( wrappe dMap.subMa p(fromElem ent.getDat aElementTa g(), toEle ment.getDa taElementT ag()).valu es() ); | |
| 289 | } | |
| 290 | ||
| 291 | /* * | |
| 292 | * @se e java.uti l.SortedSe t#tailSet( java.lang. Object) | |
| 293 | */ | |
| 294 | @Overr ide | |
| 295 | public SortedSet <DataEleme nt<?>> tai lSet(DataE lement<?> fromElemen t) | |
| 296 | { | |
| 297 | re turn new T reeSet<Dat aElement<? >>( wrappe dMap.tailM ap(fromEle ment.getDa taElementT ag()).valu es() ); | |
| 298 | } | |
| 299 | ||
| 300 | /** | |
| 301 | * Get an iterat or over al l of the e lements in this with the speci fied group number | |
| 302 | * @pa ram groupN umber | |
| 303 | */ | |
| 304 | pu blic Itera tor<DataEl ement<?>> iterator(i nt groupNu mber) | |
| 305 | { | |
| 306 | retu rn new Gro upIterator (groupNumb er); | |
| 307 | } | |
| 308 | ||
| 309 | cl ass GroupI terator | |
| 310 | im plements I terator<Da taElement< ?>> | |
| 311 | { | |
| 312 | fina l private int groupN umber; | |
| 313 | priv ate DataEl ement<?> n extDataEle ment = nul l; | |
| 314 | priv ate final Iterator<D ataElement <?>> wrapp edIterator ; | |
| 315 | ||
| 316 | Grou pIterator( int groupN umber) | |
| 317 | { | |
| 318 | this.g roupNumber = groupNu mber; | |
| 319 | wrappe dIterator = iterator (); | |
| 320 | } | |
| 321 | ||
| 322 | @Ove rride | |
| 323 | pu blic boole an hasNext () | |
| 324 | { | |
| 325 | positi on(); | |
| 326 | return nextDataE lement != null; | |
| 327 | } | |
| 328 | ||
| 329 | @Ove rride | |
| 330 | pu blic DataE lement<?> next() | |
| 331 | { | |
| 332 | positi on(); | |
| 333 | if(nex tDataEleme nt != null ) | |
| 334 | { | |
| 335 | DataElem ent<?> tmp = nextDat aElement; | |
| 336 | nextData Element = null; | |
| 337 | return t mp; | |
| 338 | } | |
| 339 | return n ull; | |
| 340 | } | |
| 341 | ||
| 342 | priv ate synchr onized voi d position () | |
| 343 | { | |
| 344 | whil e(wrappedI terator != null && w rappedIter ator.hasNe xt() && ne xtDataElem ent == nul l) | |
| 345 | { | |
| 346 | DataEl ement<?> n extTmp = w rappedIter ator.next( ); | |
| 347 | if(nex tTmp.getDa taElementT ag().getGr oup() == g roupNumber ) | |
| 348 | nextData Element = nextTmp; | |
| 349 | } | |
| 350 | } | |
| 351 | ||
| 352 | @Ove rride | |
| 353 | pu blic void remove() | |
| 354 | { | |
| 355 | } | |
| 356 | }; | |
| 357 | ||
| 358 | pu blic Colle ction<Data Element<?> > subset(i nt groupNu mber) | |
| 359 | { | |
| 360 | retu rn | |
| 361 | this.w rappedMap. subMap(new DataEleme ntTag(grou pNumber, 0 x0000), ne w DataElem entTag(gro upNumber, 0xFFFF)).v alues(); | |
| 362 | } | |
| 363 | ||
| 364 | // ========= ========== ========== ========== ========== ========== ========== ========== === | |
| 365 | // Convenien ce Methods , to get s ome well-k nown DICOM tag value s | |
| 366 | // ========= ========== ========== ========== ========== ========== ========== ========== === | |
| 367 | pu blic DataE lement<?> getCommand GroupLengt h() | |
| 368 | { | |
| 369 | retu rn get( 0x 0000, 0x00 00 ); | |
| 370 | } | |
| 371 | ||
| 372 | // ========= ========== ========== ========== ========== ========== ========== ========== ========== ======= | |
| 373 | // DICOM Hea der Elemen ts | |
| 374 | // ========= ========== ========== ========== ========== ========== ========== ========== ========== ======= | |
| 375 | /* * | |
| 376 | * Number of bytes fol lowing thi s File Met a Element (end of th e Value fi eld) up to and inclu ding the l ast | |
| 377 | * File Meta Element o f the Grou p 2 File M eta Inform ation | |
| 378 | * | |
| 379 | * @return | |
| 380 | * / | |
| 381 | pu blic DataE lement<?> getGroupLe ngth() | |
| 382 | { | |
| 383 | retu rn get(0x0 002,0x0000 ); | |
| 384 | } | |
| 385 | ||
| 386 | ||
| 387 | /* * | |
| 388 | * This is a two byte field where eac h bit iden tifies a v ersion of this File Meta Infor mation hea der. | |
| 389 | * In versio n 1 the fi rst byte v alue is 00 H and the second val ue byte va lue is 01H . | |
| 390 | * Implement ations rea ding Files with Meta Informati on where t his attrib ute has bi t 0 (lsb) of the sec ond byte | |
| 391 | * set to 1 may interp ret the Fi le Meta In formation as specifi ed in this version o f PS 3.10. All other bits | |
| 392 | * shall not be checke d. | |
| 393 | * Note: A b it field w here each bit identi fies a ver sion, allo ws explici t indicati on of the support of | |
| 394 | * multiple previous v ersions. F uture vers ions of th e File Met a Informat ion that c an be read by verson 1 | |
| 395 | * readers w ill have b it 0 of th e second b yte set to 1. | |
| 396 | * | |
| 397 | * @return | |
| 398 | * / | |
| 399 | pu blic DataE lement<?> getFileMet aInformati onVersion( ) | |
| 400 | { | |
| 401 | retu rn get(0x0 002,0x0001 ); | |
| 402 | } | |
| 403 | ||
| 404 | /* * | |
| 405 | * Uniquely identifies the SOP C lass assoc iated with the Data Set. | |
| 406 | * SOP Class UIDs allo wed for me dia storag e are spec ified in P S 3.4 of t he DICOM S tandard - Media Stor age | |
| 407 | * Applicati on Profile s. | |
| 408 | * | |
| 409 | * @return | |
| 410 | * / | |
| 411 | pu blic DataE lement<?> getMediaSt orageSOPCl assUID() | |
| 412 | { | |
| 413 | retu rn get(0x0 002,0x0002 ); | |
| 414 | } | |
| 415 | ||
| 416 | /* * | |
| 417 | * Uniquely identifies the SOP I nstance as sociated w ith the Da ta Set pla ced in the file and following the | |
| 418 | * File Meta Informati on. | |
| 419 | * | |
| 420 | * @return | |
| 421 | * / | |
| 422 | pu blic DataE lement<?> getMediaSt orageSOPIn stanceUID( ) | |
| 423 | { | |
| 424 | retu rn get(0x0 002,0x0003 ); | |
| 425 | } | |
| 426 | ||
| 427 | /* * | |
| 428 | * Uniquely identifies the Trans fer Syntax used to e ncode the following Data Set. This Trans fer Syntax does not | |
| 429 | * apply to the File M eta Inform ation. | |
| 430 | * Note: It is recomme nded to us e one of t he DICOM T ransfer Sy ntaxes sup porting ex plicit Val ue Represe ntation | |
| 431 | * encoding to facilit ate interp retation o f File Met a Element Values. JP IP Referen ced Pixel Data Trans fer | |
| 432 | * Syntaxes are not us ed. (See P S 3.5 of t he DICOM S tandard). | |
| 433 | * | |
| 434 | * @return | |
| 435 | * / | |
| 436 | pu blic DataE lement<?> getTransfe rSyntaxUID () | |
| 437 | { | |
| 438 | retu rn get(Dat aElementTa g.TRANSFER _SYNTAX_UI D_TAG); | |
| 439 | } | |
| 440 | ||
| 441 | /* * | |
| 442 | * Uniquely identifies the imple mentation which wrot e this fil e and its content. I t provides an unambi guous | |
| 443 | * identific ation of t he type of implement ation whic h last wro te the fil e in the e vent of in terchange problems. | |
| 444 | * It follow s the same policies as defined by PS 3.7 of the DI COM Standa rd (associ ation nego tiation). | |
| 445 | * | |
| 446 | * @return | |
| 447 | * / | |
| 448 | pu blic DataE lement<?> getImpleme ntationCla ssUID() | |
| 449 | { | |
| 450 | retu rn get(0x0 002,0x0012 ); | |
| 451 | } | |
| 452 | ||
| 453 | /* * | |
| 454 | * Identifie s a versio n for an I mplementat ion Class UID (0002, 0012) usin g up to 16 character s of the r epertoire | |
| 455 | * identifie d in Secti on 8.5. It follows t he same po licies as defined by PS 3.7 of the DICOM Standard (associati on | |
| 456 | * negotiati on). | |
| 457 | * | |
| 458 | * @return | |
| 459 | * / | |
| 460 | pu blic DataE lement<?> getImpleme ntationVer sionName() | |
| 461 | { | |
| 462 | retu rn get(0x0 002,0x0013 ); | |
| 463 | } | |
| 464 | ||
| 465 | /* * | |
| 466 | * The DICOM Applicati on Entity (AE) Title of the AE which wro te this fi le's conte nt (or las t updated it). | |
| 467 | * If used, it allows the tracin g of the s ource of e rrors in t he event o f media in terchange problems. | |
| 468 | * The polic ies associ ated with AE Titles are the sa me as thos e defined in PS 3.8 of the DIC OM Standar d. | |
| 469 | * | |
| 470 | * @return | |
| 471 | * / | |
| 472 | pu blic DataE lement<?> getSourceA pplication EntityTitl e() | |
| 473 | { | |
| 474 | retu rn get(0x0 002,0x0016 ); | |
| 475 | } | |
| 476 | ||
| 477 | /* * | |
| 478 | * The UID o f the crea tor of the private i nformation (0x0002,0 x0102) | |
| 479 | * | |
| 480 | * @return | |
| 481 | * / | |
| 482 | pu blic DataE lement<?> getPrivate Informatio nCreatorUI D() | |
| 483 | { | |
| 484 | retu rn get(0x0 002,0x0100 ); | |
| 485 | } | |
| 486 | ||
| 487 | /* * | |
| 488 | * Contains Private In formation placed in the File M eta Inform ation. | |
| 489 | * The creat or shall b e identifi ed in (000 2,0100). | |
| 490 | * Required if Private Informati on Creator UID (0002 ,0100) is present. | |
| 491 | * | |
| 492 | * @return | |
| 493 | * / | |
| 494 | pu blic DataE lement<?> getPrivate Informatio n() | |
| 495 | { | |
| 496 | retu rn get(0x0 002,0x0102 ); | |
| 497 | } | |
| 498 | ||
| 499 | // ========= ========== ========== ========== ========== ========== ========== ========== ========== ======= | |
| 500 | // | |
| 501 | // ========= ========== ========== ========== ========== ========== ========== ========== ========== ======= | |
| 502 | /* * | |
| 503 | * DICOM App lication E ntities (A Es) that e xtend or r eplace the default r epertoire | |
| 504 | * convey th is informa tion in th e Specific Character Set (0008 ,0005) Att ribute. | |
| 505 | * | |
| 506 | * @return | |
| 507 | * / | |
| 508 | pu blic DataE lement<?> getSpecifi cCharacter Set() | |
| 509 | { | |
| 510 | retu rn get( 0x 0008, 0x00 05 ); | |
| 511 | } | |
| 512 | ||
| 513 | // ========= ========== ========== ========== ========== ========== ========== ========== ========== ======= | |
| 514 | // Patient I nformation Group (0x 0010) | |
| 515 | // ========= ========== ========== ========== ========== ========== ========== ========== ========== ======= | |
| 516 | pu blic Strin g getPatie ntId() | |
| 517 | th rows Value Representa tionInterp retationEx ception | |
| 518 | { | |
| 519 | retu rn get( 0x 0010, 0x00 10 ).getVa lue().toSt ring(); | |
| 520 | } | |
| 521 | ||
| 522 | pu blic Strin g getPatie ntName() | |
| 523 | th rows Value Representa tionInterp retationEx ception | |
| 524 | { | |
| 525 | retu rn get( 0x 0010, 0x00 20 ).getVa lue().toSt ring(); | |
| 526 | } | |
| 527 | ||
| 528 | pu blic Date getPatient BirthDate( ) | |
| 529 | th rows Value Representa tionInterp retationEx ception | |
| 530 | { | |
| 531 | retu rn (Date)( get( 0x00 10, 0x0030 ).getValu e()); | |
| 532 | } | |
| 533 | ||
| 534 | pu blic Strin g getPatie ntSex() | |
| 535 | th rows Value Representa tionInterp retationEx ception | |
| 536 | { | |
| 537 | retu rn get( 0x 0010, 0x00 40 ).getVa lue().toSt ring(); | |
| 538 | } | |
| 539 | ||
| 540 | pu blic Strin g getPatie ntAge() | |
| 541 | th rows Value Representa tionInterp retationEx ception | |
| 542 | { | |
| 543 | retu rn get( 0x 0010, 0x10 10 ).getVa lue().toSt ring(); | |
| 544 | } | |
| 545 | ||
| 546 | // ========= ========== ========== ========== ========== ========== ========== ========== ========== ======= | |
| 547 | // Image Inf ormation G roup (0x00 28) | |
| 548 | // ========= ========== ========== ========== ========== ========== ========== ========== ========== ======= | |
| 549 | pu blic DataE lement<?> getSamples PerPixel() | |
| 550 | { | |
| 551 | retu rn get( Da taElementT ag.SAMPLES _PER_PIXEL ); | |
| 552 | } | |
| 553 | ||
| 554 | pu blic DataE lement<?> getPhotome tricInterp retation() | |
| 555 | { | |
| 556 | retu rn get( Da taElementT ag.PHOTOME TRIC_INTER PRETATION ); | |
| 557 | } | |
| 558 | ||
| 559 | pu blic int g etRows() | |
| 560 | th rows Value Representa tionInterp retationEx ception | |
| 561 | { | |
| 562 | retu rn getInte gerDataEle ment(DataE lementTag. ROWS); | |
| 563 | } | |
| 564 | ||
| 565 | pu blic int g etColumns( ) | |
| 566 | th rows Value Representa tionInterp retationEx ception | |
| 567 | { | |
| 568 | retu rn getInte gerDataEle ment(DataE lementTag. COLUMNS); | |
| 569 | } | |
| 570 | ||
| 571 | pu blic int g etBitsAllo cated() | |
| 572 | th rows Value Representa tionInterp retationEx ception | |
| 573 | { | |
| 574 | retu rn getInte gerDataEle ment(DataE lementTag. BITS_ALLOC ATED); | |
| 575 | } | |
| 576 | ||
| 577 | pu blic int g etBitsStor ed() | |
| 578 | th rows Value Representa tionInterp retationEx ception | |
| 579 | { | |
| 580 | retu rn getInte gerDataEle ment(DataE lementTag. BITS_STORE D); | |
| 581 | } | |
| 582 | ||
| 583 | pu blic int g etHighBit( ) | |
| 584 | th rows Value Representa tionInterp retationEx ception | |
| 585 | { | |
| 586 | retu rn getInte gerDataEle ment(DataE lementTag. HIGH_BIT); | |
| 587 | } | |
| 588 | ||
| 589 | pr ivate int getInteger DataElemen t(DataElem entTag dat aElementTa g) | |
| 590 | { | |
| 591 | try | |
| 592 | { | |
| 593 | Intege r[] value = (Integer [])( get( dataElemen tTag ).get Value() ); | |
| 594 | return value[0]. intValue() ; | |
| 595 | } | |
| 596 | catc h(ClassCas tException ccX) | |
| 597 | { | |
| 598 | logger .error("Va lue return ed from ge tting elem ent '" + d ataElement Tag + "' i s not of t he expecte d type" ); | |
| 599 | return 0; | |
| 600 | } | |
| 601 | catc h (ValueRe presentati onInterpre tationExce ption e) | |
| 602 | { | |
| 603 | logger .error("Ge tting elem ent '" + d ataElement Tag + "' r esulted in '" + e.ge tMessage() + "'." ); | |
| 604 | return 0; | |
| 605 | } | |
| 606 | ||
| 607 | } | |
| 608 | // ========= ========== ========== ========== ========== ========== ========== ========== ========== ======= | |
| 609 | // | |
| 610 | // ========= ========== ========== ========== ========== ========== ========== ========== ========== ======= | |
| 611 | pu blic boole an isEncap sulated() | |
| 612 | { | |
| 613 | retu rn getTran sferSyntax ().isEncap sulated(); | |
| 614 | } | |
| 615 | ||
| 616 | // ========= ========== ========== ========== ========== ========== ========== ========== ========== == | |
| 617 | // | |
| 618 | // ========= ========== ========== ========== ========== ========== ========== ========== ========== == | |
| 619 | pu blic DataE lement<?> getItem() | |
| 620 | { | |
| 621 | retu rn get( Da taElementT ag.SEQUENC E_ITEM_TAG ); | |
| 622 | } | |
| 623 | ||
| 624 | pu blic DataE lement<?> getItemDel imitationI tem() | |
| 625 | { | |
| 626 | retu rn get( Da taElementT ag.ITEM_DE LIMITATION _TAG ); | |
| 627 | } | |
| 628 | ||
| 629 | pu blic DataE lement<?> getSequenc eDelimitat ionItem() | |
| 630 | { | |
| 631 | retu rn get( Da taElementT ag.SEQUENC E_DELIMITA TION_TAG ) ; | |
| 632 | } | |
| 633 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.