Index: DicomAttributeMultiValueText.cs =================================================================== --- DicomAttributeMultiValueText.cs (revision 10617) +++ DicomAttributeMultiValueText.cs (working copy) @@ -1362,7 +1362,29 @@ return true; } } - + + public override object Values + { + get + { + return base.Values; + } + set + { + // look for specific float or double, if not then pass on to base + if (value != null && (value is float || value is double || value is int)) + { + if (value is float) + SetFloat32(0, (float)value); + if (value is double) + SetFloat64(0, (double)value); + if (value is int) + SetInt32(0, (int)value); + return; + } + base.Values = value; + } + } } #endregion @@ -1964,7 +1986,39 @@ _values[_values.Length - 1] = value.ToString(); this.StreamLength = (uint)ToString().Length; this.Count = _values.Length; - } + } + + public override object Values + { + get { return _values; } + set + { + if (value == null) + { + _values = null; + StreamLength = 0; + return; + } + + if (value is Int16 || value is Int32 || value is Int64) + { + // reset in case had more than 1 value + //_values = null or new string[0]; + //StreamLength = 0; + if (value is Int16) + SetInt16(0, (Int16)value); + else if (value is Int32) + SetInt32(0, (Int32)value); + else if (value is Int64) + SetInt64(0, (Int64)value); + } + else + { + base.Values = value; + } + + } + } } #endregion Index: Iod/Sequences/BasicGrayscaleImageSequenceIod.cs =================================================================== --- Iod/Sequences/BasicGrayscaleImageSequenceIod.cs (revision 10617) +++ Iod/Sequences/BasicGrayscaleImageSequenceIod.cs (working copy) @@ -203,9 +203,10 @@ DicomFile dicomFile = new DicomFile(filePath); dicomFile.Load(); - AddDicomFileValues(dicomFile); + AddDicomFileValues(dicomFile.DataSet); } + /// /// Adds the attribute values for the specified . Tags it sets are: /// ImageType, SopClassUid, SopInstanceUid, StudyInstanceUid, SamplesPerPixel, PhotometricInterpretation,NumberOfFrames, @@ -216,46 +217,48 @@ { if (dicomFile == null) throw new ArgumentNullException("dicomFile"); + AddDicomFileValues(dicomFile.DataSet); + } - try + public void AddDicomFileValues(IDicomAttributeProvider dicomAttributes) + { + uint[] dicomTags = new uint[] + { + DicomTags.ImageType, + DicomTags.SopClassUid, + DicomTags.SopInstanceUid, + DicomTags.StudyInstanceUid, + DicomTags.SamplesPerPixel, + DicomTags.PhotometricInterpretation, + DicomTags.NumberOfFrames, + DicomTags.Rows, + DicomTags.Columns, + DicomTags.BitsAllocated, + DicomTags.BitsStored, + DicomTags.HighBit, + DicomTags.PixelRepresentation, + DicomTags.SmallestImagePixelValue, + DicomTags.LargestImagePixelValue, + DicomTags.WindowCenter, + DicomTags.WindowWidth, + DicomTags.PixelData + }; + + foreach (uint dicomTag in dicomTags) { - uint[] dicomTags = new uint[] - { - DicomTags.ImageType, - DicomTags.SopClassUid, - DicomTags.SopInstanceUid, - DicomTags.StudyInstanceUid, - DicomTags.SamplesPerPixel, - DicomTags.PhotometricInterpretation, - DicomTags.NumberOfFrames, - DicomTags.Rows, - DicomTags.Columns, - DicomTags.BitsAllocated, - DicomTags.BitsStored, - DicomTags.HighBit, - DicomTags.PixelRepresentation, - DicomTags.SmallestImagePixelValue, - DicomTags.LargestImagePixelValue, - DicomTags.WindowCenter, - DicomTags.WindowWidth, - DicomTags.PixelData - }; + try + { - foreach (uint dicomTag in dicomTags) - { DicomAttribute dicomAttribute; - if (dicomFile.DataSet.TryGetAttribute(dicomTag, out dicomAttribute)) + if (dicomAttributes.TryGetAttribute(dicomTag, out dicomAttribute)) DicomAttributeProvider[dicomTag].Values = dicomAttribute.Values; } + catch (Exception ex) + { + Platform.Log(LogLevel.Error, ex, "Exception adding dicom tag value for uint: " + dicomTag); + throw; + } } - catch (Exception ex) - { - Platform.Log(LogLevel.Error, ex, "Exception adding dicom file value for file: {0}", dicomFile.Filename); - throw; - } } - } - - } Index: Iod/Sequences/ScheduledProcedureStepSequenceIod.cs =================================================================== --- Iod/Sequences/ScheduledProcedureStepSequenceIod.cs (revision 10617) +++ Iod/Sequences/ScheduledProcedureStepSequenceIod.cs (working copy) @@ -30,6 +30,7 @@ #endregion using System; +using ClearCanvas.Dicom.Iod.Macros; namespace ClearCanvas.Dicom.Iod.Sequences { @@ -138,7 +139,11 @@ get { return base.DicomAttributeProvider[DicomTags.PreMedication].GetString(0, String.Empty); } set { base.DicomAttributeProvider[DicomTags.PreMedication].SetString(0, value); } } - + + public SequenceIodList ScheduledProtocolCodeSequenceList + { + get { return new SequenceIodList(DicomAttributeProvider[DicomTags.ScheduledProtocolCodeSequence] as DicomAttributeSQ); } + } #endregion #region Public Methods Index: Network/DicomClient.cs =================================================================== --- Network/DicomClient.cs (revision 10617) +++ Network/DicomClient.cs (working copy) @@ -213,6 +213,18 @@ } } + public void Abort() + { + try + { + SendAssociateAbort(DicomAbortSource.ServiceUser, DicomAbortReason.NotSpecified); + } + finally + { + CloseNetwork(); + } + } + private void ConnectTLS() { _closedOnError = false; @@ -299,6 +311,7 @@ { return _closedEvent.WaitOne(timeout, true); } + #endregion #region NetworkBase Overrides @@ -510,7 +523,8 @@ if (disposing) { // Dispose of other Managed objects, ie - CloseNetwork(); + Abort(); + //CloseNetwork(); } // FREE UNMANAGED RESOURCES _disposed = true; Index: Network/NetworkBase.cs =================================================================== --- Network/NetworkBase.cs (revision 10617) +++ Network/NetworkBase.cs (working copy) @@ -237,7 +237,7 @@ { if (!Thread.CurrentThread.Equals(_thread)) { - _thread.Join(); + _thread.Join(2500); _thread = null; } } Index: Network/Scu/ScuBase.cs =================================================================== --- Network/Scu/ScuBase.cs (revision 10617) +++ Network/Scu/ScuBase.cs (working copy) @@ -292,7 +292,15 @@ } return iodList; } - + + public void Abort() + { + if (_dicomClient != null) + { + _dicomClient.Abort(); + } + } + #endregion #region Protected Methods... Index: Network/Scu/VerificationScu.cs =================================================================== --- Network/Scu/VerificationScu.cs (revision 10617) +++ Network/Scu/VerificationScu.cs (working copy) @@ -117,6 +117,8 @@ return VerificationResult.Canceled; else if (base.Status == ScuOperationStatus.TimeoutExpired) return VerificationResult.TimeoutExpired; + else if (Status == ScuOperationStatus.AssociationRejected) + return VerificationResult.AssociationRejected; else return _verificationResult; } @@ -267,6 +269,8 @@ TimeoutExpired = 2, /// - Canceled = 3 + Canceled = 3, + + AssociationRejected } } \ No newline at end of file