-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement option to export proofreading as segmentation #8286
base: master
Are you sure you want to change the base?
Changes from 5 commits
6fb59f7
684a3a2
63f31b8
a935314
70b5ef0
b0a9982
721fc70
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -208,6 +208,8 @@ function startSegmentationAnnotationDependentJob( | |||||
annotationId: string, | ||||||
annotationType: APIAnnotationType, | ||||||
mergeSegments?: boolean, | ||||||
includesProofreading?: boolean, | ||||||
selectedBoundingBox?: Vector6, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "selected" sounds as if this variable would refer to a bounding box (ID) selected in the UI. I'd rename it to simply |
||||||
): Promise<APIJob> { | ||||||
const requestURL = new URL(`/api/jobs/run/${jobURLPath}/${datasetId}`, location.origin); | ||||||
if (volumeLayerName != null) { | ||||||
|
@@ -222,6 +224,12 @@ function startSegmentationAnnotationDependentJob( | |||||
if (mergeSegments != null) { | ||||||
requestURL.searchParams.append("mergeSegments", mergeSegments.toString()); | ||||||
} | ||||||
if (includesProofreading != null) { | ||||||
requestURL.searchParams.append("includesProofreading", includesProofreading.toString()); | ||||||
} | ||||||
if (selectedBoundingBox) { | ||||||
requestURL.searchParams.append("selectedBoundingBox", selectedBoundingBox.toString()); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
should be identical, but in your variant one has to know how JS serializes number arrays. I find it better to be explicit about it. |
||||||
} | ||||||
return Request.receiveJSON(requestURL.href, { | ||||||
method: "POST", | ||||||
}); | ||||||
|
@@ -235,6 +243,8 @@ export function startMaterializingVolumeAnnotationJob( | |||||
annotationId: string, | ||||||
annotationType: APIAnnotationType, | ||||||
mergeSegments: boolean, | ||||||
includesProofreading: boolean, | ||||||
selectedBoundingBox?: Vector6, | ||||||
): Promise<APIJob> { | ||||||
return startSegmentationAnnotationDependentJob( | ||||||
"materializeVolumeAnnotation", | ||||||
|
@@ -245,6 +255,8 @@ export function startMaterializingVolumeAnnotationJob( | |||||
annotationId, | ||||||
annotationType, | ||||||
mergeSegments, | ||||||
includesProofreading, | ||||||
selectedBoundingBox, | ||||||
); | ||||||
} | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -891,6 +891,7 @@ export function MaterializeVolumeAnnotationModal({ | |
}: MaterializeVolumeAnnotationModalProps) { | ||
const dataset = useSelector((state: OxalisState) => state.dataset); | ||
const tracing = useSelector((state: OxalisState) => state.tracing); | ||
let includesProofreading = false; | ||
const activeSegmentationTracingLayer = useSelector(getActiveSegmentationTracingLayer); | ||
const fixedSelectedLayer = selectedVolumeLayer || activeSegmentationTracingLayer; | ||
const readableVolumeLayerName = | ||
|
@@ -925,6 +926,8 @@ export function MaterializeVolumeAnnotationModal({ | |
output dataset and the output segmentation layer. | ||
</p> | ||
); | ||
} else { | ||
includesProofreading = tracing.volumes.some((v) => v.hasEditableMapping === true); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If my annotation contains two volume layers and only one has an editable mapping, that property will be true. However, i I want to export the layer that has no editable mapping, |
||
} | ||
const jobImage = | ||
jobNameToImagePath[jobName] != null ? ( | ||
|
@@ -954,8 +957,13 @@ export function MaterializeVolumeAnnotationModal({ | |
jobName={"materialize_volume_annotation"} | ||
suggestedDatasetSuffix="with_merged_segmentation" | ||
chooseSegmentationLayer | ||
isBoundingBoxConfigurable={includesProofreading} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. only proofread layers support configuring the bbox? would it be easy to always support it when exporting volume annotations? no prio though. |
||
fixedSelectedLayer={fixedSelectedLayer} | ||
jobApiCall={async ({ newDatasetName, selectedLayer: segmentationLayer }) => { | ||
jobApiCall={async ({ | ||
newDatasetName, | ||
selectedLayer: segmentationLayer, | ||
selectedBoundingBox, | ||
}) => { | ||
// There are 3 cases for the value assignments to volumeLayerName and baseSegmentationName for the job: | ||
// 1. There is a volume annotation with a fallback layer. volumeLayerName will reference the volume layer | ||
// and baseSegmentationName will reference the fallback layer. The job will merge those layers. | ||
|
@@ -968,6 +976,9 @@ export function MaterializeVolumeAnnotationModal({ | |
? getReadableNameOfVolumeLayer(segmentationLayer, tracing) | ||
: null; | ||
const baseSegmentationName = getBaseSegmentationName(segmentationLayer); | ||
const bbox = selectedBoundingBox?.boundingBox | ||
? computeArrayFromBoundingBox(selectedBoundingBox.boundingBox) | ||
: undefined; | ||
return startMaterializingVolumeAnnotationJob( | ||
dataset.id, | ||
baseSegmentationName, | ||
|
@@ -976,6 +987,8 @@ export function MaterializeVolumeAnnotationModal({ | |
tracing.annotationId, | ||
tracing.annotationType, | ||
isMergerModeEnabled, | ||
includesProofreading, | ||
bbox, | ||
); | ||
}} | ||
description={ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.