Skip to content

Commit

Permalink
Merge pull request #386 from SCIInstitute/segmentation-data-loading-fix
Browse files Browse the repository at this point in the history
Fix segmentation data erroniously rendering as image data
  • Loading branch information
JakeWags authored Jul 11, 2024
2 parents 76da0a0 + 47c5a63 commit fc3a3c6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion web/shapeworks/src/components/ShapeViewer/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export default {
colorMode: ColorMode.MAP_SCALARS,
scalarMode: ScalarMode.USE_POINT_FIELD_DATA,
});
if (shapeData.getClassName() == 'vtkImageData') {
if (shapeData.getClassName() == 'vtkImageData' && layerName === 'Original - Image') {
this.addImage(shapeData, renderer)
} else {
if (shapeData.getClassName() == 'vtkPolyData') {
Expand Down
1 change: 1 addition & 0 deletions web/shapeworks/src/store/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export const layers = ref<Record<string, any>[]>([

export const vtkShapesByType = ref<Record<string, any[]>>({
"Original": [],
"Original - Image": [],
"Groomed": [],
"Reconstructed": [],
"Particles": [],
Expand Down
15 changes: 8 additions & 7 deletions web/shapeworks/src/views/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -435,14 +435,15 @@ export default {
(dataObject) => {
const shapePromises: Promise<vtkPolyData | vtkImageData>[] = [];
if(layersShown.value.includes("Original")){
shapePromises.push(
imageReader(
dataObject.file,
shortFileName(dataObject.file),
"Original",
dataObject.anatomy_type && { domain: dataObject.anatomy_type.replace('anatomy_', '') }
const layerLabel = dataObject.anatomy_type ? 'Original' : 'Original - Image'
shapePromises.push(
imageReader(
dataObject.file,
shortFileName(dataObject.file),
layerLabel,
dataObject.anatomy_type && { domain: dataObject.anatomy_type.replace('anatomy_', '') }
)
)
)
}
if(layersShown.value.includes("Groomed")){
if (
Expand Down

0 comments on commit fc3a3c6

Please sign in to comment.