本文整理汇总了C#中Dicom.Data.DcmDataset.GetString方法的典型用法代码示例。如果您正苦于以下问题:C# DcmDataset.GetString方法的具体用法?C# DcmDataset.GetString怎么用?C# DcmDataset.GetString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dicom.Data.DcmDataset
的用法示例。
在下文中一共展示了DcmDataset.GetString方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DcmPixelData
public DcmPixelData(DcmDataset dataset) {
_transferSyntax = dataset.InternalTransferSyntax;
_lossy = dataset.GetString(DicomTags.LossyImageCompression, "00") != "00";
_lossyMethod = dataset.GetString(DicomTags.LossyImageCompressionMethod, String.Empty);
_lossyRatio = dataset.GetString(DicomTags.LossyImageCompressionRatio, String.Empty);
_frames = dataset.GetInt32(DicomTags.NumberOfFrames, 1);
_width = dataset.GetUInt16(DicomTags.Columns, 0);
_height = dataset.GetUInt16(DicomTags.Rows, 0);
_bitsStored = dataset.GetUInt16(DicomTags.BitsStored, 0);
_bitsAllocated = dataset.GetUInt16(DicomTags.BitsAllocated, 0);
_highBit = dataset.GetUInt16(DicomTags.HighBit, (ushort)(_bitsStored - 1));
_samplesPerPixel = dataset.GetUInt16(DicomTags.SamplesPerPixel, 0);
_pixelRepresentation = dataset.GetUInt16(DicomTags.PixelRepresentation, 0);
_planarConfiguration = dataset.GetUInt16(DicomTags.PlanarConfiguration, 0);
_photometricInterpretation = dataset.GetString(DicomTags.PhotometricInterpretation, String.Empty);
_rescaleSlope = dataset.GetDouble(DicomTags.RescaleSlope, 1.0);
_rescaleIntercept = dataset.GetDouble(DicomTags.RescaleIntercept, 0.0);
_pixelDataItem = dataset.GetItem(DicomTags.PixelData);
_hasPixelPadding = dataset.Contains(DicomTags.PixelPaddingValue);
if (_hasPixelPadding) {
DcmElement elem = dataset.GetElement(DicomTags.PixelPaddingValue);
if (elem is DcmUnsignedShort)
_pixelPaddingValue = (elem as DcmUnsignedShort).GetValue();
else if (elem is DcmSignedShort) {
_pixelPaddingValue = (elem as DcmSignedShort).GetValue();
} else
_pixelPaddingValue = MinimumDataValue;
}
}
示例2: SendCMoveRequest
protected void SendCMoveRequest(byte presentationID, ushort messageID, string destinationAE, DcmPriority priority, DcmDataset dataset)
{
String level = dataset.GetString(DicomTags.QueryRetrieveLevel, "UNKNOWN");
DicomUID affectedClass = Associate.GetAbstractSyntax(presentationID);
DcmCommand command = CreateRequest(messageID, DcmCommandField.CMoveRequest, affectedClass, priority, true);
command.MoveDestinationAE = destinationAE;
Log.Info("{0} -> C-Move request [pc: {1}; id: {2}; lvl: {3}; dest: {4}]", LogID, presentationID, messageID, level, destinationAE);
SendDimse(presentationID, command, dataset);
}
示例3: Load
private void Load(DcmDataset ds) {
_rows = ds.GetUInt16(OverlayTag(DicomTags.OverlayRows), 0);
_columns = ds.GetUInt16(OverlayTag(DicomTags.OverlayColumns), 0);
_type = ds.GetString(OverlayTag(DicomTags.OverlayType), "Unknown");
DicomTag tag = OverlayTag(DicomTags.OverlayOrigin);
if (ds.Contains(tag)) {
short[] xy = ds.GetSS(tag).GetValues();
if (xy != null && xy.Length == 2) {
_originX = xy[0];
_originY = xy[1];
}
}
_bitsAllocated = ds.GetUInt16(OverlayTag(DicomTags.OverlayBitsAllocated), 1);
_bitPosition = ds.GetUInt16(OverlayTag(DicomTags.OverlayBitPosition), 0);
tag = OverlayTag(DicomTags.OverlayData);
if (ds.Contains(tag)) {
DcmElement elem = ds.GetElement(tag);
_data = elem.ByteBuffer.ToBytes();
}
_description = ds.GetString(OverlayTag(DicomTags.OverlayDescription), String.Empty);
_subtype = ds.GetString(OverlayTag(DicomTags.OverlaySubtype), String.Empty);
_label = ds.GetString(OverlayTag(DicomTags.OverlayLabel), String.Empty);
_frames = ds.GetInt32(OverlayTag(DicomTags.NumberOfFramesInOverlay), 1);
_frameOrigin = ds.GetUInt16(OverlayTag(DicomTags.ImageFrameOrigin), 1);
//TODO: include ROI
}
示例4: FilterByStudyDate
private static Expression<Func<Study, bool>> FilterByStudyDate(DcmDataset query)
{
Expression<Func<Study, bool>> allMatch = p => true;
var studyQuery = query.GetElement(DicomTags.StudyDate);
if (studyQuery == null)
return allMatch;
var valueString = studyQuery.GetValueString();
if (String.IsNullOrWhiteSpace(valueString))
return allMatch;
var dateTimeRange = DateTimeRangeQuery.Parse(valueString, query.GetString(DicomTags.StudyTime, null));
return s => s.PerformedDateTime >= dateTimeRange.From && s.PerformedDateTime <= dateTimeRange.To;
}
示例5: SaveDimseToFile
private void SaveDimseToFile(DcmDataset dataset)
{
var now = DateTime.Now;
Trace.WriteLine(String.Format("{0} Receive DIMSE {1} from {2} ", now, dataset.GetString(DicomTags.Modality, "UN"), this.Associate.CallingAE));
ImageCountOnConnection++;
bool isFiltered = IsFilteredOutData(dataset);
if (isFiltered && !Settings.Default.ReceiveFilter_Keep)
return;
var fileName = GetFileNameForDicomDataset(dataset);
string filePath;
if (!isFiltered)
{
filePath = DefineStorageLocationOfFile(fileName);
}
else
{
filePath = Path.Combine(Settings.Default.ReceiveFilter_Folder, fileName);
}
Trace.WriteLine(String.Format("{0} Saving DIMSE {1} from {2} to {3} ", now, dataset.GetString(DicomTags.Modality, "UN"), this.Associate.CallingAE, filePath));
var ff = new DicomFileFormat(dataset);
ff.Save( filePath, DicomWriteOptions.Default);
}
示例6: IsFilteredOutData
private bool IsFilteredOutData(DcmDataset dataset)
{
if (!HasReceiveFilters)
{
return false;
}
var imageTypes = dataset.GetStringArray(DicomTags.ImageType, new string[]{});
if (imageTypes.Any( t => IsFilteredOut(t, ReceiveFilter_ImageTypes)))
{
Trace.WriteLine(String.Format("{0} Filtered DIMSE {1} from {2} because of imageType:{3}", DateTime.Now, dataset.GetString(DicomTags.Modality, "UN"), this.Associate.CallingAE, imageTypes));
return true;
}
var seriesDescription = dataset.GetString(DicomTags.SeriesDescription, "");
if (IsFilteredOut(seriesDescription, ReceiveFilter_SeriesDescription))
{
Trace.WriteLine(String.Format("{0} Filtered DIMSE {1} from {2} because of seriesDescription:{3}", DateTime.Now, dataset.GetString(DicomTags.Modality, "UN"), this.Associate.CallingAE, seriesDescription));
return true;
}
return false;
}
示例7: GetFilePaths
private static IEnumerable<string> GetFilePaths(MedicalISDataContext database, DcmDataset query)
{
if ( ! String.IsNullOrWhiteSpace(query.GetString(DicomTags.SeriesInstanceUID, "")) )
{
string seriesInstanceUid = query.GetString(DicomTags.SeriesInstanceUID,"");
var imagePaths = from i in database.Images
where i.SeriesInstanceUid == seriesInstanceUid
select Path.Combine(Settings.Default.RootPath, i.ArchivedStorageLocation);
return imagePaths;
}
else if ( !String.IsNullOrWhiteSpace(query.GetString(DicomTags.StudyInstanceUID, "")))
{
string studyInstanceUid = query.GetElement(DicomTags.StudyInstanceUID).GetValueString();
var imagePaths = from i in database.Images
where i.Series.Study.StudyInstanceUid == studyInstanceUid
select Path.Combine(Settings.Default.RootPath, i.ArchivedStorageLocation);
return imagePaths;
}
else
{
return new string[]{};
}
}
示例8: GetFileNameForDicomDataset
private static string GetFileNameForDicomDataset(DcmDataset dataset)
{
return dataset.GetString(DicomTags.Modality, "UN") + "." + dataset.GetString(DicomTags.SOPInstanceUID, "UnknownSOPInstanceUID") + ".dcm";
}