本文整理汇总了Java中org.dcm4che3.data.Attributes.getString方法的典型用法代码示例。如果您正苦于以下问题:Java Attributes.getString方法的具体用法?Java Attributes.getString怎么用?Java Attributes.getString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.dcm4che3.data.Attributes
的用法示例。
在下文中一共展示了Attributes.getString方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onDimseRSP
import org.dcm4che3.data.Attributes; //导入方法依赖的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, "");
}
}
示例2: fillSeries
import org.dcm4che3.data.Attributes; //导入方法依赖的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<Attributes> 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);
}
}
}
}
示例3: getPatient
import org.dcm4che3.data.Attributes; //导入方法依赖的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;
}
示例4: getStudy
import org.dcm4che3.data.Attributes; //导入方法依赖的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;
}
示例5: store
import org.dcm4che3.data.Attributes; //导入方法依赖的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);
}
示例6: writeObject
import org.dcm4che3.data.Attributes; //导入方法依赖的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);
}
}
}
示例7: fillInstance
import org.dcm4che3.data.Attributes; //导入方法依赖的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<Attributes> 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));
}
}
}
}
}
示例8: getSeries
import org.dcm4che3.data.Attributes; //导入方法依赖的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;
}
示例9: buildFromSopInstanceUID
import org.dcm4che3.data.Attributes; //导入方法依赖的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<Attributes> 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));
}
}
}
示例10: getTransferSyntax
import org.dcm4che3.data.Attributes; //导入方法依赖的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);
}