本文整理汇总了C#中Dicom.Data.DicomTransferSyntax类的典型用法代码示例。如果您正苦于以下问题:C# DicomTransferSyntax类的具体用法?C# DicomTransferSyntax怎么用?C# DicomTransferSyntax使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DicomTransferSyntax类属于Dicom.Data命名空间,在下文中一共展示了DicomTransferSyntax类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: DcmPresContext
internal DcmPresContext(byte pcid, DicomUID abstractSyntax, DicomTransferSyntax transferSyntax, DcmPresContextResult result) {
_pcid = pcid;
_result = result;
_abstract = abstractSyntax;
_transfers = new List<DicomTransferSyntax>();
_transfers.Add(transferSyntax);
}
开发者ID:mcmssupereditor,项目名称:mdcm,代码行数:7,代码来源:DcmAssociate.cs
示例2: CalculateWriteLength
internal override uint CalculateWriteLength(DicomTransferSyntax syntax, DicomWriteOptions options) {
uint length = 4 + 4;
length += Dataset.CalculateWriteLength(syntax, options & ~DicomWriteOptions.CalculateGroupLengths);
if (!Flags.IsSet(options, DicomWriteOptions.ExplicitLengthSequenceItem))
length += 4 + 4; // Sequence Item Delimitation Item
return length;
}
开发者ID:hide1980,项目名称:mdcm,代码行数:7,代码来源:DcmItemSequence.cs
示例3: DcmDataset
public DcmDataset(long streamPosition, uint lengthInStream, DicomTransferSyntax transferSyntax)
{
_streamPosition = streamPosition;
_streamLength = lengthInStream;
_transferSyntax = transferSyntax;
_items = new SortedList<DicomTag, DcmItem>(new DicomTagComparer());
}
开发者ID:karanbajaj,项目名称:mdcm,代码行数:7,代码来源:DcmDataset.cs
示例4: HasCodec
public static bool HasCodec(DicomTransferSyntax ts) {
if (ts == DicomTransferSyntax.ImplicitVRLittleEndian ||
ts == DicomTransferSyntax.ExplicitVRLittleEndian ||
ts == DicomTransferSyntax.ExplicitVRBigEndian)
return true;
if (_codecs == null)
return false;
return _codecs.ContainsKey(ts);
}
开发者ID:mcmssupereditor,项目名称:mdcm,代码行数:9,代码来源:DicomCodec.cs
示例5: GetCodec
public static IDcmCodec GetCodec(DicomTransferSyntax ts) {
if (_codecs == null)
RegisterCodecs();
Type cType;
if (_codecs.TryGetValue(ts, out cType)) {
return (IDcmCodec)Activator.CreateInstance(cType);
}
throw new DicomCodecException("No registered codec for transfer syntax!");
}
开发者ID:mcmssupereditor,项目名称:mdcm,代码行数:9,代码来源:DicomCodec.cs
示例6: CalculateWriteLength
public override uint CalculateWriteLength(DicomTransferSyntax syntax, DicomWriteOptions options)
{
uint length = 0;
length += 4; // element tag
if (syntax.IsExplicitVR) {
length += 2; // vr
length += 6; // length
} else {
length += 4; // length
}
foreach (DcmItemSequenceItem item in SequenceItems) {
length += item.CalculateWriteLength(syntax, options);
}
if (!Flags.IsSet(options, DicomWriteOptions.ExplicitLengthSequence))
length += 4 + 4; // Sequence Delimitation Item
return length;
}
开发者ID:gogorrr,项目名称:mdcm,代码行数:17,代码来源:DcmItemSequence.cs
示例7: CalculateWriteLength
public abstract uint CalculateWriteLength(DicomTransferSyntax syntax, DicomWriteOptions options);
开发者ID:gogorrr,项目名称:mdcm,代码行数:1,代码来源:DcmItem.cs
示例8: ChangeTransferSyntax
public void ChangeTransferSyntax(DicomTransferSyntax newTransferSyntax, DcmCodecParameters parameters)
{
DicomTransferSyntax oldTransferSyntax = InternalTransferSyntax;
if (oldTransferSyntax == newTransferSyntax)
return;
if (oldTransferSyntax.IsEncapsulated && newTransferSyntax.IsEncapsulated) {
ChangeTransferSyntax(DicomTransferSyntax.ExplicitVRLittleEndian, parameters);
oldTransferSyntax = DicomTransferSyntax.ExplicitVRLittleEndian;
}
if (Contains(DicomTags.PixelData)) {
DcmPixelData oldPixelData = new DcmPixelData(this);
DcmPixelData newPixelData = new DcmPixelData(newTransferSyntax, oldPixelData);
if (oldTransferSyntax.IsEncapsulated) {
IDcmCodec codec = DicomCodec.GetCodec(oldTransferSyntax);
codec.Decode(this, oldPixelData, newPixelData, parameters);
}
else if (newTransferSyntax.IsEncapsulated) {
IDcmCodec codec = DicomCodec.GetCodec(newTransferSyntax);
codec.Encode(this, oldPixelData, newPixelData, parameters);
}
else {
for (int i = 0; i < oldPixelData.NumberOfFrames; i++) {
byte[] data = oldPixelData.GetFrameDataU8(i);
newPixelData.AddFrame(data);
}
}
newPixelData.UpdateDataset(this);
}
SetInternalTransferSyntax(newTransferSyntax);
}
开发者ID:karanbajaj,项目名称:mdcm,代码行数:36,代码来源:DcmDataset.cs
示例9: DcmJpegCodec
protected DcmJpegCodec(DicomTransferSyntax transferSyntax, DcmJpegParameters defaultParameters = null)
{
_transferSyntax = transferSyntax;
_defaultParameters = defaultParameters ?? new DcmJpegParameters();
}
开发者ID:GMZ,项目名称:mdcm,代码行数:5,代码来源:DcmJpegCodec.cs
示例10: CalculateWriteLength
public uint CalculateWriteLength(DicomTransferSyntax syntax, DicomWriteOptions options)
{
uint length = 0;
ushort group = 0xffff;
foreach (DcmItem item in _items.Values) {
if (item.Tag.Element == 0x0000)
continue;
if (item.Tag.Group != group) {
group = item.Tag.Group;
if (Flags.IsSet(options, DicomWriteOptions.CalculateGroupLengths)) {
if (syntax.IsExplicitVR)
length += 4 + 2 + 2 + 4;
else
length += 4 + 4 + 4;
}
}
length += item.CalculateWriteLength(syntax, options);
}
return length;
}
开发者ID:karanbajaj,项目名称:mdcm,代码行数:20,代码来源:DcmDataset.cs
示例11: RemoveTransfer
public void RemoveTransfer(DicomTransferSyntax ts)
{
if (_transfers.Contains(ts))
_transfers.Remove(ts);
}
开发者ID:hide1980,项目名称:mdcm,代码行数:5,代码来源:DcmAssociate.cs
示例12: RemoveTransferSyntax
/// <summary>
/// Removes a Transfer Syntax from the specified Presentation Context.
/// </summary>
/// <param name="pcid">Presentation Context ID</param>
/// <param name="ts">Transfer Syntax</param>
public void RemoveTransferSyntax(byte pcid, DicomTransferSyntax ts)
{
GetPresentationContext(pcid).RemoveTransfer(ts);
}
开发者ID:hide1980,项目名称:mdcm,代码行数:9,代码来源:DcmAssociate.cs
示例13: ChangeTransferSytnax
/// <summary>
/// Changes transfer syntax of dataset and updates file meta information
/// </summary>
/// <param name="ts">New transfer syntax</param>
/// <param name="parameters">Encode/Decode params</param>
public void ChangeTransferSytnax(DicomTransferSyntax ts, DcmCodecParameters parameters) {
Dataset.ChangeTransferSyntax(ts, parameters);
FileMetaInfo.TransferSyntax = ts;
}
开发者ID:mcmssupereditor,项目名称:mdcm,代码行数:9,代码来源:DicomFileFormat.cs
示例14: AddTransfer
public void AddTransfer(DicomTransferSyntax ts)
{
if (!_transfers.Contains(ts))
_transfers.Add(ts);
}
开发者ID:hide1980,项目名称:mdcm,代码行数:5,代码来源:DcmAssociate.cs
示例15: IsImageCompression
public static bool IsImageCompression(DicomTransferSyntax tx) {
return tx != DicomTransferSyntax.ImplicitVRLittleEndian &&
tx != DicomTransferSyntax.ExplicitVRLittleEndian &&
tx != DicomTransferSyntax.ExplicitVRBigEndian &&
tx != DicomTransferSyntax.DeflatedExplicitVRLittleEndian;
}
开发者ID:hide1980,项目名称:mdcm,代码行数:6,代码来源:DicomTransferSyntax.cs
示例16: ParseSequenceItemDataset
private DicomReadStatus ParseSequenceItemDataset(DicomTransferSyntax syntax, long len, out DcmDataset dataset, DicomReadOptions options)
{
long pos = _stream.Position;
dataset = new DcmDataset(pos, (uint)len, syntax);
Stream stream = (len != UndefinedLength) ? new SegmentStream(_stream, _stream.Position, _len) : _stream;
DicomStreamReader idsr = new DicomStreamReader(stream);
idsr.Dataset = dataset;
idsr.Encoding = _encoding;
if (len != UndefinedLength)
idsr.PositionOffset = dataset.StreamPosition;
DicomReadStatus status = idsr.Read(null, options);
if (status != DicomReadStatus.Success) {
_stream.Seek(pos, SeekOrigin.Begin);
dataset = null;
}
else {
if (len == UndefinedLength) {
// rewind delimitation item tag
_stream.Seek(-4, SeekOrigin.Current);
len = _stream.Position - pos;
}
_remain -= len;
_bytes += len;
_read += len;
}
return status;
}
开发者ID:JeanLedesma,项目名称:mdcm,代码行数:35,代码来源:DicomStreamReader.cs
示例17: InsertSequenceItem
private DicomReadStatus InsertSequenceItem(DicomReadOptions options)
{
if (_tag.Equals(DicomTags.Item)) {
if (_len != UndefinedLength && _len > _remain)
return NeedMoreData(_len);
if (_sds.Count > _sqs.Count)
_sds.Pop();
DcmItemSequenceItem si = new DcmItemSequenceItem(_pos, _len);
if (_len != UndefinedLength || (_stream.CanSeek && Flags.IsSet(options, DicomReadOptions.AllowSeekingForContext))) {
if (_len == UndefinedLength)
options |= DicomReadOptions.SequenceItemOnly;
DcmDataset ds = null;
DicomReadStatus status = ParseSequenceItemDataset(TransferSyntax, _len, out ds, options);
if (status != DicomReadStatus.Success) {
Dicom.Debug.Log.Warn("Unknown error while attempting to read sequence item. Trying again with alternate encodings.");
DicomTransferSyntax[] syntaxes = null;
if (TransferSyntax == DicomTransferSyntax.ExplicitVRBigEndian)
syntaxes = new DicomTransferSyntax[] { DicomTransferSyntax.ImplicitVRLittleEndian, DicomTransferSyntax.ExplicitVRLittleEndian };
else if (TransferSyntax.IsExplicitVR)
syntaxes = new DicomTransferSyntax[] { DicomTransferSyntax.ImplicitVRLittleEndian, DicomTransferSyntax.ExplicitVRBigEndian };
else
syntaxes = new DicomTransferSyntax[] { DicomTransferSyntax.ExplicitVRLittleEndian, DicomTransferSyntax.ExplicitVRBigEndian };
foreach (DicomTransferSyntax tx in syntaxes) {
status = ParseSequenceItemDataset(tx, _len, out ds, options);
if (status == DicomReadStatus.Success)
break;
}
}
if (status != DicomReadStatus.Success)
return DicomReadStatus.UnknownError;
si.Dataset = ds;
if (_len == UndefinedLength) {
if (8 > _remain) {
// need more data?
_sds.Push(ds);
}
else {
// skip delimitation item
_stream.Seek(8, SeekOrigin.Current);
_remain -= 8;
_bytes += 8;
_read += 8;
}
}
}
else {
DcmDataset ds = new DcmDataset(_pos + 8, _len, TransferSyntax);
_sds.Push(ds);
}
_sqs.Peek().AddSequenceItem(si);
}
else if (_tag == DicomTags.ItemDelimitationItem) {
if (_sds.Count == _sqs.Count)
_sds.Pop();
}
else if (_tag == DicomTags.SequenceDelimitationItem) {
if (_sds.Count == _sqs.Count)
_sds.Pop();
_sqs.Pop();
}
return DicomReadStatus.Success;
}
开发者ID:JeanLedesma,项目名称:mdcm,代码行数:73,代码来源:DicomStreamReader.cs
示例18: AddPresentationContext
public void AddPresentationContext(byte pcid, DicomUID abstractSyntax, DicomTransferSyntax transferSyntax, DcmPresContextResult result)
{
_presContexts.Add(pcid, new DcmPresContext(pcid, abstractSyntax, transferSyntax, result));
}
开发者ID:hide1980,项目名称:mdcm,代码行数:4,代码来源:DcmAssociate.cs
示例19: FindAcceptedAbstractSyntaxWithTransferSyntax
/// <summary>
/// Finds the Presentation Context with the specified Abstract Syntax and Transfer Syntax.
/// </summary>
/// <param name="abstractSyntax">Abstract Syntax</param>
/// <param name="transferSyntax">Transfer Syntax</param>
/// <returns>Presentation Context ID</returns>
public byte FindAcceptedAbstractSyntaxWithTransferSyntax(DicomUID abstractSyntax, DicomTransferSyntax trasferSyntax)
{
foreach (DcmPresContext ctx in _presContexts.Values) {
if (ctx.Result == DcmPresContextResult.Accept && ctx.AbstractSyntax == abstractSyntax && ctx.HasTransfer(trasferSyntax))
return ctx.ID;
}
return 0;
}
开发者ID:hide1980,项目名称:mdcm,代码行数:14,代码来源:DcmAssociate.cs
示例20: CalculateGroupWriteLength
public uint CalculateGroupWriteLength(ushort group, DicomTransferSyntax syntax, DicomWriteOptions options)
{
uint length = 0;
foreach (DcmItem item in _items.Values) {
if (item.Tag.Group < group || item.Tag.Element == 0x0000)
continue;
if (item.Tag.Group > group)
return length;
length += item.CalculateWriteLength(syntax, options);
}
return length;
}
开发者ID:karanbajaj,项目名称:mdcm,代码行数:12,代码来源:DcmDataset.cs
注:本文中的Dicom.Data.DicomTransferSyntax类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论