本文整理匯總了Java中org.dcm4che3.data.Tag類的典型用法代碼示例。如果您正苦於以下問題:Java Tag類的具體用法?Java Tag怎麽用?Java Tag使用的例子?那麽恭喜您, 這裏精選的類代碼示例或許可以為您提供幫助。
Tag類屬於org.dcm4che3.data包,在下文中一共展示了Tag類的16個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於我們的係統推薦出更棒的Java代碼示例。
示例1: onDimseRSP
點讚 3
import org.dcm4che3.data.Tag; //導入依賴的package包/類
@Override
public void onDimseRSP(Association as, Attributes cmd, Attributes data)
{
super.onDimseRSP(as, cmd, data);
status = cmd.getInt(Tag.Status, -1);
if (Status.isPending(status)) {
completed = cmd.getInt(Tag.NumberOfCompletedSuboperations, -1);
remaining = cmd.getInt(Tag.NumberOfRemainingSuboperations, -1);
warning = cmd.getInt(Tag.NumberOfWarningSuboperations, -1);
failed = cmd.getInt(Tag.NumberOfFailedSuboperations, -1);
}
else {
completed = cmd.getInt(Tag.NumberOfCompletedSuboperations, -1);
remaining = 0;
warning = cmd.getInt(Tag.NumberOfWarningSuboperations, -1);
failed = cmd.getInt(Tag.NumberOfFailedSuboperations, -1);
error = cmd.getString(Tag.ErrorComment, "");
}
}
開發者ID:RSNA,項目名稱:dcmrs-broker,代碼行數:22,
示例2: buildFromStudyInstanceUID
點讚 3
import org.dcm4che3.data.Tag; //導入依賴的package包/類
@Override
public void buildFromStudyInstanceUID(CommonQueryParams params, String... studyInstanceUIDs) {
for (String studyInstanceUID : studyInstanceUIDs) {
if (!StringUtil.hasText(studyInstanceUID)) {
continue;
}
DicomParam[] keysStudies = {
// Matching Keys
new DicomParam(Tag.StudyInstanceUID, studyInstanceUID),
// Return Keys
CFind.PatientID, CFind.IssuerOfPatientID, CFind.PatientName, CFind.PatientBirthDate, CFind.PatientSex,
CFind.ReferringPhysicianName, CFind.StudyDescription, CFind.StudyDate, CFind.StudyTime,
CFind.AccessionNumber, CFind.StudyID };
fillStudy(keysStudies);
}
}
開發者ID:nroduit,項目名稱:weasis-pacs-connector,代碼行數:18,
示例3: buildFromStudyAccessionNumber
點讚 3
import org.dcm4che3.data.Tag; //導入依賴的package包/類
@Override
public void buildFromStudyAccessionNumber(CommonQueryParams params, String... accessionNumbers) {
for (String accessionNumber : accessionNumbers) {
if (!StringUtil.hasText(accessionNumber)) {
continue;
}
DicomParam[] keysStudies = {
// Matching Keys
new DicomParam(Tag.AccessionNumber, accessionNumber),
// Return Keys
CFind.PatientID, CFind.IssuerOfPatientID, CFind.PatientName, CFind.PatientBirthDate, CFind.PatientSex,
CFind.ReferringPhysicianName, CFind.StudyDescription, CFind.StudyDate, CFind.StudyTime,
CFind.StudyInstanceUID, CFind.StudyID };
fillStudy(keysStudies);
}
}
開發者ID:nroduit,項目名稱:weasis-pacs-connector,代碼行數:18,
示例4: fillSeries
點讚 3
import org.dcm4che3.data.Tag; //導入依賴的package包/類
private void fillSeries(Attributes studyDataSet) {
String studyInstanceUID = studyDataSet.getString(Tag.StudyInstanceUID);
if (StringUtil.hasText(studyInstanceUID)) {
DicomParam[] keysSeries = {
// Matching Keys
new DicomParam(Tag.StudyInstanceUID, studyInstanceUID),
// Return Keys
CFind.SeriesInstanceUID, CFind.Modality, CFind.SeriesNumber, CFind.SeriesDescription };
DicomState state =
CFind.process(advancedParams, callingNode, calledNode, 0, QueryRetrieveLevel.SERIES, keysSeries);
LOGGER.debug("C-FIND with StudyInstanceUID {}", state.getMessage());
List series = state.getDicomRSP();
if (series != null && !series.isEmpty()) {
// Get patient from each study in case IssuerOfPatientID is different
Patient patient = getPatient(studyDataSet);
Study study = getStudy(patient, studyDataSet);
for (Attributes seriesDataset : series) {
fillInstance(seriesDataset, study);
}
}
}
}
開發者ID:nroduit,項目名稱:weasis-pacs-connector,代碼行數:26,
示例5: getPatient
點讚 3
import org.dcm4che3.data.Tag; //導入依賴的package包/類
private Patient getPatient(Attributes patientDataset) {
if (patientDataset == null) {
throw new IllegalArgumentException("patientDataset cannot be null");
}
fillPatientAttributes(patientDataset);
String id = patientDataset.getString(Tag.PatientID, "Unknown");
String ispid = patientDataset.getString(Tag.IssuerOfPatientID);
Patient p = getPatient(id, ispid);
if (p == null) {
p = new Patient(id, ispid);
p.setPatientName(patientDataset.getString(Tag.PatientName));
// Only set birth date, birth time is often not consistent (00:00)
p.setPatientBirthDate(patientDataset.getString(Tag.PatientBirthDate));
p.setPatientSex(patientDataset.getString(Tag.PatientSex));
addPatient(p);
}
return p;
}
開發者ID:nroduit,項目名稱:weasis-pacs-connector,代碼行數:21,
示例6: getStudy
點讚 3
import org.dcm4che3.data.Tag; //導入依賴的package包/類
private static Study getStudy(Patient patient, final Attributes studyDataset) {
if (studyDataset == null) {
throw new IllegalArgumentException("studyDataset cannot be null");
}
String uid = studyDataset.getString(Tag.StudyInstanceUID);
Study s = patient.getStudy(uid);
if (s == null) {
s = new Study(uid);
s.setStudyDescription(studyDataset.getString(Tag.StudyDescription));
s.setStudyDate(studyDataset.getString(Tag.StudyDate));
s.setStudyTime(studyDataset.getString(Tag.StudyTime));
s.setAccessionNumber(studyDataset.getString(Tag.AccessionNumber));
s.setStudyID(studyDataset.getString(Tag.StudyID));
s.setReferringPhysicianName(studyDataset.getString(Tag.ReferringPhysicianName));
patient.addStudy(s);
}
return s;
}
開發者ID:nroduit,項目名稱:weasis-pacs-connector,代碼行數:19,
示例7: store
點讚 2
import org.dcm4che3.data.Tag; //導入依賴的package包/類
@Override
protected void store(Association as,
PresentationContext pc,
Attributes rq,
PDVInputStream pin,
Attributes rsp) throws IOException
{
String tsuid = pc.getTransferSyntax();
String classUid = rq.getString(Tag.AffectedSOPClassUID);
DicomInputStream din = new DicomInputStream(pin, tsuid);
Attributes obj = din.readDataset(-1, -1);
CacheManager.writeObject(obj, tsuid, classUid);
}
開發者ID:RSNA,項目名稱:dcmrs-broker,代碼行數:16,
示例8: writeObject
點讚 2
import org.dcm4che3.data.Tag; //導入依賴的package包/類
static void writeObject(Attributes obj, String txUid, String classUid)
throws IOException
{
String studyUid = obj.getString(Tag.StudyInstanceUID);
String seriesUid = obj.getString(Tag.SeriesInstanceUID);
String instanceUid = obj.getString(Tag.SOPInstanceUID);
File dcmFile = buildFile(studyUid, seriesUid, instanceUid, "dcm");
File tmpFile = buildFile(studyUid, seriesUid, instanceUid, "tmp");
File errFile = buildFile(studyUid, seriesUid, instanceUid, "err");
try {
if (errFile.isFile()) {
logger.info("Overwriting error file: {}", errFile);
FileUtils.deleteQuietly(errFile);
}
FileUtils.touch(tmpFile); // Create parent directories if needed
try (FileOutputStream fos = new FileOutputStream(tmpFile)) {
if (UID.ImplicitVRLittleEndian.equals(txUid)) {
// DicomOutputStream throws exception when writing dataset with LEI
txUid = UID.ExplicitVRLittleEndian;
}
else if (UID.ExplicitVRBigEndianRetired.equals(txUid)) {
// Should never happen, but just in case
txUid = UID.ExplicitVRLittleEndian;
logger.info("Trancoding dataset from big to "
+ "little endian for: {}", dcmFile);
}
Attributes fmi = Attributes.createFileMetaInformation(instanceUid,
classUid,
txUid);
DicomOutputStream dos = new DicomOutputStream(fos, txUid);
dos.writeDataset(fmi, obj);
dos.close();
}
Files.move(tmpFile.toPath(),
dcmFile.toPath(),
StandardCopyOption.ATOMIC_MOVE,
StandardCopyOption.REPLACE_EXISTING);
}
catch (Exception ex) {
logger.warn("Unable save DICOM object to: " + dcmFile, ex);
FileUtils.touch(errFile);
FileUtils.deleteQuietly(tmpFile);
FileUtils.deleteQuietly(dcmFile);
if (ex instanceof IOException) {
throw (IOException) ex;
}
else {
throw new IOException(ex);
}
}
}
開發者ID:RSNA,項目名稱:dcmrs-broker,代碼行數:63,
示例9: doQuery
點讚 2
import org.dcm4che3.data.Tag; //導入依賴的package包/類
public List doQuery(QueryParameters params) throws IOException,
InterruptedException, IncompatibleConnectionException, GeneralSecurityException
{
Association assoc = connect();
try {
ResponseHandler handler = new ResponseHandler(assoc, params);
Attributes query = new Attributes();
if (params.getLevel().equals(STUDY)) {
ensure(query, REQUIRED_STUDY_ATTRIBUTE_IDS);
}
query.addAll(params.getIncludedAttributes());
query.addAll(params.getParameters());
query.setString(Tag.QueryRetrieveLevel, VR.CS, params.getLevel().name());
assoc.cfind(getSopClass(),
0,
query,
null,
handler);
return handler.results;
}
finally {
releaseGracefully();
}
}
開發者ID:RSNA,項目名稱:dcmrs-broker,代碼行數:29,
示例10: getStudyComparator
點讚 2
import org.dcm4che3.data.Tag; //導入依賴的package包/類
private static Comparator getStudyComparator() {
return new Comparator() {
@Override
public int compare(Attributes o1, Attributes o2) {
Date date1 = o1.getDate(Tag.StudyDate);
Date date2 = o2.getDate(Tag.StudyDate);
if (date1 != null && date2 != null) {
// inverse time
int rep = date2.compareTo(date1);
if (rep == 0) {
Date time1 = o1.getDate(Tag.StudyTime);
Date time2 = o2.getDate(Tag.StudyTime);
if (time1 != null && time2 != null) {
// inverse time
return time2.compareTo(time1);
}
} else {
return rep;
}
}
if (date1 == null && date2 == null) {
return o1.getString(Tag.StudyInstanceUID, "").compareTo(o2.getString(Tag.StudyInstanceUID, ""));
} else {
if (date1 == null) {
return 1;
}
if (date2 == null) {
return -1;
}
}
return 0;
}
};
}
開發者ID:nroduit,項目名稱:weasis-pacs-connector,代碼行數:36,
示例11: buildFromSeriesInstanceUID
點讚 2
import org.dcm4che3.data.Tag; //導入依賴的package包/類
@Override
public void buildFromSeriesInstanceUID(CommonQueryParams params, String... seriesInstanceUIDs) {
AdvancedParams advParams = advancedParams == null ? new AdvancedParams() : advancedParams;
advParams.getQueryOptions().add(QueryOption.RELATIONAL);
for (String seriesInstanceUID : seriesInstanceUIDs) {
if (!StringUtil.hasText(seriesInstanceUID)) {
continue;
}
DicomParam[] keysSeries = {
// Matching Keys
new DicomParam(Tag.SeriesInstanceUID, seriesInstanceUID),
// Return Keys
CFind.PatientID, CFind.IssuerOfPatientID, CFind.PatientName, CFind.PatientBirthDate, CFind.PatientSex,
CFind.ReferringPhysicianName, CFind.StudyDescription, CFind.StudyDate, CFind.StudyTime,
CFind.AccessionNumber, CFind.StudyInstanceUID, CFind.StudyID, CFind.Modality, CFind.SeriesNumber,
CFind.SeriesDescription };
try {
DicomState state =
CFind.process(advParams, callingNode, calledNode, 0, QueryRetrieveLevel.SERIES, keysSeries);
LOGGER.debug("C-FIND with SeriesInstanceUID {}", state.getMessage());
List series = state.getDicomRSP();
if (series != null && !series.isEmpty()) {
Attributes dataset = series.get(0);
Patient patient = getPatient(dataset);
Study study = getStudy(patient, dataset);
for (Attributes seriesDataset : series) {
fillInstance(seriesDataset, study);
}
}
} catch (Exception e) {
LOGGER.error("DICOM query Error of {}", getArchiveConfigName(), e);
}
}
}
開發者ID:nroduit,項目名稱:weasis-pacs-connector,代碼行數:39,
示例12: fillInstance
點讚 2
import org.dcm4che3.data.Tag; //導入依賴的package包/類
private void fillInstance(Attributes seriesDataset, Study study) {
String serieInstanceUID = seriesDataset.getString(Tag.SeriesInstanceUID);
if (StringUtil.hasText(serieInstanceUID)) {
DicomParam[] keysInstance = {
// Matching Keys
new DicomParam(Tag.StudyInstanceUID, study.getStudyInstanceUID()),
new DicomParam(Tag.SeriesInstanceUID, serieInstanceUID),
// Return Keys
CFind.SOPInstanceUID, CFind.InstanceNumber };
DicomState state =
CFind.process(advancedParams, callingNode, calledNode, 0, QueryRetrieveLevel.IMAGE, keysInstance);
LOGGER.debug("C-FIND with SeriesInstanceUID {}", state.getMessage());
List instances = state.getDicomRSP();
if (instances != null && !instances.isEmpty()) {
Series s = getSeries(study, seriesDataset);
for (Attributes instanceDataSet : instances) {
Integer frame = ServletUtil.getIntegerFromDicomElement(instanceDataSet, Tag.InstanceNumber, null);
String sopUID = instanceDataSet.getString(Tag.SOPInstanceUID);
SopInstance sop = s.getSopInstance(sopUID, frame);
if (sop == null) {
s.addSopInstance(new SopInstance(sopUID, frame));
}
}
}
}
}
開發者ID:nroduit,項目名稱:weasis-pacs-connector,代碼行數:29,
示例13: getSeries
點讚 2
import org.dcm4che3.data.Tag; //導入依賴的package包/類
private static Series getSeries(Study study, final Attributes seriesDataset) {
if (seriesDataset == null) {
throw new IllegalArgumentException("seriesDataset cannot be null");
}
String uid = seriesDataset.getString(Tag.SeriesInstanceUID);
Series s = study.getSeries(uid);
if (s == null) {
s = new Series(uid);
s.setModality(seriesDataset.getString(Tag.Modality));
s.setSeriesNumber(seriesDataset.getString(Tag.SeriesNumber));
s.setSeriesDescription(seriesDataset.getString(Tag.SeriesDescription));
study.addSeries(s);
}
return s;
}
開發者ID:nroduit,項目名稱:weasis-pacs-connector,代碼行數:16,
示例14: buildFromPatientID
點讚 2
import org.dcm4che3.data.Tag; //導入依賴的package包/類
@Override
public void buildFromPatientID(CommonQueryParams params, String... patientIDs) {
for (String patientID : patientIDs) {
if (!StringUtil.hasText(patientID)) {
continue;
}
int beginIndex = patientID.indexOf("^^^");
int offset = 3;
// IssuerOfPatientID filter ( syntax like in HL7 with extension^^^root)
if (beginIndex == -1) {
// if patientID has been encrypted
beginIndex = patientID.indexOf("%5E%5E%5E");
offset = 9;
}
DicomParam[] keysStudies = {
// Matching Keys
new DicomParam(Tag.PatientID, beginIndex < 0 ? patientID : patientID.substring(0, beginIndex)),
// Return Keys, IssuerOfPatientID is a return key except when passed as a extension of PatientID
new DicomParam(Tag.IssuerOfPatientID, beginIndex < 0 ? null : patientID.substring(beginIndex + offset)),
new DicomParam(Tag.PatientName, params.getPatientName()),
new DicomParam(Tag.PatientBirthDate, params.getPatientBirthDate()), CFind.PatientSex,
CFind.ReferringPhysicianName, CFind.StudyDescription, CFind.StudyDate, CFind.StudyTime,
CFind.AccessionNumber, CFind.StudyInstanceUID, CFind.StudyID, new DicomParam(Tag.ModalitiesInStudy) };
try {
DicomState state =
CFind.process(advancedParams, callingNode, calledNode, 0, QueryRetrieveLevel.STUDY, keysStudies);
LOGGER.debug("C-FIND with PatientID {}", state.getMessage());
List studies = state.getDicomRSP();
if (studies != null && !studies.isEmpty()) {
Collections.sort(studies, getStudyComparator());
applyAllFilters(params, studies);
}
} catch (Exception e) {
LOGGER.error("DICOM query Error of {}", getArchiveConfigName(), e);
}
}
}
開發者ID:nroduit,項目名稱:weasis-pacs-connector,代碼行數:42,
示例15: buildFromSopInstanceUID
點讚 2
import org.dcm4che3.data.Tag; //導入依賴的package包/類
@Override
public void buildFromSopInstanceUID(CommonQueryParams params, String... sopInstanceUIDs) {
AdvancedParams advParams = advancedParams == null ? new AdvancedParams() : advancedParams;
advParams.getQueryOptions().add(QueryOption.RELATIONAL);
for (String sopInstanceUID : sopInstanceUIDs) {
if (!StringUtil.hasText(sopInstanceUID)) {
continue;
}
DicomParam[] keysInstance = {
// Matching Keys
new DicomParam(Tag.SOPInstanceUID, sopInstanceUID),
// Return Keys
CFind.PatientID, CFind.IssuerOfPatientID, CFind.PatientName, CFind.PatientBirthDate, CFind.PatientSex,
CFind.ReferringPhysicianName, CFind.StudyDescription, CFind.StudyDate, CFind.StudyTime,
CFind.AccessionNumber, CFind.StudyInstanceUID, CFind.StudyID, CFind.SeriesInstanceUID, CFind.Modality,
CFind.SeriesNumber, CFind.SeriesDescription };
try {
DicomState state =
CFind.process(advParams, callingNode, calledNode, 0, QueryRetrieveLevel.IMAGE, keysInstance);
LOGGER.debug("C-FIND with sopInstanceUID {}", state.getMessage());
List instances = state.getDicomRSP();
if (instances != null && !instances.isEmpty()) {
Attributes dataset = instances.get(0);
Patient patient = getPatient(dataset);
Study study = getStudy(patient, dataset);
Series s = getSeries(study, dataset);
for (Attributes instanceDataSet : instances) {
Integer frame = ServletUtil.getIntegerFromDicomElement(instanceDataSet, Tag.InstanceNumber, null);
String sopUID = instanceDataSet.getString(Tag.SOPInstanceUID);
SopInstance sop = s.getSopInstance(sopUID, frame);
if (sop == null) {
s.addSopInstance(new SopInstance(sopUID, frame));
}
}
}
} catch (Exception e) {
String msg = "DICOM query Error of {}" + getArchiveConfigName();
LOGGER.error(msg, e);
setViewerMessage(new ViewerMessage(msg, e.getMessage(), ViewerMessage.eLevel.ERROR));
}
}
}
開發者ID:nroduit,項目名稱:weasis-pacs-connector,代碼行數:47,
示例16: getTransferSyntax
點讚 1
import org.dcm4che3.data.Tag; //導入依賴的package包/類
/**
* Extract the transfer syntax of a DICOM part 10 file
*
* @param path the path to the file
* @return the transfer syntax
* @throws IOException if there was an error extracting the transfer syntax
*/
public static String getTransferSyntax(Path path) throws IOException
{
Attributes fmi = getFileMetaInformation(path);
return fmi.getString(Tag.TransferSyntaxUID);
}
開發者ID:RSNA,項目名稱:dcmrs-broker,代碼行數:14,
注:本文中的org.dcm4che3.data.Tag類示例整理自Github/MSDocs等源碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。