本文整理汇总了C#中StudyStorageLocation类的典型用法代码示例。如果您正苦于以下问题:C# StudyStorageLocation类的具体用法?C# StudyStorageLocation怎么用?C# StudyStorageLocation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StudyStorageLocation类属于命名空间,在下文中一共展示了StudyStorageLocation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SeriesSopUpdateCommand
/// <summary>
/// Constructor
/// </summary>
public SeriesSopUpdateCommand(StudyStorageLocation originalStudy, StudyStorageLocation targetStudy, UidMapper uidMapper)
: base("SeriesSopUpdateCommand")
{
_originalStudy = originalStudy;
_targetStudy = targetStudy;
_uidMapper = uidMapper;
}
示例2: UpdateStudySizeInDBCommand
public UpdateStudySizeInDBCommand(StudyStorageLocation location, RebuildStudyXmlCommand rebuildCommand)
: base("Update Study Size In DB")
{
_location = location;
_rebuildCommand = rebuildCommand;
}
示例3: LoadInstance
/// <summary>
/// Load the first instance from the first series of the StudyXml file for a study.
/// </summary>
/// <param name="location">The storage location of the study.</param>
/// <returns></returns>
protected static DicomFile LoadInstance(StudyStorageLocation location)
{
string studyXml = Path.Combine(location.GetStudyPath(), location.StudyInstanceUid + ".xml");
if (!File.Exists(studyXml))
{
return null;
}
FileStream stream = FileStreamOpener.OpenForRead(studyXml, FileMode.Open);
var theDoc = new XmlDocument();
StudyXmlIo.Read(theDoc, stream);
stream.Close();
stream.Dispose();
var xml = new StudyXml();
xml.SetMemento(theDoc);
IEnumerator<SeriesXml> seriesEnumerator = xml.GetEnumerator();
if (seriesEnumerator.MoveNext())
{
SeriesXml seriesXml = seriesEnumerator.Current;
IEnumerator<InstanceXml> instanceEnumerator = seriesXml.GetEnumerator();
if (instanceEnumerator.MoveNext())
{
InstanceXml instance = instanceEnumerator.Current;
var file = new DicomFile("file.dcm",new DicomAttributeCollection(), instance.Collection)
{TransferSyntax = instance.TransferSyntax};
return file;
}
}
return null;
}
示例4: ValidateStudyState
/// <summary>
/// Validates the state of the study.
/// </summary>
/// <param name="context">Name of the application</param>
/// <param name="studyStorage">The study to validate</param>
/// <param name="modes">Specifying what validation to execute</param>
public void ValidateStudyState(String context, StudyStorageLocation studyStorage, StudyIntegrityValidationModes modes)
{
Platform.CheckForNullReference(studyStorage, "studyStorage");
if (modes == StudyIntegrityValidationModes.None)
return;
using (ServerExecutionContext scope = new ServerExecutionContext())
{
Study study = studyStorage.LoadStudy(scope.PersistenceContext);
if (study!=null)
{
StudyXml studyXml = studyStorage.LoadStudyXml();
if (modes == StudyIntegrityValidationModes.Default ||
(modes & StudyIntegrityValidationModes.InstanceCount) == StudyIntegrityValidationModes.InstanceCount)
{
if (studyXml != null && studyXml.NumberOfStudyRelatedInstances != study.NumberOfStudyRelatedInstances)
{
ValidationStudyInfo validationStudyInfo = new ValidationStudyInfo(study, studyStorage.ServerPartition);
throw new StudyIntegrityValidationFailure(
ValidationErrors.InconsistentObjectCount, validationStudyInfo,
String.Format("Number of instances in database and xml do not match: {0} vs {1}.",
study.NumberOfStudyRelatedInstances,
studyXml.NumberOfStudyRelatedInstances
));
}
}
}
}
}
示例5: StudyRulesEngine
public StudyRulesEngine(ServerRulesEngine studyRulesEngine, StudyStorageLocation location, ServerPartition partition, StudyXml studyXml)
{
_studyRulesEngine = studyRulesEngine;
_studyXml = studyXml;
_location = location;
_partition = partition ?? ServerPartition.Load(_location.ServerPartitionKey);
}
示例6: UpdateHistorySeriesMappingCommand
public UpdateHistorySeriesMappingCommand(StudyHistory studyHistory, StudyStorageLocation destStudy, UidMapper map)
: base("Update Study History Series Mapping")
{
_map = map;
_studyHistory = studyHistory;
_destStudy = destStudy;
}
示例7: RemoveInstanceFromStudyXmlCommand
public RemoveInstanceFromStudyXmlCommand(StudyStorageLocation location, StudyXml studyXml, DicomFile file)
:base("Remove Instance From Study Xml", true)
{
_studyLocation = location;
_file = file;
_studyXml = studyXml;
}
示例8: UpdateInstanceCountCommand
public UpdateInstanceCountCommand(StudyStorageLocation studyLocation, string seriesInstanceUid, string sopInstanceUid)
:base("Update Study Count")
{
_studyLocation = studyLocation;
_seriesInstanceUid = seriesInstanceUid;
_sopInstanceUid = sopInstanceUid;
}
示例9: RemoveStudyStorage
private static void RemoveStudyStorage(StudyStorageLocation location)
{
// NOTE: This was an IUpdateContext, however, it was modified to be an IReadContext
// after having problems w/ locks on asystem with a fair amount of load. The
// updates are just automatically committed within the stored procedure when it
// runs...
using (IReadContext updateContext = PersistentStoreRegistry.GetDefaultStore().OpenReadContext())
{
// Setup the delete parameters
DeleteStudyStorageParameters parms = new DeleteStudyStorageParameters
{
ServerPartitionKey = location.ServerPartitionKey,
StudyStorageKey = location.Key
};
// Get the Insert Instance broker and do the insert
IDeleteStudyStorage delete = updateContext.GetBroker<IDeleteStudyStorage>();
if (false == delete.Execute(parms))
{
Platform.Log(LogLevel.Error, "Unexpected error when trying to delete study: {0}",
location.StudyInstanceUid);
}
}
}
示例10: UpdateSeriesCommand
/// <summary>
/// Creates an instance of <see cref="UpdateSeriesCommand"/> to update the existing Series record in the database
/// </summary>
public UpdateSeriesCommand(StudyStorageLocation storageLocation, ServerActionContext sopContext)
: base(String.Concat("Update Series Command"))
{
_storageLocation = storageLocation;
_data = sopContext.Message.DataSet;
_context = sopContext;
}
示例11: BasePreprocessor
/// <summary>
/// Creates an instance of <see cref="AutoReconciler"/> to update
/// a DICOM file according to the history.
/// </summary>
/// <param name="description"></param>
/// <param name="storageLocation"></param>
public BasePreprocessor(string description, StudyStorageLocation storageLocation)
{
Platform.CheckForEmptyString(description, "description");
Platform.CheckForNullReference(storageLocation, "storageLocation");
StorageLocation = storageLocation;
Description = description;
}
示例12: RemoveInstanceFromStudyXmlCommand
public RemoveInstanceFromStudyXmlCommand(StudyStorageLocation location, StudyXml studyXml, string seriesInstanceUid, string sopInstanceUid)
: base("RemoveInstanceFromStudyXmlCommand", true)
{
_studyLocation = location;
_seriesInstanceUid = seriesInstanceUid;
_sopInstanceUid = sopInstanceUid;
_studyXml = studyXml;
}
示例13: ReconcileStorage
/// <summary>
/// Creates an instance of <see cref="ReconcileStorage"/>
/// </summary>
/// <param name="studyLocation">The <see cref="StudyStorageLocation"/> of the study which contains the images to be reconciled.</param>
/// <param name="folder">The name of the folder used for storing the images to be reconciled.</param>
public ReconcileStorage(StudyStorageLocation studyLocation, string folder)
{
Platform.CheckForNullReference(studyLocation, "studyLocation");
Platform.CheckForEmptyString(folder, "folder");
_studyLocation = studyLocation;
_folder = folder;
}
示例14: IsParitionDuplicatePolicyOverridden
/// <summary>
/// Indicates whether or not the ServerParition duplicate policy is overridden for the specified study
/// </summary>
/// <param name="studyStorageLocation"></param>
/// <returns></returns>
public static bool IsParitionDuplicatePolicyOverridden(StudyStorageLocation studyStorageLocation)
{
var list = GetStudyUIDsWithDuplicatePolicyOverride();
if (list != null && list.Any(uid => uid.Equals(studyStorageLocation.StudyInstanceUid)))
return true;
return false;
}
示例15: SopInstanceProcessorContext
/// <summary>
/// Creates an instance of <see cref="SopInstanceProcessorContext"/>
/// </summary>
/// <param name="commandProcessor">The <see cref="ServerCommandProcessor"/> used in the context</param>
/// <param name="studyLocation">The <see cref="StudyStorageLocation"/> of the study being processed</param>
/// <param name="uidGroup">A String value respresenting the group of SOP instances which are being processed.</param>
/// <param name="request">An external request that may have triggered this item.</param>
public SopInstanceProcessorContext(ServerCommandProcessor commandProcessor, StudyStorageLocation studyLocation,
string uidGroup, ExternalRequestQueue request = null)
{
_commandProcessor = commandProcessor;
_studyLocation = studyLocation;
_group = uidGroup;
_request = request;
}