|
@@ -3699,6 +3699,7 @@ namespace aipsvr.Services
|
|
|
InstitutionId = institutionId,
|
|
|
Mode = firstAssignedLabelCase.Mode,
|
|
|
CaseIndex = assignedCaseCount,
|
|
|
+ DevelopConfirmInfo = firstAssignedLabelCase.DevelopConfirmInfo,
|
|
|
};
|
|
|
await assignedLabelCaseDataManager.CreateAssignedLabelCaseAsync(assignedLabelCase);
|
|
|
|
|
@@ -3718,6 +3719,7 @@ namespace aipsvr.Services
|
|
|
AssignedLabelCaseId = assignedLabelCase.Id,
|
|
|
UltrasoundGroupId = sourceGroup.UltrasoundGroupId,
|
|
|
Index = count.Group,
|
|
|
+ DevelopConfirmInfo = sourceGroup.DevelopConfirmInfo,
|
|
|
};
|
|
|
await assignedLabelCaseDataManager.CreateAssignedLabelCaseGroupAsync(assignedLabelCaseGroup);
|
|
|
|
|
@@ -3731,6 +3733,9 @@ namespace aipsvr.Services
|
|
|
UltrasoundFileId = sourceFile.UltrasoundFileId,
|
|
|
Index = sourceFile.Index,
|
|
|
IsVideo = sourceFile.IsVideo,
|
|
|
+ KeyFrameIndexList = sourceFile.KeyFrameIndexList,
|
|
|
+ VideoItem = sourceFile.VideoItem,
|
|
|
+ DevelopConfirmInfo = sourceFile.DevelopConfirmInfo
|
|
|
};
|
|
|
await assignedLabelCaseDataManager.CreateAssignedLabelCaseFileAsync(assignedLabelCaseFile);
|
|
|
|
|
@@ -3819,7 +3824,7 @@ namespace aipsvr.Services
|
|
|
actualAddedGoldStandardCount++;
|
|
|
}
|
|
|
}
|
|
|
- #endregion
|
|
|
+ #endregion Add GoldStandardAssignedFile
|
|
|
|
|
|
var progress = (int)((double)assignIndex / assignTotal * 100);
|
|
|
OperationManager.SetProgress(operationId, progress);
|
|
@@ -3901,7 +3906,7 @@ namespace aipsvr.Services
|
|
|
actualAddedSelfCheckCount++;
|
|
|
}
|
|
|
}
|
|
|
- #endregion
|
|
|
+ #endregion Add SelfCheckAssignedFile
|
|
|
|
|
|
var progress = (int)((double)assignIndex / assignTotal * 100);
|
|
|
OperationManager.SetProgress(operationId, progress);
|
|
@@ -3917,7 +3922,7 @@ namespace aipsvr.Services
|
|
|
assignedLabelCase.Count = count;
|
|
|
await assignedLabelCaseDataManager.UpdateAssignCaseAsync(assignedLabelCase);
|
|
|
|
|
|
- #endregion
|
|
|
+ #endregion Update AssignedLabelCase
|
|
|
|
|
|
#region Update SameBatchLabelCase
|
|
|
|
|
@@ -3934,7 +3939,7 @@ namespace aipsvr.Services
|
|
|
AssignRestCount = firstLabelerInfo.AssignRestCount,
|
|
|
});
|
|
|
|
|
|
- #endregion Update sameBatchLabelCase
|
|
|
+ #endregion Update SameBatchLabelCase
|
|
|
|
|
|
#region Create LabelerGroup
|
|
|
|
|
@@ -3964,7 +3969,7 @@ namespace aipsvr.Services
|
|
|
labelerGroup.SelfCheckAssignedCount += actualAddedSelfCheckCount;
|
|
|
await labelerGroupDataManager.UpdateLabelerGroupAsync(labelerGroup);
|
|
|
}
|
|
|
- #endregion
|
|
|
+ #endregion Create LabelerGroup
|
|
|
}
|
|
|
|
|
|
#region Update SameBatchLabelCase
|
|
@@ -3972,14 +3977,14 @@ namespace aipsvr.Services
|
|
|
sameBatchLabelCase.State = SameBatchLabelCaseState.LabelerAssigned;
|
|
|
await sameBatchLabelCaseDataManager.UpdateSameBatchLabelCaseAsync(sameBatchLabelCase);
|
|
|
|
|
|
- #endregion
|
|
|
+ #endregion Update SameBatchLabelCase
|
|
|
|
|
|
#region Update ImageCase Labelers
|
|
|
|
|
|
var users = sameBatchLabelCase.Labelers.Select(x => new EntityBase { Id = x.Id, Name = x.Name }).ToList();
|
|
|
await imageCategoryDataManager.UpdateImageCategoryLabelersAsync(sameBatchLabelCase.ImageCaseId, users);
|
|
|
|
|
|
- #endregion
|
|
|
+ #endregion Update ImageCase Labelers
|
|
|
|
|
|
OperationManager.SetProgress(operationId, 100);
|
|
|
return operationId;
|
|
@@ -4562,7 +4567,7 @@ namespace aipsvr.Services
|
|
|
assignCount.File = 0;
|
|
|
var assignUltrasoundModels = new List<AssignUltrasoundModel>();
|
|
|
var modalItems = new List<ModalQuantityItem>();
|
|
|
- bool hasVideo = false;
|
|
|
+ Dictionary<long, DevelopConfirmStatus> developConfirmStatusInGroupDict = new Dictionary<long, DevelopConfirmStatus>();
|
|
|
foreach (var group in assignUltrasoundGroups)
|
|
|
{
|
|
|
var assignUltrasoundModel = new AssignUltrasoundModel
|
|
@@ -4584,15 +4589,22 @@ namespace aipsvr.Services
|
|
|
};
|
|
|
modalItems.Add(modalItem);
|
|
|
}
|
|
|
- if (ultrasoundFile.IsVideo)
|
|
|
+ if (ultrasoundFile.IsVideo && videoItem.FrameMode == FrameMode.EqualInterval)
|
|
|
{
|
|
|
- hasVideo = true;
|
|
|
+ if (!developConfirmStatusInGroupDict.ContainsKey(group.Id))
|
|
|
+ {
|
|
|
+ developConfirmStatusInGroupDict.Add(group.Id, DevelopConfirmStatus.WaitForConfirm);
|
|
|
+ }
|
|
|
}
|
|
|
modalItem.Quantity.Total++;
|
|
|
modalItem.Quantity.UnLabeled++;
|
|
|
assignCount.File++;
|
|
|
assignUltrasoundModel.FileFrameCount += ultrasoundFile.FrameCount;
|
|
|
}
|
|
|
+ if (!developConfirmStatusInGroupDict.ContainsKey(group.Id))
|
|
|
+ {
|
|
|
+ developConfirmStatusInGroupDict.Add(group.Id, DevelopConfirmStatus.None);
|
|
|
+ }
|
|
|
}
|
|
|
assignUltrasoundModels.Add(assignUltrasoundModel);
|
|
|
}
|
|
@@ -4601,15 +4613,10 @@ namespace aipsvr.Services
|
|
|
|
|
|
#region Create SameBatchLabelCase & AssignedLabelCase & AssignedLabelCaseFile & LabelerGroup
|
|
|
|
|
|
- DevelopConfirmInfo developConfirmInfo = new DevelopConfirmInfo();
|
|
|
- switch (videoItem.FrameMode)
|
|
|
+ DevelopConfirmInfo totalDevelopConfirmInfo = new DevelopConfirmInfo();
|
|
|
+ if (developConfirmStatusInGroupDict.ContainsValue(DevelopConfirmStatus.WaitForConfirm))
|
|
|
{
|
|
|
- case FrameMode.EqualInterval:
|
|
|
- if (hasVideo)
|
|
|
- {
|
|
|
- developConfirmInfo.Status = DevelopConfirmStatus.WaitForConfirm;
|
|
|
- }
|
|
|
- break;
|
|
|
+ totalDevelopConfirmInfo.Status = DevelopConfirmStatus.WaitForConfirm;
|
|
|
}
|
|
|
var sameBatchLabelCase = new SameBatchLabelCase
|
|
|
{
|
|
@@ -4623,7 +4630,7 @@ namespace aipsvr.Services
|
|
|
AssignCount = assignCount,
|
|
|
State = SameBatchLabelCaseState.LabelerAssigned,
|
|
|
VideoItem = videoItem,
|
|
|
- DevelopConfirmInfo = developConfirmInfo,
|
|
|
+ DevelopConfirmInfo = totalDevelopConfirmInfo,
|
|
|
};
|
|
|
|
|
|
#region Create ImageCategory
|
|
@@ -4637,6 +4644,7 @@ namespace aipsvr.Services
|
|
|
LabelPackageContentId = imageCategory.LabelPackageContentId,
|
|
|
SameBatchLabelCaseId = sameBatchLabelCase.Id,
|
|
|
Labelers = labelerInfos.Select(x => new EntityBase { Id = x.Id, Name = x.Name }).ToList(),
|
|
|
+ DevelopConfirmInfo = totalDevelopConfirmInfo
|
|
|
};
|
|
|
imageCase.GroupItem.Quantity.Total = assignCount.Group;
|
|
|
imageCase.GroupItem.Quantity.UnLabeled = assignCount.Group;
|
|
@@ -4685,7 +4693,7 @@ namespace aipsvr.Services
|
|
|
Mode = mode,
|
|
|
CaseIndex = caseIndex,
|
|
|
VideoItem = videoItem,
|
|
|
- DevelopConfirmInfo = developConfirmInfo,
|
|
|
+ DevelopConfirmInfo = totalDevelopConfirmInfo,
|
|
|
};
|
|
|
await caseDataManager.CreateAssignedLabelCaseAsync(assignedLabelCase);
|
|
|
|
|
@@ -4707,12 +4715,15 @@ namespace aipsvr.Services
|
|
|
{
|
|
|
var assignUltrasoundModel = assignUltrasoundModels[eachStartIndex];
|
|
|
var ultrasoundGroup = assignUltrasoundModel.Group;
|
|
|
+ var developConfirmInfoInGroup = new DevelopConfirmInfo();
|
|
|
+ developConfirmInfoInGroup.Status = developConfirmStatusInGroupDict[ultrasoundGroup.Id];
|
|
|
var assignedLabelCaseGroup = new AssignedLabelCaseGroup
|
|
|
{
|
|
|
ImageCategoryId = imageCategoryId,
|
|
|
AssignedLabelCaseId = assignedLabelCase.Id,
|
|
|
UltrasoundGroupId = ultrasoundGroup.Id,
|
|
|
Index = count.Group,
|
|
|
+ DevelopConfirmInfo = developConfirmInfoInGroup,
|
|
|
};
|
|
|
await caseDataManager.CreateAssignedLabelCaseGroupAsync(assignedLabelCaseGroup);
|
|
|
|
|
@@ -4747,12 +4758,14 @@ namespace aipsvr.Services
|
|
|
var requiredFrame = 0;
|
|
|
foreach (var ultrasoundFile in assignUltrasoundModel.Files)
|
|
|
{
|
|
|
+ var developConfirmInfoInFile = new DevelopConfirmInfo();
|
|
|
List<int> keyFrameIndexList = new List<int>();
|
|
|
if (ultrasoundFile.IsVideo)
|
|
|
{
|
|
|
switch (videoItem.FrameMode)
|
|
|
{
|
|
|
case FrameMode.EqualInterval:
|
|
|
+ developConfirmInfoInFile.Status = DevelopConfirmStatus.WaitForConfirm;
|
|
|
var result = opencvSimUtils.VideoFrameSimilarity(ultrasoundFile.Source.FileFullName, 1, (float)videoItem.SimilarityThreshold, videoItem.IntervalFrame, out var frameCount, out var keyFrameIndexListFromAI);
|
|
|
if (result)
|
|
|
{
|
|
@@ -4814,6 +4827,8 @@ namespace aipsvr.Services
|
|
|
IsLabeled = false,
|
|
|
IsVideo = ultrasoundFile.IsVideo,
|
|
|
KeyFrameIndexList = keyFrameIndexList,
|
|
|
+ VideoItem = videoItem,
|
|
|
+ DevelopConfirmInfo = developConfirmInfoInFile,
|
|
|
};
|
|
|
await caseDataManager.CreateAssignedLabelCaseFileAsync(assignedLabelCaseFile);
|
|
|
count.File++;
|
|
@@ -4850,8 +4865,31 @@ namespace aipsvr.Services
|
|
|
var progress = (int)((double)assignIndex / assignTotal * 100);
|
|
|
OperationManager.SetProgress(operationId, progress);
|
|
|
}
|
|
|
-
|
|
|
+ switch (imageCategory.DevelopConfirmInfo.Status)
|
|
|
+ {
|
|
|
+ case DevelopConfirmStatus.None:
|
|
|
+ case DevelopConfirmStatus.HasConfirmed:
|
|
|
+ if (totalDevelopConfirmInfo.Status == DevelopConfirmStatus.WaitForConfirm)
|
|
|
+ {
|
|
|
+ imageCategory.DevelopConfirmInfo.Status = DevelopConfirmStatus.WaitForConfirm;
|
|
|
+ imageCategory.DevelopConfirmInfo.Developer = new EntityBase();
|
|
|
+ imageCategory.DevelopConfirmInfo.ConfirmTime = DateTime.MinValue.ToUniversalTime();
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
await imageCategoryDataManager.UpdateImageCategoryAsync(imageCategory);
|
|
|
+ switch (imageBatch.DevelopConfirmInfo.Status)
|
|
|
+ {
|
|
|
+ case DevelopConfirmStatus.None:
|
|
|
+ case DevelopConfirmStatus.HasConfirmed:
|
|
|
+ if (totalDevelopConfirmInfo.Status == DevelopConfirmStatus.WaitForConfirm)
|
|
|
+ {
|
|
|
+ imageBatch.DevelopConfirmInfo.Status = DevelopConfirmStatus.WaitForConfirm;
|
|
|
+ imageBatch.DevelopConfirmInfo.Developer = new EntityBase();
|
|
|
+ imageBatch.DevelopConfirmInfo.ConfirmTime = DateTime.MinValue.ToUniversalTime();
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
await imageCategoryDataManager.UpdateImageCategoryAsync(imageBatch);
|
|
|
|
|
|
#endregion Add eachCount
|
|
@@ -5087,57 +5125,22 @@ namespace aipsvr.Services
|
|
|
var labelerGroup = await labelerGroupDataManager.GetLabelerGroupAsync(labelerInfo.Id, labelerInfo.InstitutionId, imageCategory.Id);
|
|
|
if (labelerGroup == null)
|
|
|
{
|
|
|
- if (hasVideo)
|
|
|
+ labelerGroup = new LabelerGroup
|
|
|
{
|
|
|
- if (videoItem.FrameMode == FrameMode.MaxInterval)
|
|
|
- {
|
|
|
- labelerGroup = new LabelerGroup
|
|
|
- {
|
|
|
- Labeler = new EntityBase { Id = labelerInfo.Id, Name = labelerInfo.Name },
|
|
|
- ImageCategoryId = imageCategory.Id,
|
|
|
- OrganizationId = imageCategory.OrganizationId,
|
|
|
- LabelCaseQuantityItem = new AssignedCaseQuantityItem
|
|
|
- {
|
|
|
- Total = assignFrameTotal,
|
|
|
- Remaining = requiredFrameTotal,
|
|
|
- Required = requiredFrameTotal
|
|
|
- },
|
|
|
- GoldStandardAssignedCount = actualAddedGoldStandardCount,
|
|
|
- SelfCheckAssignedCount = actualAddedSelfCheckCount,
|
|
|
- };
|
|
|
- }
|
|
|
- else
|
|
|
+ Labeler = new EntityBase { Id = labelerInfo.Id, Name = labelerInfo.Name },
|
|
|
+ ImageCategoryId = imageCategory.Id,
|
|
|
+ OrganizationId = imageCategory.OrganizationId,
|
|
|
+ LabelCaseQuantityItem = new AssignedCaseQuantityItem
|
|
|
{
|
|
|
- labelerGroup = new LabelerGroup
|
|
|
- {
|
|
|
- Labeler = new EntityBase { Id = labelerInfo.Id, Name = labelerInfo.Name },
|
|
|
- ImageCategoryId = imageCategory.Id,
|
|
|
- OrganizationId = imageCategory.OrganizationId,
|
|
|
- LabelCaseQuantityItem = new AssignedCaseQuantityItem
|
|
|
- {
|
|
|
- Total = assignFrameTotal,
|
|
|
- },
|
|
|
- GoldStandardAssignedCount = actualAddedGoldStandardCount,
|
|
|
- SelfCheckAssignedCount = actualAddedSelfCheckCount,
|
|
|
- };
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
+ Total = assignFrameTotal,
|
|
|
+ },
|
|
|
+ GoldStandardAssignedCount = actualAddedGoldStandardCount,
|
|
|
+ SelfCheckAssignedCount = actualAddedSelfCheckCount,
|
|
|
+ };
|
|
|
+ if (!developConfirmStatusInGroupDict.ContainsValue(DevelopConfirmStatus.WaitForConfirm))
|
|
|
{
|
|
|
- labelerGroup = new LabelerGroup
|
|
|
- {
|
|
|
- Labeler = new EntityBase { Id = labelerInfo.Id, Name = labelerInfo.Name },
|
|
|
- ImageCategoryId = imageCategory.Id,
|
|
|
- OrganizationId = imageCategory.OrganizationId,
|
|
|
- LabelCaseQuantityItem = new AssignedCaseQuantityItem
|
|
|
- {
|
|
|
- Total = assignFrameTotal,
|
|
|
- Remaining = requiredFrameTotal,
|
|
|
- Required = requiredFrameTotal,
|
|
|
- },
|
|
|
- GoldStandardAssignedCount = actualAddedGoldStandardCount,
|
|
|
- SelfCheckAssignedCount = actualAddedSelfCheckCount,
|
|
|
- };
|
|
|
+ labelerGroup.LabelCaseQuantityItem.Remaining += requiredFrameTotal;
|
|
|
+ labelerGroup.LabelCaseQuantityItem.Required += requiredFrameTotal;
|
|
|
}
|
|
|
await labelerGroupDataManager.CreateLabelerGroupAsync(labelerGroup);
|
|
|
}
|
|
@@ -5146,7 +5149,7 @@ namespace aipsvr.Services
|
|
|
labelerGroup.LabelCaseQuantityItem.Total += assignFrameTotal;
|
|
|
labelerGroup.GoldStandardAssignedCount += actualAddedGoldStandardCount;
|
|
|
labelerGroup.SelfCheckAssignedCount += actualAddedSelfCheckCount;
|
|
|
- if (!hasVideo || videoItem.FrameMode == FrameMode.MaxInterval)
|
|
|
+ if (!developConfirmStatusInGroupDict.ContainsValue(DevelopConfirmStatus.WaitForConfirm))
|
|
|
{
|
|
|
labelerGroup.LabelCaseQuantityItem.Remaining += requiredFrameTotal;
|
|
|
labelerGroup.LabelCaseQuantityItem.Required += requiredFrameTotal;
|