本文整理汇总了C#中IByteSource类的典型用法代码示例。如果您正苦于以下问题:C# IByteSource类的具体用法?C# IByteSource怎么用?C# IByteSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IByteSource类属于命名空间,在下文中一共展示了IByteSource类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnBeginSequenceItem
public void OnBeginSequenceItem(IByteSource source, uint length)
{
if (_currentSequenceTag.Peek() == DicomTag.DirectoryRecordSequence && _directoryRecordSequence != null)
{
_lookup.Add((uint)source.Position - 8, _directoryRecordSequence.LastOrDefault());
}
}
示例2: OnBeginSequence
public void OnBeginSequence(IByteSource source, DicomTag tag, uint length) {
DicomSequence sq = new DicomSequence(tag);
_sequences.Push(sq);
DicomDataset ds = _datasets.Peek();
ds.Add(sq);
}
示例3: OnBeginSequence
public void OnBeginSequence(IByteSource source, DicomTag tag, uint length)
{
_currentSequenceTag.Push(tag);
if (tag == DicomTag.DirectoryRecordSequence) {
_directoryRecordSequence = _dataset.Get<DicomSequence>(tag);
}
}
示例4: OnBeginSequenceItem
public void OnBeginSequenceItem(IByteSource source, uint length) {
DicomSequence sq = _sequences.Peek();
DicomDataset item = new DicomDataset();
sq.Items.Add(item);
_datasets.Push(item);
}
示例5: BeginRead
public IAsyncResult BeginRead(IByteSource source, IDicomReaderObserver fileMetaInfo, IDicomReaderObserver dataset, AsyncCallback callback, object state) {
_result = DicomReaderResult.Processing;
_source = source;
_fmiObserver = fileMetaInfo;
_dataObserver = dataset;
_async = new EventAsyncResult(callback, state);
ParsePreamble(source, null); // ThreadPool?
return _async;
}
示例6: BeginRead
public IAsyncResult BeginRead(IByteSource source, IDicomReaderObserver observer, DicomTag stop, AsyncCallback callback, object state) {
_stop = stop;
_observer = observer;
_result = DicomReaderResult.Processing;
_exception = null;
_async = new EventAsyncResult(callback, state);
ThreadPool.QueueUserWorkItem(ParseProc, source);
return _async;
}
示例7: BeginRead
public static IAsyncResult BeginRead(
this DicomFileReader @this,
IByteSource source,
IDicomReaderObserver fileMetaInfo,
IDicomReaderObserver dataset,
AsyncCallback callback,
object state)
{
return AsyncFactory.ToBegin(@this.ReadAsync(source, fileMetaInfo, dataset), callback, state);
}
示例8: BeginRead
public static IAsyncResult BeginRead(
this DicomReader @this,
IByteSource source,
IDicomReaderObserver observer,
Func<ParseState, bool> stop,
AsyncCallback callback,
object state)
{
return AsyncFactory.ToBegin(@this.ReadAsync(source, observer, stop), callback, state);
}
示例9: OnBeginFragmentSequence
public void OnBeginFragmentSequence(IByteSource source, DicomTag tag, DicomVR vr)
{
if (vr == DicomVR.OB)
_fragment = new DicomOtherByteFragment(tag);
else if (vr == DicomVR.OW)
_fragment = new DicomOtherWordFragment(tag);
else
throw new DicomDataException("Unexpected VR found for DICOM fragment sequence: {0}", vr.Code);
DicomDataset ds = _datasets.Peek();
ds.Add(_fragment);
}
示例10: OnBeginFragmentSequence
public void OnBeginFragmentSequence(IByteSource source, DicomTag tag, DicomVR vr)
{
_log.Log(
_level,
"{marker:x8}: {padding}{tag} {vrCode} {tagDictionaryEntryName}",
source.Marker,
_pad,
tag,
vr.Code,
tag.DictionaryEntry.Name);
IncreaseDepth();
}
示例11: OnBeginSequence
public void OnBeginSequence(IByteSource source, DicomTag tag, uint length)
{
_log.Log(
_level,
"{marker:x8}: {padding}{tag} SQ {length}",
source.Marker,
_pad,
tag,
tag.DictionaryEntry.Name,
length);
IncreaseDepth();
}
示例12: OnElement
public void OnElement(IByteSource source, DicomTag tag, DicomVR vr, IByteBuffer data)
{
_log.Log(
_level,
"{marker:x8}: {padding}{tag} {vrCode} {tagDictionaryEntryName} [{size}]",
source.Marker,
_pad,
tag,
vr.Code,
tag.DictionaryEntry.Name,
data.Size);
}
示例13: Read
/// <summary>
/// Read DICOM file object.
/// </summary>
/// <param name="source">Byte source to read.</param>
/// <param name="fileMetaInfo">Reader observer for file meta information.</param>
/// <param name="dataset">Reader observer for dataset.</param>
/// <param name="stop">Stop criterion in dataset.</param>
/// <returns>Reader result.</returns>
public DicomReaderResult Read(
IByteSource source,
IDicomReaderObserver fileMetaInfo,
IDicomReaderObserver dataset,
Func<ParseState, bool> stop = null)
{
var parse = Parse(source, fileMetaInfo, dataset, stop);
lock (this.locker)
{
this.fileFormat = parse.Item2;
this.syntax = parse.Item3;
}
return parse.Item1;
}
示例14: OnElement
public void OnElement(IByteSource source, DicomTag tag, DicomVR vr, IByteBuffer data) {
DicomElement element;
switch (vr.Code) {
case "AE": element = new DicomApplicationEntity(tag, data); break;
case "AS": element = new DicomAgeString(tag, data); break;
case "AT": element = new DicomAttributeTag(tag, data); break;
case "CS": element = new DicomCodeString(tag, data); break;
case "DA": element = new DicomDate(tag, data); break;
case "DS": element = new DicomDecimalString(tag, data); break;
case "DT": element = new DicomDateTime(tag, data); break;
case "FD": element = new DicomFloatingPointDouble(tag, data); break;
case "FL": element = new DicomFloatingPointSingle(tag, data); break;
case "IS": element = new DicomIntegerString(tag, data); break;
case "LO": element = new DicomLongString(tag, _encodings.Peek(), data); break;
case "LT": element = new DicomLongText(tag, _encodings.Peek(), data); break;
case "OB": element = new DicomOtherByte(tag, data); break;
case "OD": element = new DicomOtherDouble(tag, data); break;
case "OF": element = new DicomOtherFloat(tag, data); break;
case "OW": element = new DicomOtherWord(tag, data); break;
case "PN": element = new DicomPersonName(tag, _encodings.Peek(), data); break;
case "SH": element = new DicomShortString(tag, _encodings.Peek(), data); break;
case "SL": element = new DicomSignedLong(tag, data); break;
case "SS": element = new DicomSignedShort(tag, data); break;
case "ST": element = new DicomShortText(tag, _encodings.Peek(), data); break;
case "TM": element = new DicomTime(tag, data); break;
case "UC": element = new DicomUnlimitedCharacters(tag, _encodings.Peek(), data); break;
case "UI": element = new DicomUniqueIdentifier(tag, data); break;
case "UL": element = new DicomUnsignedLong(tag, data); break;
case "UN": element = new DicomUnknown(tag, data); break;
case "UR": element = new DicomUniversalResource(tag, _encodings.Peek(), data); break;
case "US": element = new DicomUnsignedShort(tag, data); break;
case "UT": element = new DicomUnlimitedText(tag, _encodings.Peek(), data); break;
default:
throw new DicomDataException("Unhandled VR in DICOM parser observer: {0}", vr.Code);
}
if (element.Tag == DicomTag.SpecificCharacterSet) {
Encoding encoding = _encodings.Peek();
if (element.Count > 0)
encoding = DicomEncoding.GetEncoding(element.Get<string>(0));
_encodings.Pop();
_encodings.Push(encoding);
}
DicomDataset ds = _datasets.Peek();
ds.Add(element);
}
示例15: Read
public DicomReaderResult Read(IByteSource source, IDicomReaderObserver observer, DicomTag stop = null) {
return EndRead(BeginRead(source, observer, stop, null, null));
}