本文整理汇总了C#中Dicom.Data.DicomTransferSyntax类的典型用法代码示例。如果您正苦于以下问题:C# DicomTransferSyntax类的具体用法?C# DicomTransferSyntax怎么用?C# DicomTransferSyntax使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DicomTransferSyntax类属于Dicom.Data命名空间,在下文中一共展示了DicomTransferSyntax类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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;
}
示例3: DcmDataset
public DcmDataset(long streamPosition, uint lengthInStream, DicomTransferSyntax transferSyntax)
{
_streamPosition = streamPosition;
_streamLength = lengthInStream;
_transferSyntax = transferSyntax;
_items = new SortedList<DicomTag, DcmItem>(new DicomTagComparer());
}
示例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);
}
示例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!");
}
示例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;
}
示例7: CalculateWriteLength
public abstract uint CalculateWriteLength(DicomTransferSyntax syntax, DicomWriteOptions options);
示例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);
}
示例9: DcmJpegCodec
protected DcmJpegCodec(DicomTransferSyntax transferSyntax, DcmJpegParameters defaultParameters = null)
{
_transferSyntax = transferSyntax;
_defaultParameters = defaultParameters ?? new DcmJpegParameters();
}
示例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;
}
示例11: RemoveTransfer
public void RemoveTransfer(DicomTransferSyntax ts)
{
if (_transfers.Contains(ts))
_transfers.Remove(ts);
}
示例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);
}
示例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;
}
示例14: AddTransfer
public void AddTransfer(DicomTransferSyntax ts)
{
if (!_transfers.Contains(ts))
_transfers.Add(ts);
}
示例15: IsImageCompression
public static bool IsImageCompression(DicomTransferSyntax tx) {
return tx != DicomTransferSyntax.ImplicitVRLittleEndian &&
tx != DicomTransferSyntax.ExplicitVRLittleEndian &&
tx != DicomTransferSyntax.ExplicitVRBigEndian &&
tx != DicomTransferSyntax.DeflatedExplicitVRLittleEndian;
}