本文整理汇总了C#中ClearCanvas.ImageViewer.StudyManagement.Frame类的典型用法代码示例。如果您正苦于以下问题:C# Frame类的具体用法?C# Frame怎么用?C# Frame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Frame类属于ClearCanvas.ImageViewer.StudyManagement命名空间,在下文中一共展示了Frame类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: RetrieveFrame
public void RetrieveFrame(Frame frame)
{
Interlocked.Increment(ref _activeRetrieveThreads);
try
{
string message = String.Format("Retrieving Frame (active threads: {0})", Thread.VolatileRead(ref _activeRetrieveThreads));
Trace.WriteLine(message);
IStreamingSopDataSource dataSource = (IStreamingSopDataSource) frame.ParentImageSop.DataSource;
IStreamingSopFrameData frameData = dataSource.GetFrameData(frame.FrameNumber);
frameData.RetrievePixelData();
}
catch (OutOfMemoryException)
{
Platform.Log(LogLevel.Error, "Out of memory trying to retrieve pixel data.");
}
catch (Exception e)
{
Platform.Log(LogLevel.Error, e, "Error retrieving frame pixel data.");
}
finally
{
Interlocked.Decrement(ref _activeRetrieveThreads);
}
}
开发者ID:nhannd,项目名称:Xian,代码行数:27,代码来源:StreamingCorePrefetchingStrategy.cs
示例2: ImagePlaneHelper
/// <summary>
/// Constructor (for use by <see cref="Frame"/> class only).
/// </summary>
internal ImagePlaneHelper(Frame frame)
: this(frame.ImagePositionPatient, frame.ImageOrientationPatient, frame.PixelSpacing, frame.Rows, frame.Columns)
{
// this constructor is internal because it keeps references to the source frame's position, orientation and spacing properties
// if the frame is changed or disposed, the calculations made by this instance would be affected
// thus, only the Frame class should use this constructor, since it will thus have the same lifetime as the referenced objects
// if you need to create an instance separated from a frame, use the other constructor with appropriate clones of the position, orientation and spacing
}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:11,代码来源:ImagePlaneHelper.cs
示例3: CanDecompressFrame
public bool CanDecompressFrame(Frame frame)
{
if (!(frame.ParentImageSop.DataSource is StreamingSopDataSource))
return false;
StreamingSopDataSource dataSource = (StreamingSopDataSource) frame.ParentImageSop.DataSource;
IStreamingSopFrameData frameData = dataSource.GetFrameData(frame.FrameNumber);
return frameData.PixelDataRetrieved;
}
开发者ID:nhannd,项目名称:Xian,代码行数:9,代码来源:StreamingCorePrefetchingStrategy.cs
示例4: CanDecompressFrame
public bool CanDecompressFrame(Frame frame)
{
var streamingFrame = frame.ParentImageSop.DataSource as StreamingSopDataSource;
if (streamingFrame == null)
return false;
var frameData = streamingFrame.GetFrameData(frame.FrameNumber);
return frameData.PixelDataRetrieved;
}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:9,代码来源:StreamingCorePrefetchingStrategy.cs
示例5: GetCompareValues
private static IEnumerable<IComparable> GetCompareValues(Frame frame)
{
//Group be common study level attributes
yield return frame.StudyInstanceUid;
//Group by common series level attributes
//This sorts "FOR PRESENTATION" images to the beginning (except in reverse, of course).
yield return frame.ParentImageSop.PresentationIntentType == "FOR PRESENTATION" ? 0 : 1;
yield return frame.ParentImageSop.SeriesNumber;
yield return frame.ParentImageSop.SeriesDescription;
yield return frame.SeriesInstanceUid;
yield return frame.FrameOfReferenceUid;
double? normalX = null, normalY = null, normalZ = null;
double? zImagePlane = null;
Vector3D normal = frame.ImagePlaneHelper.GetNormalVector();
if (normal != null)
{
// Return the 3 components of the image normal; if they are all equal
// then the images are in the same plane. We are disregarding
// the rare case where the 2 normals being compared are the negative
// of each other - technically, they could be considered to be in the
// same 'plane', but for the purposes of sorting, we won't consider it.
normalX = Math.Round(normal.X, 3, MidpointRounding.AwayFromZero);
normalY = Math.Round(normal.Y, 3, MidpointRounding.AwayFromZero);
normalZ = Math.Round(normal.Z, 3, MidpointRounding.AwayFromZero);
Vector3D positionPatient = frame.ImagePlaneHelper.ConvertToPatient(new PointF((frame.Columns - 1) / 2F, (frame.Rows - 1) / 2F));
if (positionPatient != null)
{
Vector3D positionImagePlane = frame.ImagePlaneHelper.ConvertToImagePlane(positionPatient, Vector3D.Null);
//return only the z-component of the image plane position (where the origin remains at the patient origin).
zImagePlane = Math.Round(positionImagePlane.Z, 3, MidpointRounding.AwayFromZero);
}
}
yield return normalX;
yield return normalY;
yield return normalZ;
yield return zImagePlane;
//as a last resort.
yield return frame.ParentImageSop.InstanceNumber;
yield return frame.FrameNumber;
yield return frame.AcquisitionNumber;
}
开发者ID:nhannd,项目名称:Xian,代码行数:49,代码来源:SliceLocationComparer.cs
示例6: GetCompareValues
private static IEnumerable<IComparable> GetCompareValues(Frame frame)
{//Group be common study level attributes
yield return frame.StudyInstanceUid;
//Group by common series level attributes
//This sorts "FOR PRESENTATION" images to the beginning (except in reverse, of course).
yield return frame.ParentImageSop.PresentationIntentType == "FOR PRESENTATION" ? 0 : 1;
yield return frame.ParentImageSop.SeriesNumber;
yield return frame.ParentImageSop.SeriesDescription;
yield return frame.SeriesInstanceUid;
yield return frame.ParentImageSop.InstanceNumber;
yield return frame.FrameNumber;
//as a last resort.
yield return frame.AcquisitionNumber;
}
开发者ID:nhannd,项目名称:Xian,代码行数:16,代码来源:InstanceAndFrameNumberComparer.cs
示例7: DecompressFrame
public void DecompressFrame(Frame frame)
{
try
{
//TODO: try to trigger header retrieval for data luts?
frame.GetNormalizedPixelData();
}
catch (OutOfMemoryException)
{
Platform.Log(LogLevel.Error, "Out of memory trying to decompress pixel data.");
}
catch (Exception e)
{
Platform.Log(LogLevel.Error, e, "Error decompressing frame pixel data.");
}
}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:16,代码来源:StreamingCorePrefetchingStrategy.cs
示例8: MockDicomPresentationImage
public MockDicomPresentationImage(string filename) : base(new GrayscaleImageGraphic(10, 10))
{
if (Path.IsPathRooted(filename))
_filename = filename;
else
_filename = Path.Combine(Environment.CurrentDirectory, filename);
_dicomFile = new DicomFile();
_dicomFile.DataSet[DicomTags.SopClassUid].SetStringValue(SopClass.SecondaryCaptureImageStorageUid);
_dicomFile.DataSet[DicomTags.SopInstanceUid].SetStringValue(DicomUid.GenerateUid().UID);
_dicomFile.MetaInfo[DicomTags.MediaStorageSopClassUid].SetStringValue(_dicomFile.DataSet[DicomTags.SopClassUid].ToString());
_dicomFile.MetaInfo[DicomTags.MediaStorageSopInstanceUid].SetStringValue(_dicomFile.DataSet[DicomTags.SopInstanceUid].ToString());
_dicomFile.Save(_filename);
_sopDataSource = new LocalSopDataSource(_dicomFile);
_imageSop = new ImageSop(_sopDataSource);
_frame = new MockFrame(_imageSop, 1);
}
开发者ID:UIKit0,项目名称:ClearCanvas,代码行数:17,代码来源:MockDicomPresentationImage.cs
示例9: RetrieveFrame
public void RetrieveFrame(Frame frame)
{
try
{
var dataSource = (IStreamingSopDataSource) frame.ParentImageSop.DataSource;
var frameData = dataSource.GetFrameData(frame.FrameNumber);
frameData.RetrievePixelData();
}
catch (OutOfMemoryException)
{
Platform.Log(LogLevel.Error, "Out of memory trying to retrieve pixel data.");
}
catch (Exception e)
{
Platform.Log(LogLevel.Error, e, "Error retrieving frame pixel data.");
}
}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:17,代码来源:StreamingCorePrefetchingStrategy.cs
示例10: CreateImage
protected override IPresentationImage CreateImage(Frame frame)
{
if (frame.PhotometricInterpretation == PhotometricInterpretation.Unknown)
throw new Exception("Photometric interpretation is unknown.");
IDicomPresentationImage image;
// TODO (CR Apr 2013): Since it's the "async" factory, it probably should only deal in AsyncFrames. Just throw NotSupportedException?
if (!frame.PhotometricInterpretation.IsColor)
image = frame is AsyncFrame ? new AsyncDicomGrayscalePresentationImage((AsyncFrame) frame) : new DicomGrayscalePresentationImage(frame);
else
image = new DicomColorPresentationImage(frame);
if (image.PresentationState == null || Equals(image.PresentationState, PresentationState.DicomDefault))
image.PresentationState = DefaultPresentationState;
return image;
}
开发者ID:UIKit0,项目名称:ClearCanvas,代码行数:18,代码来源:AsyncPresentationImageFactory.cs
示例11: GetCompareValues
private static IEnumerable<IComparable> GetCompareValues(Frame frame)
{
//Group be common study level attributes
yield return frame.StudyInstanceUid;
//Group by common series level attributes
//This sorts "FOR PRESENTATION" images to the beginning (except in reverse, of course).
yield return frame.ParentImageSop.PresentationIntentType == "FOR PRESENTATION" ? 0 : 1;
yield return frame.ParentImageSop.SeriesNumber;
yield return frame.ParentImageSop.SeriesDescription;
yield return frame.SeriesInstanceUid;
DateTime? datePart = null;
TimeSpan? timePart = null;
//then sort by acquisition datetime.
DateTime? acquisitionDateTime = DateTimeParser.Parse(frame.AcquisitionDateTime);
if (acquisitionDateTime != null)
{
datePart = acquisitionDateTime.Value.Date;
timePart = acquisitionDateTime.Value.TimeOfDay;
}
else
{
datePart = DateParser.Parse(frame.AcquisitionDate);
if (datePart != null)
{
//only set the time part if there is a valid date part.
DateTime? acquisitionTime = TimeParser.Parse(frame.AcquisitionTime);
if (acquisitionTime != null)
timePart = acquisitionTime.Value.TimeOfDay;
}
}
yield return datePart;
yield return timePart;
//as a last resort.
yield return frame.ParentImageSop.InstanceNumber;
yield return frame.FrameNumber;
yield return frame.AcquisitionNumber;
}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:42,代码来源:AcquisitionTimeComparer.cs
示例12: CreateT2Image
private static DynamicTePresentationImage CreateT2Image(ImageSop imageSop, Frame frame)
{
DicomFile pdMap = FindMap(imageSop.StudyInstanceUID, frame.SliceLocation, "PD");
pdMap.Load(DicomReadOptions.Default);
DicomFile t2Map = FindMap(imageSop.StudyInstanceUID, frame.SliceLocation, "T2");
t2Map.Load(DicomReadOptions.Default);
DicomFile probMap = FindMap(imageSop.StudyInstanceUID, frame.SliceLocation, "CHI2PROB");
probMap.Load(DicomReadOptions.Default);
DynamicTePresentationImage t2Image = new DynamicTePresentationImage(
frame,
(byte[])pdMap.DataSet[DicomTags.PixelData].Values,
(byte[])t2Map.DataSet[DicomTags.PixelData].Values,
(byte[])probMap.DataSet[DicomTags.PixelData].Values);
t2Image.DynamicTe.Te = 50.0f;
return t2Image;
}
开发者ID:nhannd,项目名称:Xian,代码行数:20,代码来源:DynamicTeSeriesCreator.cs
示例13: RetrieveFrame
private void RetrieveFrame(Frame frame)
{
if (_stopAllActivity)
{
return;
}
try
{
//just return if the available memory is getting low - only retrieve and decompress on-demand now.
if (SystemResources.GetAvailableMemory(SizeUnits.Megabytes) < Prefetch.Default.AvailableMemoryLimitMegabytes)
{
return;
}
Interlocked.Increment(ref _activeRetrieveThreads);
//TODO (CR May 2010): do we need to do this all the time?
string message = String.Format("Retrieving Frame (active threads: {0})", Thread.VolatileRead(ref _activeRetrieveThreads));
Trace.WriteLine(message);
Console.WriteLine(message);
//TODO: try to trigger header retrieval for data luts?
frame.GetNormalizedPixelData();
}
catch(OutOfMemoryException)
{
_stopAllActivity = true;
Platform.Log(LogLevel.Error, "Out of memory trying to retrieve pixel data. Prefetching will not resume unless memory becomes available.");
}
catch (Exception e)
{
Platform.Log(LogLevel.Error, e, "Error retrieving frame pixel data.");
}
finally
{
Interlocked.Decrement(ref _activeRetrieveThreads);
}
}
开发者ID:nhannd,项目名称:Xian,代码行数:39,代码来源:ImageServerPrefetchingStrategy.cs
示例14: SingleFrameDisplaySetDescriptor
public SingleFrameDisplaySetDescriptor(ISeriesIdentifier sourceSeries, Frame frame, int position)
: base(sourceSeries)
{
Platform.CheckForNullReference(sourceSeries, "sourceSeries");
Platform.CheckForNullReference(frame, "frame");
_seriesInstanceUid = frame.SeriesInstanceUid;
_sopInstanceUid = frame.SopInstanceUid;
_frameNumber = frame.FrameNumber;
_position = position;
if (sourceSeries.SeriesInstanceUid == frame.SeriesInstanceUid)
{
_suffix = String.Format(SR.SuffixFormatSingleFrameDisplaySet, frame.ParentImageSop.InstanceNumber, _frameNumber);
}
else
{
//this is a referenced frame (e.g. key iamge).
_suffix = String.Format(SR.SuffixFormatSingleReferencedFrameDisplaySet,
frame.ParentImageSop.SeriesNumber, frame.ParentImageSop.InstanceNumber, _frameNumber);
}
}
开发者ID:UIKit0,项目名称:ClearCanvas,代码行数:22,代码来源:DisplaySetFactories.cs
示例15: DynamicTePresentationImage
public DynamicTePresentationImage(
Frame frame,
byte[] protonDensityMap,
byte[] t2Map,
byte[] probabilityMap)
: base(frame)
{
Platform.CheckForNullReference(frame, "imageSop");
_frame = frame;
// TODO (Norman): DicomFilteredAnnotationLayoutProvider was made internal. Either need to derive
// this class from DicomGrayscalePresentationImage or create a layout provider.
//this.AnnotationLayoutProvider = new DicomFilteredAnnotationLayoutProvider(this);
AddProbabilityOverlay();
_dynamicTe = new DynamicTe(
this.ImageGraphic as GrayscaleImageGraphic,
protonDensityMap,
t2Map,
_probabilityOverlay,
probabilityMap);
}
开发者ID:nhannd,项目名称:Xian,代码行数:23,代码来源:DynamicTePresentationImage.cs
示例16: RetrieveFrame
public void RetrieveFrame(Frame frame)
{
Interlocked.Increment(ref _activeRetrieveThreads);
try
{
IStreamingSopDataSource dataSource = (IStreamingSopDataSource) frame.ParentImageSop.DataSource;
IStreamingSopFrameData frameData = dataSource.GetFrameData(frame.FrameNumber);
frameData.RetrievePixelData();
}
catch (OutOfMemoryException)
{
Platform.Log(LogLevel.Error, "Out of memory trying to retrieve pixel data.");
}
catch (Exception e)
{
Platform.Log(LogLevel.Error, e, "Error retrieving frame pixel data.");
}
finally
{
Interlocked.Decrement(ref _activeRetrieveThreads);
}
}
开发者ID:UIKit0,项目名称:ClearCanvas,代码行数:24,代码来源:StreamingCorePrefetchingStrategy.cs
示例17: DecompressFrame
public void DecompressFrame(Frame frame)
{
Interlocked.Increment(ref _activeDecompressThreads);
try
{
string message = String.Format("Decompressing Frame (active threads: {0})", Thread.VolatileRead(ref _activeDecompressThreads));
Trace.WriteLine(message);
//TODO: try to trigger header retrieval for data luts?
frame.GetNormalizedPixelData();
}
catch (OutOfMemoryException)
{
Platform.Log(LogLevel.Error, "Out of memory trying to decompress pixel data.");
}
catch (Exception e)
{
Platform.Log(LogLevel.Error, e, "Error decompressing frame pixel data.");
}
finally
{
Interlocked.Decrement(ref _activeDecompressThreads);
}
}
开发者ID:nhannd,项目名称:Xian,代码行数:24,代码来源:StreamingCorePrefetchingStrategy.cs
示例18: CreateOverlayPlaneGraphics
public static List<OverlayPlaneGraphic> CreateOverlayPlaneGraphics(Frame frame)
{
return CreateOverlayPlaneGraphics(frame, null);
}
开发者ID:yjsyyyjszf,项目名称:ClearCanvas-1,代码行数:4,代码来源:DicomGraphicsFactory.cs
示例19: Compare
/// <summary>
/// Compares two <see cref="Frame"/>s based on acquisition date and time.
/// </summary>
public override int Compare(Frame x, Frame y)
{
return Compare(GetCompareValues(x), GetCompareValues(y));
}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:7,代码来源:AcquisitionTimeComparer.cs
示例20: InitializePixelMeasureFunctionalGroup
/// <summary>
/// Initializes Pixel Measures Functional Group
/// </summary>
/// <param name="functionalGroupsSequenceItem">Functional Group Sequence Item that the newly initialized Pixel Measures Functional Group will belong</param>
/// <param name="imageFrame"><see cref="Frame"/> that is a source of group's values</param>
private static void InitializePixelMeasureFunctionalGroup(FunctionalGroupsSequenceItem functionalGroupsSequenceItem, Frame imageFrame)
{
var pixelSpacing = imageFrame.PixelSpacing;
if (pixelSpacing.IsNull)
return;
var pixelMeasureFunctionalGroup = functionalGroupsSequenceItem.GetFunctionalGroup<PixelMeasuresFunctionalGroup>();
var pixelMeasureSequence = pixelMeasureFunctionalGroup.CreatePixelMeasuresSequence();
pixelMeasureSequence.PixelSpacing = new[] {pixelSpacing.Row, pixelSpacing.Column};
pixelMeasureSequence.SliceThickness = imageFrame.SliceThickness;
pixelMeasureFunctionalGroup.PixelMeasuresSequence = pixelMeasureSequence;
}
开发者ID:CuriousX,项目名称:annotation-and-image-markup,代码行数:18,代码来源:SegmentationSerializer.cs
注:本文中的ClearCanvas.ImageViewer.StudyManagement.Frame类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论