From: gunter z. <gun...@us...> - 2001-12-27 17:06:24
|
Update of /cvsroot/dcm4che/dcm4che/src/main/org/dcm4che/dict In directory usw-pr-cvs1:/tmp/cvs-serv8031/dcm4che/src/main/org/dcm4che/dict Modified Files: Status.java Tag.java Log Message: improve spport of private tags working on SROM API Index: Status.java =================================================================== RCS file: /cvsroot/dcm4che/dcm4che/src/main/org/dcm4che/dict/Status.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Status.java 2001/11/01 19:59:48 1.1.1.1 --- Status.java 2001/12/27 17:06:21 1.2 *************** *** 1,24 **** ! /* ! * $Id$ ! * Created at 16. Mai 2001 ! * ! * Copyright 2001 by TIANI MEDGRAPH AG (gun...@ti...). ! * ! * This file is part of dcm4che. ! * ! * dcm4che is free software; you can redistribute it and/or modify ! * it under the terms of the GNU Lesser General Public License as ! * published by the Free Software Foundation; either version 2 of ! * the License, or (at your option) any later version. ! * ! * dcm4che is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU Lesser General Public License for more details. ! * ! * You should have received a copy of the GNU Lesser General Public License ! * along with dcm4che; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ package org.dcm4che.dict; --- 1,25 ---- ! /***************************************************************************** ! * * ! * Copyright (c) 2001 by TIANI MEDGRAPH AG <gun...@ti...> * ! * * ! * This file is part of dcm4che. * ! * * ! * This library is free software; you can redistribute it and/or modify it * ! * under the terms of the GNU Lesser General Public License as published * ! * by the Free Software Foundation; either version 2 of the License, or * ! * (at your option) any later version. * ! * * ! * This library is distributed in the hope that it will be useful, but * ! * WITHOUT ANY WARRANTY; without even the implied warranty of * ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * ! * Lesser General Public License for more details. * ! * * ! * You should have received a copy of the GNU Lesser General Public * ! * License along with this library; if not, write to the Free Software * ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ! * * ! *****************************************************************************/ ! ! /* $Id$ */ package org.dcm4che.dict; Index: Tag.java =================================================================== RCS file: /cvsroot/dcm4che/dcm4che/src/main/org/dcm4che/dict/Tag.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Tag.java 2001/11/01 19:59:46 1.1.1.1 --- Tag.java 2001/12/27 17:06:21 1.2 *************** *** 32,36 **** * * @author gunter zeilinger ! * @version 0.9.6 * @since version 0.1 */ --- 32,36 ---- * * @author gunter zeilinger ! * @version 0.9.9 * @since version 0.1 */ *************** *** 49,52 **** --- 49,84 ---- String s2 = "00000000".substring(s1.length()) + s1; return ("(" + s2.substring(0,4) + "," + s2.substring(4) + ")"); + } + /** Check if private tag. + * @param tag integer const + * @return <CODE>true</CODE> if group number of tag is odd. + */ + public static boolean isPrivate(int tag) { + return ((tag & 0x00010000) != 0); + } + + /** Creates tag constant from group and element value. + * @param gr group tag + * @param el element tag + * @return tag constant. + */ + public static int toTag(short gr, short el) { + return ((gr<<16)|(el & 0xffff)); + } + + /** Returns group tag. + * @param tag integer const + * @return group tag. + */ + public static int gr(int tag) { + return (tag >> 16); + } + + /** Returns element tag. + * @param tag integer const + * @return element tag. + */ + public static int el(int tag) { + return (tag & 0xffff); } |