예제 #1
0
        private void OnCompletePreamble(IByteTarget target, object state)
        {
            DicomWriter        writer = new DicomWriter(DicomTransferSyntax.ExplicitVRLittleEndian, _options, _target);
            DicomDatasetWalker walker = new DicomDatasetWalker(_fileMetaInfo);

            walker.BeginWalk(writer, OnCompleteFileMetaInfo, walker);
        }
예제 #2
0
		private void OnCompletePreamble(IByteTarget target, object state) {
			// recalculate FMI group length as required by standard
			_fileMetaInfo.RecalculateGroupLengths();

			DicomWriter writer = new DicomWriter(DicomTransferSyntax.ExplicitVRLittleEndian, _options, _target);
			DicomDatasetWalker walker = new DicomDatasetWalker(_fileMetaInfo);
			walker.BeginWalk(writer, OnCompleteFileMetaInfo, walker);
		}
예제 #3
0
        private void OnCompletePreamble(IByteTarget target, object state)
        {
            // recalculate FMI group length as required by standard
            _fileMetaInfo.RecalculateGroupLengths();

            DicomWriter        writer = new DicomWriter(DicomTransferSyntax.ExplicitVRLittleEndian, _options, _target);
            DicomDatasetWalker walker = new DicomDatasetWalker(_fileMetaInfo);

            walker.BeginWalk(writer, OnCompleteFileMetaInfo, walker);
        }
예제 #4
0
        private void OnCompleteFileMetaInfo(IAsyncResult result)
        {
            try {
                DicomDatasetWalker walker;

                if (result != null)
                {
                    walker = result.AsyncState as DicomDatasetWalker;
                    walker.EndWalk(result);
                }

                DicomTransferSyntax syntax = _fileMetaInfo.TransferSyntax;

                DicomWriter writer = new DicomWriter(syntax, _options, _target);
                walker = new DicomDatasetWalker(_dataset);
                walker.BeginWalk(writer, OnCompleteDataset, walker);
            } catch (Exception e) {
                _exception = e;
                _async.Set();
            }
        }
예제 #5
0
        private void OnCompleteFileMetaInfo(IAsyncResult result)
        {
            try {
                DicomDatasetWalker walker;

                if (result != null)
                {
                    walker = result.AsyncState as DicomDatasetWalker;
                    walker.EndWalk(result);
                }

                //DicomTransferSyntax syntax = _fileMetaInfo.TransferSyntax;
                DicomTransferSyntax syntax = _fileMetaInfo.InternalTransferSyntax;
                if (_options.KeepGroupLengths)
                {
                    // update transfer syntax and recalculate existing group lengths
                    _dataset.InternalTransferSyntax = syntax;
                    _dataset.RecalculateGroupLengths(false);
                }
                else
                {
                    // remove group lengths as suggested in PS 3.5 7.2
                    //
                    //	2. It is recommended that Group Length elements be removed during storage or transfer
                    //	   in order to avoid the risk of inconsistencies arising during coercion of data
                    //	   element values and changes in transfer syntax.
                    _dataset.RemoveGroupLengths();
                }

                DicomWriter writer = new DicomWriter(syntax, _options, _target);
                walker = new DicomDatasetWalker(_dataset);
                walker.BeginWalk(writer, OnCompleteDataset, walker);
            } catch (Exception e) {
                _exception = e;
                _async.Set();
            }
        }
예제 #6
0
        private void OnCompleteFileMetaInfo(IAsyncResult result)
        {
            try
            {
                DicomDatasetWalker walker;

                if (result != null)
                {
                    walker = result.AsyncState as DicomDatasetWalker;
                    walker.EndWalk(result);
                }

                DicomTransferSyntax syntax = _fileMetaInfo.TransferSyntax;

                if (_options.KeepGroupLengths)
                {
                    // update transfer syntax and recalculate existing group lengths
                    _dataset.InternalTransferSyntax = syntax;
                    _dataset.RecalculateGroupLengths(false);
                }
                else
                {
                    // remove group lengths as suggested in PS 3.5 7.2
                    //
                    //	2. It is recommended that Group Length elements be removed during storage or transfer
                    //	   in order to avoid the risk of inconsistencies arising during coercion of data
                    //	   element values and changes in transfer syntax.
                    _dataset.RemoveGroupLengths();
                }

                DicomWriter writer = new DicomWriter(syntax, _options, _target);
                walker = new DicomDatasetWalker(_dataset);
                walker.BeginWalk(writer, OnCompleteDataset, walker);
            }
            catch (Exception e)
            {
                _exception = e;
                _async.Set();
            }
        }
예제 #7
0
 private void OnCompletePreamble(IByteTarget target, object state)
 {
     DicomWriter writer = new DicomWriter(DicomTransferSyntax.ExplicitVRLittleEndian, _options, _target);
     DicomDatasetWalker walker = new DicomDatasetWalker(_fileMetaInfo);
     walker.BeginWalk(writer, OnCompleteFileMetaInfo, walker);
 }
예제 #8
0
        private void OnCompleteFileMetaInfo(IAsyncResult result)
        {
            try {
                DicomDatasetWalker walker;

                if (result != null) {
                    walker = result.AsyncState as DicomDatasetWalker;
                    walker.EndWalk(result);
                }

                DicomTransferSyntax syntax = _fileMetaInfo.TransferSyntax;

                DicomWriter writer = new DicomWriter(syntax, _options, _target);
                walker = new DicomDatasetWalker(_dataset);
                walker.BeginWalk(writer, OnCompleteDataset, walker);
            } catch (Exception e) {
                _exception = e;
                _async.Set();
            }
        }