public override IECGFormat getECGByUI(object ui) { if (Works() && (ui != null) && (ui.GetType() == typeof(PACSUID))) { BasicSCU scu = new BasicSCU(_Config["AESCU"], _Config["AESCP"], _Config["Server"], int.Parse(_Config["Port"]), 5000); PACSUID uid = (PACSUID)ui; if (Config["WADO URL"] == null) { Dataset[] ds = scu.CGet(uid.StudyInstanceUID, uid.SeriesInstanceUID, uid.SOPInstanceUID); if ((ds != null) && (ds.Length > 0)) { IECGFormat ret = new DICOMFormat(ds[0]); if (ret.Works()) { return(ret); } } } else { Dataset ds = scu.WADOGet(Config["WADO URL"], uid.StudyInstanceUID, uid.SeriesInstanceUID, uid.SOPInstanceUID); if (ds != null) { IECGFormat ret = new DICOMFormat(ds); if (ret.Works()) { return(ret); } } } } return(null); }
public override IECGFormat Read(Stream input, int offset, ECGConfig cfg) { LastError = 0; IECGFormat ret = null; if ((input != null) && (input.CanRead)) { ret = new DICOMFormat(); if (ret.Config != null) { ret.Config.Set(cfg); if (!ret.Config.ConfigurationWorks()) { LastError = 3; return(null); } } if (ret.CheckFormat(input, offset)) { LastError = (ret.Read(input, offset) << 2); } if (!ret.Works()) { LastError = 2; ret = null; } } else { LastError = 1; } return(ret); }
public override IECGFormat Read(byte[] buffer, int offset, ECGConfig cfg) { LastError = 0; IECGFormat ret = null; if (buffer != null) { ret = new DICOMFormat(); if (ret.Config != null) { ret.Config.Set(cfg); if (!ret.Config.ConfigurationWorks()) { LastError = 3; return(null); } } if (ret.CheckFormat(buffer, offset)) { LastError = (ret.Read(buffer, offset) << 2); } if (!ret.Works()) { LastError = 2; ret = null; } } else { LastError = 1; } return(ret); }